sys-apps/systemd: restore static-libs support
authorMike Gilbert <floppym@gentoo.org>
Sat, 26 Oct 2019 17:18:09 +0000 (13:18 -0400)
committerMike Gilbert <floppym@gentoo.org>
Sat, 26 Oct 2019 17:18:09 +0000 (13:18 -0400)
This also moves all libs for non-native ABIs to /usr.

Package-Manager: Portage-2.3.78_p4, Repoman-2.3.17_p100
Signed-off-by: Mike Gilbert <floppym@gentoo.org>
sys-apps/systemd/systemd-9999.ebuild

index 2332516c1aa45c0776b1c8ab7763dd480b3ac910..261851cf5bbcf5902002a236df26f3669fe3ef8d 100644 (file)
@@ -16,14 +16,14 @@ fi
 
 PYTHON_COMPAT=( python{3_5,3_6,3_7} )
 
-inherit bash-completion-r1 linux-info meson multilib-minimal ninja-utils pam python-any-r1 systemd toolchain-funcs udev
+inherit bash-completion-r1 linux-info meson multilib-minimal ninja-utils pam python-any-r1 systemd toolchain-funcs udev usr-ldscript
 
 DESCRIPTION="System and service manager for Linux"
 HOMEPAGE="https://www.freedesktop.org/wiki/Software/systemd"
 
 LICENSE="GPL-2 LGPL-2.1 MIT public-domain"
 SLOT="0/2"
-IUSE="acl apparmor audit build cgroup-hybrid cryptsetup curl dns-over-tls elfutils +gcrypt gnuefi http idn importd +kmod +lz4 lzma nat pam pcre policykit qrcode +resolvconf +seccomp selinux split-usr +sysv-utils test vanilla xkb"
+IUSE="acl apparmor audit build cgroup-hybrid cryptsetup curl dns-over-tls elfutils +gcrypt gnuefi http idn importd +kmod +lz4 lzma nat pam pcre policykit qrcode +resolvconf +seccomp selinux split-usr static-libs +sysv-utils test vanilla xkb"
 
 REQUIRED_USE="importd? ( curl gcrypt lzma )"
 RESTRICT="!test? ( test )"
@@ -299,8 +299,18 @@ multilib_src_configure() {
                -Dtimesyncd=$(meson_multilib)
                -Dtmpfiles=$(meson_multilib)
                -Dvconsole=$(meson_multilib)
+
+               # static-libs
+               -Dstatic-libsystemd=$(usex static-libs true false)
+               -Dstatic-libudev=$(usex static-libs true false)
        )
 
+       if multilib_is_native_abi; then
+               myconf+=( -Drootlibdir="${EPREFIX}$(usex split-usr '' /usr)/$(get_libdir)" )
+       else
+               myconf+=( -Drootlibdir="${EPREFIX}/usr/$(get_libdir)" )
+       fi
+
        meson_src_configure "${myconf[@]}"
 }
 
@@ -360,6 +370,11 @@ multilib_src_install_all() {
                # Avoid breaking boot/reboot
                dosym ../../../lib/systemd/systemd /usr/lib/systemd/systemd
                dosym ../../../lib/systemd/systemd-shutdown /usr/lib/systemd/systemd-shutdown
+
+               if use static-libs; then
+                       mv "${ED}/$(get_libdir)"/lib{systemd,udev}.a "${ED}/usr/$(get_libdir)/" || die
+                       gen_usr_ldscript lib{systemd,udev}.so
+               fi
        fi
 }