1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 inherit flag-o-matic toolchain-funcs systemd usr-ldscript
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"
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(+)]}
25 nls? ( sys-devel/gettext )
29 "${FILESDIR}"/${PN}-4.15.0-docdir.patch
30 "${FILESDIR}"/${PN}-5.3.0-libdir.patch
34 if use readline && use libedit ; then
35 ewarn "You have USE='readline libedit' but these are exclusive."
36 ewarn "Defaulting to readline; please disable this USE flag if you want libedit."
45 -e "/^PKG_DOC_DIR/s:@pkg_name@:${PF}:" \
46 include/builddefs.in || die
48 # Don't install compressed docs
49 sed 's@\(CHANGES\)\.gz[[:space:]]@\1 @' -i doc/Makefile || die
53 # include/builddefs.in will add FCFLAGS to CFLAGS which will
54 # unnecessarily clutter CFLAGS (and fortran isn't used)
59 # Package is honoring CFLAGS; No need to use OPTIMIZER anymore.
60 # However, we have to provide an empty value to avoid default
64 unset PLATFORM # if set in user env, this breaks configure
66 # Upstream does NOT support --disable-static anymore,
67 # https://www.spinics.net/lists/linux-xfs/msg30185.html
68 # https://www.spinics.net/lists/linux-xfs/msg30272.html
71 --with-crond-dir="${EPREFIX}/etc/cron.d"
72 --with-systemd-unit-dir="$(systemd_get_systemunitdir)"
73 $(use_enable icu libicu)
74 $(use_enable nls gettext)
75 $(use_enable readline)
76 $(usex readline --disable-editline $(use_enable libedit editline))
79 if is-flagq -fno-lto ; then
80 einfo "LTO disabled via {C,CXX,F,FC}FLAGS"
81 myconf+=( --disable-lto )
83 if is-flagq -flto ; then
84 einfo "LTO forced via {C,CXX,F,FC}FLAGS"
85 myconf+=( --enable-lto )
86 elif use amd64 || use x86 ; then
87 # match upstream default
88 myconf+=( --enable-lto )
90 # LTO can cause problems on some architectures, bug 655638
91 myconf+=( --disable-lto )
103 emake DIST_ROOT="${ED}" install
104 emake DIST_ROOT="${ED}" install-dev
106 gen_usr_ldscript -a handle