sys-fs/ntfs3g: x86 stable wrt bug #717640
[gentoo.git] / sys-fs / fuse / fuse-3.9.1.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=7
5 PYTHON_COMPAT=( python3_{6,7,8} )
6
7 inherit meson multilib-minimal flag-o-matic udev python-any-r1
8
9 DESCRIPTION="An interface for filesystems implemented in userspace"
10 HOMEPAGE="https://github.com/libfuse/libfuse"
11 SRC_URI="https://github.com/libfuse/libfuse/releases/download/${P}/${P}.tar.xz"
12
13 LICENSE="GPL-2 LGPL-2.1"
14 SLOT="3"
15 KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 ~s390 sparc x86"
16 IUSE="+suid test"
17 RESTRICT="!test? ( test )"
18
19 BDEPEND="virtual/pkgconfig
20         test? (
21                 ${PYTHON_DEPS}
22                 $(python_gen_any_dep 'dev-python/pytest[${PYTHON_USEDEP}]')
23         )"
24 RDEPEND=">=sys-fs/fuse-common-3.3.0-r1"
25
26 DOCS=( AUTHORS ChangeLog.rst README.md doc/README.NFS doc/kernel.txt )
27
28 python_check_deps() {
29         has_version -b "dev-python/pytest[${PYTHON_USEDEP}]"
30 }
31
32 pkg_setup() {
33         use test && python_setup
34 }
35
36 src_prepare() {
37         default
38
39         # lto not supported yet -- https://github.com/libfuse/libfuse/issues/198
40         filter-flags '-flto*'
41 }
42
43 multilib_src_configure() {
44         local emesonargs=(
45                 -Dexamples=$(usex test true false)
46                 -Duseroot=false
47                 -Dudevrulesdir="${EPREFIX}$(get_udevdir)/rules.d"
48         )
49         meson_src_configure
50 }
51
52 multilib_src_compile() {
53         eninja
54 }
55
56 src_test() {
57         if [[ ${EUID} != 0 ]]; then
58                 ewarn "Running as non-root user, skipping tests"
59         elif has sandbox ${FEATURES}; then
60                 ewarn "Sandbox enabled, skipping tests"
61         else
62                 multilib-minimal_src_test
63         fi
64 }
65
66 multilib_src_test() {
67         ${EPYTHON} -m pytest test || die
68 }
69
70 multilib_src_install() {
71         DESTDIR="${D}" eninja install
72 }
73
74 multilib_src_install_all() {
75         einstalldocs
76
77         # installed via fuse-common
78         rm -r "${ED}"/{etc,$(get_udevdir)} || die
79
80         # useroot=false prevents the build system from doing this.
81         use suid && fperms u+s /usr/bin/fusermount3
82
83         # manually install man pages to respect compression
84         rm -r "${ED}"/usr/share/man || die
85         doman doc/{fusermount3.1,mount.fuse3.8}
86 }