--- util-linux-2.24.ebuild +++ util-linux-2.24-r1.ebuild @@ -6,7 +6,7 @@ EAPI=5 PYTHON_COMPAT=( python2_7 python3_{2,3} ) -inherit eutils toolchain-funcs libtool flag-o-matic bash-completion-r1 python-single-r1 +inherit eutils toolchain-funcs libtool flag-o-matic bash-completion-r1 python-single-r1 multilib-minimal MY_PV=${PV/_/-} MY_P=${PN}-${MY_PV} @@ -38,7 +38,7 @@ RDEPEND="!sys-process/schedutils ncurses? ( >=sys-libs/ncurses-5.2-r2 ) pam? ( sys-libs/pam ) python? ( ${PYTHON_DEPS} ) - selinux? ( sys-libs/libselinux ) + selinux? ( sys-libs/libselinux[${MULTILIB_USEDEP}] ) slang? ( sys-libs/slang ) udev? ( virtual/udev )" DEPEND="${RDEPEND} @@ -76,27 +76,39 @@ lfs_fallocate_test() { rm -f "${T}"/fallocate.c } -src_configure() { +nativex() { + multilib_build_binaries && echo "$1" || echo "$2" +} + +native_use_enable() { nativex "$(use_enable "$@")" "--disable-${2:-$1}"; } +native_use_with() { nativex "$(use_with "$@")" "--without-${2:-$1}"; } +native_enable() { echo "--$(nativex enable disable)-$1"; } + +multilib_src_configure() { + local CFLAGS="${CFLAGS}" CPPFLAGS="${CPPFLAGS}" LDFLAGS="${LDFLAGS}" + local ac_cv_func_fallocate + lfs_fallocate_test - export ac_cv_header_security_pam_misc_h=$(usex pam) #485486 + export ac_cv_header_security_pam_misc_h=$(nativex $(usex pam) no) #485486 + ECONF_SOURCE="${S}" \ econf \ --enable-fs-paths-extra=/usr/sbin:/bin:/usr/bin \ $(use_enable nls) \ --enable-agetty \ --with-bashcompletiondir="$(get_bashcompdir)" \ $(use_enable bash-completion) \ - $(use_enable caps setpriv) \ - $(use_enable cramfs) \ + $(native_use_enable caps setpriv) \ + $(native_use_enable cramfs) \ $(use_enable cytune) \ $(use_enable fdformat) \ - --with-ncurses=$(usex ncurses $(usex unicode auto yes) no) \ + --with-ncurses=$(nativex $(usex ncurses $(usex unicode auto yes) no) no) \ --disable-kill \ --disable-last \ --disable-login \ $(use_enable tty-helpers mesg) \ --disable-nologin \ --enable-partx \ - $(use_with python) \ + $(native_use_with python) \ --enable-raw \ --enable-rename \ --disable-reset \ @@ -107,17 +119,29 @@ src_configure() { $(use_enable suid makeinstall-chown) \ $(use_enable suid makeinstall-setuid) \ $(use_with selinux) \ - $(use_with slang) \ + $(native_use_with slang) \ $(use_enable static-libs static) \ - $(use_with udev) \ + $(native_use_with udev) \ $(tc-has-tls || echo --disable-tls) } -src_install() { - default - dodoc AUTHORS NEWS README* Documentation/{TODO,*.txt,releases/*} +multilib_src_compile() { + if multilib_build_binaries; then + default + else + emake libuuid.la libblkid.la libmount.la + fi +} - use python && python_optimize +multilib_src_install() { + if multilib_build_binaries; then + emake DESTDIR="${D}" install + use python && python_optimize + else + emake DESTDIR="${D}" install-usrlib_execLTLIBRARIES \ + install-pkgconfigDATA install-uuidincHEADERS \ + install-nodist_blkidincHEADERS install-nodist_mountincHEADERS + fi # need the libs in / gen_usr_ldscript -a blkid mount uuid @@ -126,6 +150,10 @@ src_install() { prune_libtool_files } +multilib_src_install_all() { + dodoc AUTHORS NEWS README* Documentation/{TODO,*.txt,releases/*} +} + pkg_postinst() { if ! use tty-helpers; then elog "The mesg/wall/write tools have been disabled due to USE=-tty-helpers."