1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
5 PYTHON_COMPAT=( python3_{6,7,8} )
7 inherit meson multilib-minimal flag-o-matic udev python-any-r1
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"
13 LICENSE="GPL-2 LGPL-2.1"
15 KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 ~s390 sparc x86"
17 RESTRICT="!test? ( test )"
19 BDEPEND="virtual/pkgconfig
22 $(python_gen_any_dep 'dev-python/pytest[${PYTHON_USEDEP}]')
24 RDEPEND=">=sys-fs/fuse-common-3.3.0-r1"
26 DOCS=( AUTHORS ChangeLog.rst README.md doc/README.NFS doc/kernel.txt )
29 has_version -b "dev-python/pytest[${PYTHON_USEDEP}]"
33 use test && python_setup
39 # lto not supported yet -- https://github.com/libfuse/libfuse/issues/198
43 multilib_src_configure() {
45 -Dexamples=$(usex test true false)
47 -Dudevrulesdir="${EPREFIX}$(get_udevdir)/rules.d"
52 multilib_src_compile() {
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"
62 multilib-minimal_src_test
67 ${EPYTHON} -m pytest test || die
70 multilib_src_install() {
71 DESTDIR="${D}" eninja install
74 multilib_src_install_all() {
77 # installed via fuse-common
78 rm -r "${ED}"/{etc,$(get_udevdir)} || die
80 # useroot=false prevents the build system from doing this.
81 use suid && fperms u+s /usr/bin/fusermount3
83 # manually install man pages to respect compression
84 rm -r "${ED}"/usr/share/man || die
85 doman doc/{fusermount3.1,mount.fuse3.8}