commit:     b18dd9cc1373f55bfcfcb0d323c4ca56a02b1db9
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sat Jun 20 16:24:09 2020 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sat Jun 20 16:32:55 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b18dd9cc

sys-libs/libcxx: Apply patches in WORKDIR in 10.0.1+

Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 sys-libs/libcxx/libcxx-10.0.1.9999.ebuild | 17 +++++++++++------
 sys-libs/libcxx/libcxx-10.0.1_rc1.ebuild  | 17 +++++++++++------
 sys-libs/libcxx/libcxx-11.0.0.9999.ebuild | 17 +++++++++++------
 3 files changed, 33 insertions(+), 18 deletions(-)

diff --git a/sys-libs/libcxx/libcxx-10.0.1.9999.ebuild 
b/sys-libs/libcxx/libcxx-10.0.1.9999.ebuild
index 6e1bba971a9..8e1fa4f0419 100644
--- a/sys-libs/libcxx/libcxx-10.0.1.9999.ebuild
+++ b/sys-libs/libcxx/libcxx-10.0.1.9999.ebuild
@@ -33,12 +33,6 @@ BDEPEND="
 
 DOCS=( CREDITS.TXT )
 
-PATCHES=(
-       # Add link flag "-Wl,-z,defs" to avoid underlinking; this is needed in a
-       # out-of-tree build.
-       "${FILESDIR}/${PN}-3.9-cmake-link-flags.patch"
-)
-
 # least intrusive of all
 CMAKE_BUILD_TYPE=RelWithDebInfo
 
@@ -58,6 +52,17 @@ pkg_setup() {
        fi
 }
 
+src_prepare() {
+       # Add link flag "-Wl,-z,defs" to avoid underlinking; this is needed in a
+       # out-of-tree build.
+       eapply "${FILESDIR}/${PN}-3.9-cmake-link-flags.patch"
+
+       # cmake eclasses suck by forcing ${S} here
+       CMAKE_USE_DIR=${S} \
+       S=${WORKDIR} \
+       cmake-utils_src_prepare
+}
+
 test_compiler() {
        $(tc-getCXX) ${CXXFLAGS} ${LDFLAGS} "${@}" -o /dev/null -x c++ - \
                <<<'int main() { return 0; }' &>/dev/null

diff --git a/sys-libs/libcxx/libcxx-10.0.1_rc1.ebuild 
b/sys-libs/libcxx/libcxx-10.0.1_rc1.ebuild
index 6e1bba971a9..8e1fa4f0419 100644
--- a/sys-libs/libcxx/libcxx-10.0.1_rc1.ebuild
+++ b/sys-libs/libcxx/libcxx-10.0.1_rc1.ebuild
@@ -33,12 +33,6 @@ BDEPEND="
 
 DOCS=( CREDITS.TXT )
 
-PATCHES=(
-       # Add link flag "-Wl,-z,defs" to avoid underlinking; this is needed in a
-       # out-of-tree build.
-       "${FILESDIR}/${PN}-3.9-cmake-link-flags.patch"
-)
-
 # least intrusive of all
 CMAKE_BUILD_TYPE=RelWithDebInfo
 
@@ -58,6 +52,17 @@ pkg_setup() {
        fi
 }
 
+src_prepare() {
+       # Add link flag "-Wl,-z,defs" to avoid underlinking; this is needed in a
+       # out-of-tree build.
+       eapply "${FILESDIR}/${PN}-3.9-cmake-link-flags.patch"
+
+       # cmake eclasses suck by forcing ${S} here
+       CMAKE_USE_DIR=${S} \
+       S=${WORKDIR} \
+       cmake-utils_src_prepare
+}
+
 test_compiler() {
        $(tc-getCXX) ${CXXFLAGS} ${LDFLAGS} "${@}" -o /dev/null -x c++ - \
                <<<'int main() { return 0; }' &>/dev/null

diff --git a/sys-libs/libcxx/libcxx-11.0.0.9999.ebuild 
b/sys-libs/libcxx/libcxx-11.0.0.9999.ebuild
index c8f3b48d30c..a06bb57dd7b 100644
--- a/sys-libs/libcxx/libcxx-11.0.0.9999.ebuild
+++ b/sys-libs/libcxx/libcxx-11.0.0.9999.ebuild
@@ -34,12 +34,6 @@ BDEPEND="
 
 DOCS=( CREDITS.TXT )
 
-PATCHES=(
-       # Add link flag "-Wl,-z,defs" to avoid underlinking; this is needed in a
-       # out-of-tree build.
-       "${FILESDIR}/${PN}-3.9-cmake-link-flags.patch"
-)
-
 # least intrusive of all
 CMAKE_BUILD_TYPE=RelWithDebInfo
 
@@ -59,6 +53,17 @@ pkg_setup() {
        fi
 }
 
+src_prepare() {
+       # Add link flag "-Wl,-z,defs" to avoid underlinking; this is needed in a
+       # out-of-tree build.
+       eapply "${FILESDIR}/${PN}-3.9-cmake-link-flags.patch"
+
+       # cmake eclasses suck by forcing ${S} here
+       CMAKE_USE_DIR=${S} \
+       S=${WORKDIR} \
+       cmake-utils_src_prepare
+}
+
 test_compiler() {
        $(tc-getCXX) ${CXXFLAGS} ${LDFLAGS} "${@}" -o /dev/null -x c++ - \
                <<<'int main() { return 0; }' &>/dev/null

Reply via email to