From 21720048033e9e7bbe1e7ac8420698db25331518 Mon Sep 17 00:00:00 2001 From: Krzesimir Nowak Date: Fri, 17 Sep 2021 17:35:30 +0200 Subject: [PATCH] sys-apps/systemd: Reimplement builddir_ functions This is to avoid querying pkg-config for this information and overriding the SYSROOT variable. These hacks seem to be broken with the change of the pkgconfig implementation. We know what will the path for the directory of the system units - it's based on rootprefix that we pass to configure script. So use this knowledge directly instead of getting it in a roundabout way from pkg-config file. --- .../sys-apps/systemd/systemd-9999.ebuild | 26 +++++++++++-------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/sdk_container/src/third_party/coreos-overlay/sys-apps/systemd/systemd-9999.ebuild b/sdk_container/src/third_party/coreos-overlay/sys-apps/systemd/systemd-9999.ebuild index e2fb46fa05..659aa6409b 100644 --- a/sdk_container/src/third_party/coreos-overlay/sys-apps/systemd/systemd-9999.ebuild +++ b/sdk_container/src/third_party/coreos-overlay/sys-apps/systemd/systemd-9999.ebuild @@ -247,6 +247,10 @@ src_configure() { multilib-minimal_src_configure } +get_rootprefix() { + usex split-usr "${EPREFIX:-/}" "${EPREFIX}/usr" +} + multilib_src_configure() { local myconf=( --localstatedir="${EPREFIX}/var" @@ -258,7 +262,7 @@ multilib_src_configure() { # make sure we get /bin:/sbin in PATH $(meson_use split-usr) -Dsplit-bin=true - -Drootprefix="$(usex split-usr "${EPREFIX:-/}" "${EPREFIX}/usr")" + -Drootprefix="$(get_rootprefix)" -Drootlibdir="${EPREFIX}/usr/$(get_libdir)" # Avoid infinite exec recursion, bug 642724 -Dtelinit-path="${EPREFIX}/lib/sysvinit/telinit" @@ -500,18 +504,18 @@ multilib_src_install_all() { # dropped it. } -builddir_systemd_enable_service() { - ( - export SYSROOT="${ED}" - systemd_enable_service "$@" - ) +builddir_systemd_get_systemunitdir() { + echo "$(get_rootprefix)/lib/systemd/system" } -builddir_systemd_get_systemunitdir() { - ( - export SYSROOT="${ED}" - systemd_get_systemunitdir - ) +builddir_systemd_enable_service() { + local target=${1} + local service=${2} + local ud=$(builddir_systemd_get_systemunitdir) + local destname=${service##*/} + + dodir "${ud}"/"${target}".wants && \ + dosym ../"${service}" "${ud}"/"${target}".wants/"${destname}" } migrate_locale() {