1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 inherit flag-o-matic libtool toolchain-funcs multilib-minimal usr-ldscript
8 if [[ ${PV} == 9999 ]] ; then
9 EGIT_REPO_URI="https://git.savannah.gnu.org/git/${PN}.git"
11 inherit autotools git-r3
13 KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux"
14 SRC_URI="mirror://nongnu/${PN}/${P}.tar.gz"
17 DESCRIPTION="Extended attributes tools"
18 HOMEPAGE="https://savannah.nongnu.org/projects/attr"
22 IUSE="debug nls static-libs"
24 DEPEND="nls? ( sys-devel/gettext )"
27 # Remove -flto* from flags as this breaks binaries (bug #644048)
34 if [[ ${PV} == 9999 ]] ; then
35 po/update-potfiles || die
43 multilib_src_configure() {
44 unset PLATFORM #184564
45 export OPTIMIZER=${CFLAGS}
48 tc-ld-disable-gold #644048
51 --bindir="${EPREFIX}"/bin
53 $(use_enable static-libs static)
55 --libexecdir="${EPREFIX}"/usr/$(get_libdir)
58 ECONF_SOURCE="${S}" econf "${myeconfargs[@]}"
61 multilib_src_install() {
62 emake DESTDIR="${D}" install
64 # Sanity check until we track down why this is happening. #644048
65 local lib="${ED}/usr/$(get_libdir)/libattr.so.1"
66 if [[ -e ${lib} ]] ; then
67 local versions=$(readelf -V "${lib}")
68 local symbols=$(readelf -sW "${lib}")
69 if [[ "${versions}" != *"ATTR_1.0"* || \
70 "${versions}" != *"ATTR_1.1"* || \
71 "${versions}" != *"ATTR_1.2"* || \
72 "${versions}" != *"ATTR_1.3"* || \
73 "${symbols}" != *"getxattr@ATTR_1.0"* ]] ; then
74 echo "# readelf -V ${lib}"
76 echo "# readelf -sW ${lib}"
78 die "symbol version sanity check failed; please comment on https://bugs.gentoo.org/644048"
80 einfo "${lib} passed symbol checks"
84 if multilib_is_native_abi; then
85 # we install attr into /bin, so we need the shared lib with it
86 gen_usr_ldscript -a attr
89 # Add a wrapper until people upgrade.
90 insinto /usr/include/attr
91 newins "${FILESDIR}"/xattr-shim.h xattr.h
94 multilib_src_install_all() {
95 if ! use static-libs; then
96 find "${ED}" -name '*.la' -delete || die