--- gentoo/sys-fs/e2fsprogs/e2fsprogs-1.46.4.ebuild 2021-08-20 09:09:50.000000000 +0000 +++ local/sys-fs/e2fsprogs/e2fsprogs-1.46.4.ebuild 2021-09-20 23:05:56.075261667 +0000 @@ -3,7 +3,7 @@ EAPI=7 -inherit flag-o-matic systemd toolchain-funcs udev usr-ldscript +inherit flag-o-matic systemd toolchain-funcs udev usr-ldscript multilib-minimal DESCRIPTION="Standard EXT2/EXT3/EXT4 filesystem utilities" HOMEPAGE="http://e2fsprogs.sourceforge.net/" @@ -13,13 +13,17 @@ LICENSE="GPL-2 BSD" SLOT="0" KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux" -IUSE="cron fuse lto nls static-libs +threads elibc_FreeBSD" +IUSE="cron fuse lto nls static-libs +threads +tools elibc_FreeBSD" -RDEPEND="~sys-libs/${PN}-libs-${PV} - >=sys-apps/util-linux-2.16 +RDEPEND=" + !sys-libs/com_err + !sys-libs/ss + !sys-libs/${PN}-libs cron? ( sys-fs/lvm2[-device-mapper-only(-)] ) fuse? ( sys-fs/fuse:0 ) - nls? ( virtual/libintl )" + nls? ( virtual/libintl ) + tools? ( >=sys-apps/util-linux-2.16 ) +" DEPEND="${RDEPEND}" BDEPEND=" nls? ( sys-devel/gettext ) @@ -34,6 +38,14 @@ # Upstream patches (can usually removed with next version bump) ) +pkg_setup() { + if use tools ; then + MULTILIB_WRAPPED_HEADERS=( + /usr/include/ext2fs/ext2_types.h + ) + fi +} + src_prepare() { if [[ ${CHOST} == *-mint* ]] ; then PATCHES+=( "${WORKDIR}"/${PN}-1.42.9-mint-r1.patch ) @@ -47,22 +59,13 @@ # violation due to mktexfmt invocation rm -r doc || die "Failed to remove doc dir" - # blargh ... trick e2fsprogs into using e2fsprogs-libs + # prevent included intl cruft from building #81096 sed -i -r \ -e 's:@LIBINTL@:@LTLIBINTL@:' \ - -e '/^(STATIC_)?LIB(COM_ERR|SS)/s:[$][(]LIB[)]/lib([^@]*)@(STATIC_)?LIB_EXT@:-l\1:' \ - -e '/^DEP(STATIC_)?LIB(COM_ERR|SS)/s:=.*:=:' \ - MCONFIG.in || die "muck libs" #122368 - sed -i -r \ - -e '/^LIB_SUBDIRS/s:lib/(et|ss)::g' \ - Makefile.in || die "remove subdirs" - ln -s $(which mk_cmds) lib/ss/ || die - - # Avoid rebuild - echo '#include_next ' > lib/ss/ss_err.h + MCONFIG.in || die 'intl cruft' } -src_configure() { +multilib_src_configure() { # Keep the package from doing silly things #261411 export VARTEXFONTS="${T}/fonts" @@ -77,16 +80,28 @@ --enable-symlink-install --enable-elf-shlibs $(tc-has-tls || echo --disable-tls) - $(use_enable fuse fuse2fs) + $(multilib_native_use_enable fuse fuse2fs) $(use_enable nls) --disable-libblkid --disable-libuuid + $(multilib_native_use_enable tools e2initrd-helper) --disable-fsck --disable-uuidd $(use_enable lto) $(use_with threads pthread) ) - ac_cv_path_LDCONFIG=: econf "${myeconfargs[@]}" + + # we use blkid/uuid from util-linux now + if use kernel_linux ; then + export ac_cv_lib_{uuid_uuid_generate,blkid_blkid_get_cache}=yes + fi + + ac_cv_path_LDCONFIG=: \ + ECONF_SOURCE="${S}" \ + CC="$(tc-getCC)" \ + BUILD_CC="$(tc-getBUILD_CC)" \ + BUILD_LD="$(tc-getBUILD_LD)" \ + econf "${myeconfargs[@]}" if [[ ${CHOST} != *-uclibc ]] && grep -qs 'USE_INCLUDED_LIBINTL.*yes' config.{log,status} ; then eerror "INTL sanity check failed, aborting build." @@ -96,8 +111,18 @@ fi } -src_compile() { - emake V=1 COMPILE_ET=compile_et MK_CMDS=mk_cmds +multilib_src_compile() { + if ! multilib_is_native_abi || ! use tools ; then + emake -C lib/et V=1 + emake -C lib/ss V=1 + if use tools ; then + emake -C lib/ext2fs V=1 + emake -C lib/e2p V=1 + fi + return 0 + fi + + emake V=1 # Build the FreeBSD helper if use elibc_FreeBSD ; then @@ -106,38 +131,54 @@ fi } -src_install() { - # need to set root_libdir= manually as any --libdir options in the - # econf above (i.e. multilib) will screw up the default #276465 - emake \ - STRIP=: \ - root_libdir="${EPREFIX}/usr/$(get_libdir)" \ - DESTDIR="${D}" \ - install - - einstalldocs - - insinto /etc - doins "${FILESDIR}"/e2fsck.conf +multilib_src_install() { + if ! multilib_is_native_abi || ! use tools ; then + emake -C lib/et V=1 DESTDIR="${D}" install + emake -C lib/ss V=1 DESTDIR="${D}" install + if use tools ; then + emake -C lib/ext2fs V=1 DESTDIR="${D}" install + emake -C lib/e2p V=1 DESTDIR="${D}" install + fi + else + emake \ + STRIP=: \ + DESTDIR="${D}" \ + install + + # Move shared libraries to /lib/, install static libraries to + # /usr/lib/, and install linker scripts to /usr/lib/. + gen_usr_ldscript -a e2p ext2fs + + if use elibc_FreeBSD ; then + # Install helpers for us + into / + dosbin "${S}"/fsck_ext2fs + fi + fi - # Move shared libraries to /lib/, install static libraries to - # /usr/lib/, and install linker scripts to /usr/lib/. - gen_usr_ldscript -a e2p ext2fs + gen_usr_ldscript -a com_err ss $(usex kernel_linux '' 'uuid blkid') # configure doesn't have an option to disable static libs :/ if ! use static-libs ; then find "${ED}" -name '*.a' -delete || die fi +} - if use elibc_FreeBSD ; then - # Install helpers for us - into / - dosbin "${S}"/fsck_ext2fs - doman "${FILESDIR}"/fsck_ext2fs.8 - - # filefrag is linux only - rm \ - "${ED}"/usr/sbin/filefrag \ - "${ED}"/usr/share/man/man8/filefrag.8 || die +multilib_src_install_all() { + einstalldocs + + if use tools ; then + insinto /etc + doins "${FILESDIR}"/e2fsck.conf + + if use elibc_FreeBSD ; then + into / + doman "${FILESDIR}"/fsck_ext2fs.8 + + # filefrag is linux only + rm \ + "${ED}"/usr/sbin/filefrag \ + "${ED}"/usr/share/man/man8/filefrag.8 || die + fi fi } --- gentoo/sys-fs/e2fsprogs/metadata.xml 2021-09-11 13:40:17.000000000 +0000 +++ local/sys-fs/e2fsprogs/metadata.xml 2021-09-20 21:46:54.910331830 +0000 @@ -9,6 +9,7 @@ Install e2scrub_all cron script Build fuse2fs, a FUSE file system client for ext2/ext3/ext4 file systems Build with link time optimization (LTO) + Build extfs tools (mke2fs, e2fsck, tune2fs, etc.) cpe:/a:e2fsprogs_project:e2fsprogs