commit:     5d2345021f8f49961a32aafd42bee5cc18cddfb8
Author:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Thu Dec 31 17:24:14 2020 +0000
Commit:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Thu Dec 31 17:24:14 2020 +0000
URL:        https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=5d234502

scripts/bootstrap-prefix: adjust bootstrap_cmake for post stage1 usage

Like the ebuild, drop -isysroot usage, unfortunately we need to do this
post install, for cmake doesn't compile itself without it, yet libcxx
and friends don't compile with it.

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

 scripts/bootstrap-prefix.sh | 19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)

diff --git a/scripts/bootstrap-prefix.sh b/scripts/bootstrap-prefix.sh
index 5a73a87f8d..4394e131aa 100755
--- a/scripts/bootstrap-prefix.sh
+++ b/scripts/bootstrap-prefix.sh
@@ -1213,13 +1213,30 @@ bootstrap_cmake() {
        S="${S}"/cmake-${PV}
        cd "${S}"
 
-       einfo "Compiling ${A%-*}"
+       # don't set a POSIX standard, system headers don't like that, #757426
+       sed -i -e 's/^#if !defined(_WIN32) && !defined(__sun)/& \&\& 
!defined(__APPLE__)/' \
+               Source/cmLoadCommandCommand.cxx \
+               Source/cmStandardLexer.h \
+               Source/cmSystemTools.cxx \
+               Source/cmTimestamp.cxx
+
+       einfo "Bootstrapping ${A%-*}"
        ./bootstrap --prefix="${ROOT}"/tmp/usr || return 1
+
+       einfo "Compiling ${A%-*}"
        $MAKE ${MAKEOPTS} || return 1
 
        einfo "Installing ${A%-*}"
        $MAKE ${MAKEOPTS} install || return 1
 
+       # we need sysroot crap to build cmake itself, but it makes trouble
+       # lateron, so kill it in the installed version
+       sed -i -e '/cmake_gnu_set_sysroot_flag/d' \
+               
"${EROOT}"/tmp/usr/share/cmake/Modules/Platform/Apple-GNU-*.cmake || die
+       # disable isysroot usage with clang as well
+       sed -i -e '/_SYSROOT_FLAG/d' \
+               
"${EROOT}"/tmp/usr/share/cmake/Modules/Platform/Apple-Clang.cmake || die
+
        einfo "${A%-*} bootstrapped"
 }
 

Reply via email to