net-libs/webkit-gtk: arm64 stable
[gentoo.git] / sys-libs / e2fsprogs-libs / e2fsprogs-libs-1.44.5.ebuild
1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI="6"
5
6 inherit toolchain-funcs multilib-minimal
7
8 MY_PN=${PN%-libs}
9 MY_P="${MY_PN}-${PV}"
10
11 DESCRIPTION="e2fsprogs libraries (common error and subsystem)"
12 HOMEPAGE="http://e2fsprogs.sourceforge.net/"
13 SRC_URI="mirror://sourceforge/e2fsprogs/${MY_P}.tar.xz
14         mirror://kernel/linux/kernel/people/tytso/e2fsprogs/v${PV}/${MY_P}.tar.xz"
15
16 LICENSE="GPL-2"
17 SLOT="0"
18 KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~m68k-mint ~x86-solaris"
19 IUSE="static-libs"
20
21 RDEPEND="!sys-libs/com_err
22         !sys-libs/ss
23         !<sys-fs/e2fsprogs-1.41.8"
24 DEPEND="virtual/pkgconfig"
25
26 S="${WORKDIR}/${MY_P}"
27
28 PATCHES=(
29         "${FILESDIR}"/${PN}-1.42.13-fix-build-cflags.patch #516854
30 )
31
32 src_prepare() {
33         default
34
35         cp doc/RelNotes/v${PV}.txt ChangeLog || die "Failed to copy Release Notes"
36 }
37
38 multilib_src_configure() {
39         local myconf=(
40                 --enable-elf-shlibs
41                 $(tc-has-tls || echo --disable-tls)
42                 --disable-e2initrd-helper
43                 --disable-fsck
44         )
45
46         # we use blkid/uuid from util-linux now
47         if use kernel_linux ; then
48                 export ac_cv_lib_{uuid_uuid_generate,blkid_blkid_get_cache}=yes
49                 myconf+=( --disable-lib{blkid,uuid} )
50         fi
51
52         ac_cv_path_LDCONFIG=: \
53         ECONF_SOURCE="${S}" \
54         CC="$(tc-getCC)" \
55         BUILD_CC="$(tc-getBUILD_CC)" \
56         BUILD_LD="$(tc-getBUILD_LD)" \
57         econf "${myconf[@]}"
58 }
59
60 multilib_src_compile() {
61         emake -C lib/et V=1 || die "Failed to build libcom"
62
63         emake -C lib/ss V=1 || die "Failed to build libss"
64 }
65
66 multilib_src_test() {
67         if multilib_is_native_abi; then
68                 emake -C lib/et V=1 check || die "Failed to test libcom"
69
70                 emake -C lib/ss V=1 check || die "Failed to test libss"
71         fi
72 }
73
74 multilib_src_install() {
75         emake -C lib/et V=1 DESTDIR="${D%/}" install || die "Failed to install libcom"
76
77         emake -C lib/ss V=1 DESTDIR="${D%/}" install || die "Failed to install libss"
78
79         # We call "gen_usr_ldscript -a" to ensure libs are present in /lib to support
80         # split /usr (e.g. "e2fsck" from sys-fs/e2fsprogs is installed in /sbin and
81         # links to libcom_err.so).
82         gen_usr_ldscript -a com_err ss $(usex kernel_linux '' 'uuid blkid')
83
84         if ! use static-libs ; then
85                 find "${ED%/}" -name '*.a' -delete || die
86         fi
87 }
88
89 multilib_src_install_all() {
90         # Package installs same header twice -- use symlink instead
91         dosym et/com_err.h /usr/include/com_err.h
92
93         einstalldocs
94 }