1 # Copyright 1999-2018 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 inherit toolchain-funcs multilib systemd
8 DESCRIPTION="xfs filesystem utilities"
9 HOMEPAGE="https://xfs.wiki.kernel.org/"
10 SRC_URI="https://www.kernel.org/pub/linux/utils/fs/xfs/${PN}/${P}.tar.xz"
14 KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
15 IUSE="icu libedit nls readline static-libs"
17 LIB_DEPEND=">=sys-apps/util-linux-2.17.2[static-libs(+)]
18 icu? ( dev-libs/icu:=[static-libs(+)] )
19 readline? ( sys-libs/readline:0=[static-libs(+)] )
20 !readline? ( libedit? ( dev-libs/libedit[static-libs(+)] ) )"
21 RDEPEND="${LIB_DEPEND//\[static-libs(+)]}
24 nls? ( sys-devel/gettext )"
27 "${FILESDIR}"/${PN}-4.9.0-underlinking.patch
28 "${FILESDIR}"/${PN}-4.15.0-sharedlibs.patch
29 "${FILESDIR}"/${PN}-4.15.0-docdir.patch
33 if use readline && use libedit ; then
34 ewarn "You have USE='readline libedit' but these are exclusive."
35 ewarn "Defaulting to readline; please disable this USE flag if you want libedit."
42 # Clear out -static from all flags since we want to link against dynamic xfs libs.
44 -e "/^PKG_DOC_DIR/s:@pkg_name@:${PF}:" \
45 include/builddefs.in || die
46 find -name Makefile -exec \
47 sed -i -r -e '/^LLDFLAGS [+]?= -static(-libtool-libs)?$/d' {} +
52 export OPTIMIZER=${CFLAGS}
53 unset PLATFORM # if set in user env, this breaks configure
58 --with-crond-dir="${EPREFIX}/etc/cron.d"
59 --with-systemd-unit-dir="$(systemd_get_systemunitdir)"
60 $(use_enable icu libicu)
61 $(use_enable nls gettext)
62 $(use_enable readline)
63 $(usex readline --disable-editline $(use_enable libedit editline))
64 $(use_enable static-libs static)
73 emake DIST_ROOT="${ED}" install
74 # parallel install fails on this target for >=xfsprogs-3.2.0
75 emake -j1 DIST_ROOT="${ED}" install-dev
77 # handle is for xfsdump, the rest for xfsprogs
78 gen_usr_ldscript -a handle xcmd xfs xlog frog
79 # removing unnecessary .la files if not needed
80 use static-libs || find "${ED}" -name '*.la' -delete