commit:     a4b70b6b132e2c1f16abe441effa7da73382a94a
Author:     Jacob Floyd <cognifloyd <AT> gmail <DOT> com>
AuthorDate: Sun Dec 20 21:24:14 2020 +0000
Commit:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Sun Dec 27 09:49:31 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a4b70b6b

sys-libs/libcxxabi: fix prefix bootstrap

When bootstrapping prefix on darwin, libcxxabi must be installed before
llvm is built during stage2 (in EPREFIX/tmp) and during stage3 (in
EPREFIX). llvm_pkg_setup, however, identifies the *installed* llvm to
set environment variables with the correct path to llvm. Since llvm is
not installed, we have to skip that step. But during bootstrap, we don't
need those environment vars to be modified anyway because
bootstrap-prefix.sh already sets them with the paths to the correct llvm
(which is the host's llm during stage2 and the EPREFIX/tmp llvm during
stage3).

Once stage3 is complete, llvm is installed in EPREFIX, so the system
rebuild (with `emerge -e system`) will successfully use llvm_pkg_setup.
bootstrap-prefix.sh is no longer controlling the vars at that point, so
it is important to allow llvm_pkg_setup to correctly modify the vars.

This also keywords the ebuild with ~x64-macos.

Bug: https://bugs.gentoo.org/758167
Signed-off-by: Jacob Floyd <cognifloyd <AT> gmail.com>
Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org>

 sys-libs/libcxxabi/libcxxabi-11.0.0.ebuild      | 8 ++++++--
 sys-libs/libcxxabi/libcxxabi-11.0.1.9999.ebuild | 6 +++++-
 sys-libs/libcxxabi/libcxxabi-11.0.1_rc1.ebuild  | 6 +++++-
 sys-libs/libcxxabi/libcxxabi-11.0.1_rc2.ebuild  | 6 +++++-
 sys-libs/libcxxabi/libcxxabi-12.0.0.9999.ebuild | 6 +++++-
 5 files changed, 26 insertions(+), 6 deletions(-)

diff --git a/sys-libs/libcxxabi/libcxxabi-11.0.0.ebuild 
b/sys-libs/libcxxabi/libcxxabi-11.0.0.ebuild
index 8b660d054c7..927f9e62f51 100644
--- a/sys-libs/libcxxabi/libcxxabi-11.0.0.ebuild
+++ b/sys-libs/libcxxabi/libcxxabi-11.0.0.ebuild
@@ -16,7 +16,7 @@ llvm.org_set_globals
 
 LICENSE="Apache-2.0-with-LLVM-exceptions || ( UoI-NCSA MIT )"
 SLOT="0"
-KEYWORDS="amd64 arm arm64 ~riscv x86"
+KEYWORDS="amd64 arm arm64 ~riscv x86 ~x64-macos"
 IUSE="+libunwind +static-libs test elibc_musl"
 RESTRICT="!test? ( test )"
 
@@ -39,7 +39,11 @@ python_check_deps() {
 }
 
 pkg_setup() {
-       llvm_pkg_setup
+       # darwin prefix builds do not have llvm installed yet, so rely on 
bootstrap-prefix
+       # to set the appropriate path vars to LLVM instead of using 
llvm_pkg_setup.
+       if [[ ${CHOST} != *-darwin* ]] || has_version dev-lang/llvm; then
+               llvm_pkg_setup
+       fi
        use test && python-any-r1_pkg_setup
 }
 

diff --git a/sys-libs/libcxxabi/libcxxabi-11.0.1.9999.ebuild 
b/sys-libs/libcxxabi/libcxxabi-11.0.1.9999.ebuild
index c1992223348..954ae031580 100644
--- a/sys-libs/libcxxabi/libcxxabi-11.0.1.9999.ebuild
+++ b/sys-libs/libcxxabi/libcxxabi-11.0.1.9999.ebuild
@@ -41,7 +41,11 @@ python_check_deps() {
 }
 
 pkg_setup() {
-       llvm_pkg_setup
+       # darwin prefix builds do not have llvm installed yet, so rely on 
bootstrap-prefix
+       # to set the appropriate path vars to LLVM instead of using 
llvm_pkg_setup.
+       if [[ ${CHOST} != *-darwin* ]] || has_version dev-lang/llvm; then
+               llvm_pkg_setup
+       fi
        use test && python-any-r1_pkg_setup
 }
 

diff --git a/sys-libs/libcxxabi/libcxxabi-11.0.1_rc1.ebuild 
b/sys-libs/libcxxabi/libcxxabi-11.0.1_rc1.ebuild
index c1992223348..954ae031580 100644
--- a/sys-libs/libcxxabi/libcxxabi-11.0.1_rc1.ebuild
+++ b/sys-libs/libcxxabi/libcxxabi-11.0.1_rc1.ebuild
@@ -41,7 +41,11 @@ python_check_deps() {
 }
 
 pkg_setup() {
-       llvm_pkg_setup
+       # darwin prefix builds do not have llvm installed yet, so rely on 
bootstrap-prefix
+       # to set the appropriate path vars to LLVM instead of using 
llvm_pkg_setup.
+       if [[ ${CHOST} != *-darwin* ]] || has_version dev-lang/llvm; then
+               llvm_pkg_setup
+       fi
        use test && python-any-r1_pkg_setup
 }
 

diff --git a/sys-libs/libcxxabi/libcxxabi-11.0.1_rc2.ebuild 
b/sys-libs/libcxxabi/libcxxabi-11.0.1_rc2.ebuild
index c1992223348..954ae031580 100644
--- a/sys-libs/libcxxabi/libcxxabi-11.0.1_rc2.ebuild
+++ b/sys-libs/libcxxabi/libcxxabi-11.0.1_rc2.ebuild
@@ -41,7 +41,11 @@ python_check_deps() {
 }
 
 pkg_setup() {
-       llvm_pkg_setup
+       # darwin prefix builds do not have llvm installed yet, so rely on 
bootstrap-prefix
+       # to set the appropriate path vars to LLVM instead of using 
llvm_pkg_setup.
+       if [[ ${CHOST} != *-darwin* ]] || has_version dev-lang/llvm; then
+               llvm_pkg_setup
+       fi
        use test && python-any-r1_pkg_setup
 }
 

diff --git a/sys-libs/libcxxabi/libcxxabi-12.0.0.9999.ebuild 
b/sys-libs/libcxxabi/libcxxabi-12.0.0.9999.ebuild
index c1992223348..954ae031580 100644
--- a/sys-libs/libcxxabi/libcxxabi-12.0.0.9999.ebuild
+++ b/sys-libs/libcxxabi/libcxxabi-12.0.0.9999.ebuild
@@ -41,7 +41,11 @@ python_check_deps() {
 }
 
 pkg_setup() {
-       llvm_pkg_setup
+       # darwin prefix builds do not have llvm installed yet, so rely on 
bootstrap-prefix
+       # to set the appropriate path vars to LLVM instead of using 
llvm_pkg_setup.
+       if [[ ${CHOST} != *-darwin* ]] || has_version dev-lang/llvm; then
+               llvm_pkg_setup
+       fi
        use test && python-any-r1_pkg_setup
 }
 

Reply via email to