commit:     7daff7c1239b712c3064f435afd4c8ba80390ebb
Author:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Thu Jul 14 19:26:43 2022 +0000
Commit:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Thu Jul 14 19:29:55 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7daff7c1

sys-apps/baselayout-2.8-r1: add support for prefix-guest + keywords

Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org>

 ...layout-9999.ebuild => baselayout-2.8-r1.ebuild} | 35 +++++++++++++++++-----
 sys-apps/baselayout/baselayout-9999.ebuild         | 35 +++++++++++++++++-----
 2 files changed, 54 insertions(+), 16 deletions(-)

diff --git a/sys-apps/baselayout/baselayout-9999.ebuild 
b/sys-apps/baselayout/baselayout-2.8-r1.ebuild
similarity index 92%
copy from sys-apps/baselayout/baselayout-9999.ebuild
copy to sys-apps/baselayout/baselayout-2.8-r1.ebuild
index 089e43e1cb8c..c7096be3d978 100644
--- a/sys-apps/baselayout/baselayout-9999.ebuild
+++ b/sys-apps/baselayout/baselayout-2.8-r1.ebuild
@@ -12,13 +12,15 @@ if [[ ${PV} = 9999 ]]; then
        inherit git-r3
 else
        SRC_URI="https://gitweb.gentoo.org/proj/${PN}.git/snapshot/${P}.tar.bz2";
-       KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 
~riscv ~s390 ~sparc ~x86"
+       KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc 
~ppc64 ~riscv ~s390 ~sparc ~x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos 
~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris ~x86-winnt"
 fi
 
 LICENSE="GPL-2"
 SLOT="0"
 IUSE="build +split-usr"
 
+RDEPEND="!sys-apps/baselayout-prefix"
+
 pkg_setup() {
        multilib_layout
 }
@@ -212,14 +214,9 @@ pkg_preinst() {
 
 src_prepare() {
        default
-       if use prefix; then
-               hprefixify -e "/EUID/s,0,${EUID}," -q '"' etc/profile
-               hprefixify etc/{env.d/50baselayout,shells} share.Linux/passwd
-               echo PATH=/usr/sbin:/sbin:/usr/bin:/bin >> etc/env.d/99host
-       fi
 
        # don't want symlinked directories in PATH on systems with usr-merge
-       if ! use split-usr; then
+       if ! use split-usr && ! use prefix-guest; then
                sed \
                        -e 's|/usr/local/sbin:||g' \
                        -e 's|:/usr/sbin:|:|g' \
@@ -228,6 +225,20 @@ src_prepare() {
                        -i etc/env.d/50baselayout || die
        fi
 
+       if use prefix; then
+               hprefixify -e "/EUID/s,0,${EUID}," -q '"' etc/profile
+               hprefixify etc/shells share.Linux/passwd
+               hprefixify -w '/PATH=/' etc/env.d/50baselayout
+               hprefixify -w 1 etc/env.d/50baselayout
+               echo PATH=/usr/sbin:/sbin:/usr/bin:/bin >> etc/env.d/99host
+
+               # change branding
+               sed -i \
+                       -e '/gentoo-release/s/Gentoo Base/Gentoo Prefix Base/' \
+                       -e '/make_os_release/s/${OS}/Prefix/' \
+                       Makefile || die
+       fi
+
        # handle multilib paths.  do it here because we want this behavior
        # regardless of the C library that you're using.  we do explicitly
        # list paths which the native ldconfig searches, but this isn't
@@ -236,7 +247,9 @@ src_prepare() {
        # path and the symlinked path doesn't change the resulting cache.
        local libdir ldpaths
        for libdir in $(get_all_libdirs) ; do
-               use split-usr && ldpaths+=":${EPREFIX}/${libdir}"
+               if use split-usr || use prefix-guest; then
+                       ldpaths+=":${EPREFIX}/${libdir}"
+               fi
                ldpaths+=":${EPREFIX}/usr/${libdir}"
                ldpaths+=":${EPREFIX}/usr/local/${libdir}"
        done
@@ -249,6 +262,12 @@ src_install() {
                DESTDIR="${ED}" \
                install
 
+       if [[ ${CHOST} == *-darwin* ]] ; then
+               # add SDK path which contains development manpages
+               echo "MANPATH=${EPREFIX}/MacOSX.sdk/usr/share/man" \
+                       > "${ED}"/etc/env.d/98macos-sdk
+       fi
+
        # need the makefile in pkg_preinst
        insinto /usr/share/${PN}
        doins Makefile

diff --git a/sys-apps/baselayout/baselayout-9999.ebuild 
b/sys-apps/baselayout/baselayout-9999.ebuild
index 089e43e1cb8c..c7096be3d978 100644
--- a/sys-apps/baselayout/baselayout-9999.ebuild
+++ b/sys-apps/baselayout/baselayout-9999.ebuild
@@ -12,13 +12,15 @@ if [[ ${PV} = 9999 ]]; then
        inherit git-r3
 else
        SRC_URI="https://gitweb.gentoo.org/proj/${PN}.git/snapshot/${P}.tar.bz2";
-       KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 
~riscv ~s390 ~sparc ~x86"
+       KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc 
~ppc64 ~riscv ~s390 ~sparc ~x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos 
~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris ~x86-winnt"
 fi
 
 LICENSE="GPL-2"
 SLOT="0"
 IUSE="build +split-usr"
 
+RDEPEND="!sys-apps/baselayout-prefix"
+
 pkg_setup() {
        multilib_layout
 }
@@ -212,14 +214,9 @@ pkg_preinst() {
 
 src_prepare() {
        default
-       if use prefix; then
-               hprefixify -e "/EUID/s,0,${EUID}," -q '"' etc/profile
-               hprefixify etc/{env.d/50baselayout,shells} share.Linux/passwd
-               echo PATH=/usr/sbin:/sbin:/usr/bin:/bin >> etc/env.d/99host
-       fi
 
        # don't want symlinked directories in PATH on systems with usr-merge
-       if ! use split-usr; then
+       if ! use split-usr && ! use prefix-guest; then
                sed \
                        -e 's|/usr/local/sbin:||g' \
                        -e 's|:/usr/sbin:|:|g' \
@@ -228,6 +225,20 @@ src_prepare() {
                        -i etc/env.d/50baselayout || die
        fi
 
+       if use prefix; then
+               hprefixify -e "/EUID/s,0,${EUID}," -q '"' etc/profile
+               hprefixify etc/shells share.Linux/passwd
+               hprefixify -w '/PATH=/' etc/env.d/50baselayout
+               hprefixify -w 1 etc/env.d/50baselayout
+               echo PATH=/usr/sbin:/sbin:/usr/bin:/bin >> etc/env.d/99host
+
+               # change branding
+               sed -i \
+                       -e '/gentoo-release/s/Gentoo Base/Gentoo Prefix Base/' \
+                       -e '/make_os_release/s/${OS}/Prefix/' \
+                       Makefile || die
+       fi
+
        # handle multilib paths.  do it here because we want this behavior
        # regardless of the C library that you're using.  we do explicitly
        # list paths which the native ldconfig searches, but this isn't
@@ -236,7 +247,9 @@ src_prepare() {
        # path and the symlinked path doesn't change the resulting cache.
        local libdir ldpaths
        for libdir in $(get_all_libdirs) ; do
-               use split-usr && ldpaths+=":${EPREFIX}/${libdir}"
+               if use split-usr || use prefix-guest; then
+                       ldpaths+=":${EPREFIX}/${libdir}"
+               fi
                ldpaths+=":${EPREFIX}/usr/${libdir}"
                ldpaths+=":${EPREFIX}/usr/local/${libdir}"
        done
@@ -249,6 +262,12 @@ src_install() {
                DESTDIR="${ED}" \
                install
 
+       if [[ ${CHOST} == *-darwin* ]] ; then
+               # add SDK path which contains development manpages
+               echo "MANPATH=${EPREFIX}/MacOSX.sdk/usr/share/man" \
+                       > "${ED}"/etc/env.d/98macos-sdk
+       fi
+
        # need the makefile in pkg_preinst
        insinto /usr/share/${PN}
        doins Makefile

Reply via email to