dev-util/ninja: fixup CFLAGS handling
authorMike Gilbert <floppym@gentoo.org>
Thu, 19 Mar 2020 15:27:40 +0000 (11:27 -0400)
committerMike Gilbert <floppym@gentoo.org>
Thu, 19 Mar 2020 15:27:40 +0000 (11:27 -0400)
Package-Manager: Portage-2.3.92_p3, Repoman-2.3.20_p118
Signed-off-by: Mike Gilbert <floppym@gentoo.org>
dev-util/ninja/files/ninja-cflags.patch [new file with mode: 0644]
dev-util/ninja/ninja-1.10.0.ebuild
dev-util/ninja/ninja-1.9.0.ebuild
dev-util/ninja/ninja-9999.ebuild

diff --git a/dev-util/ninja/files/ninja-cflags.patch b/dev-util/ninja/files/ninja-cflags.patch
new file mode 100644 (file)
index 0000000..0c4ef28
--- /dev/null
@@ -0,0 +1,25 @@
+From e4530769ef6a497f8f5f06159f6be049dc20e2ea Mon Sep 17 00:00:00 2001
+From: Mike Gilbert <floppym@gentoo.org>
+Date: Thu, 19 Mar 2020 11:21:29 -0400
+Subject: [PATCH] Avoid adding -O2 -DNDEBUG to cflags
+
+---
+ configure.py | 2 --
+ 1 file changed, 2 deletions(-)
+
+diff --git a/configure.py b/configure.py
+index 7d8ce90..7566147 100755
+--- a/configure.py
++++ b/configure.py
+@@ -344,8 +344,6 @@ else:
+     if options.debug:
+         cflags += ['-D_GLIBCXX_DEBUG', '-D_GLIBCXX_DEBUG_PEDANTIC']
+         cflags.remove('-fno-rtti')  # Needed for above pedanticness.
+-    else:
+-        cflags += ['-O2', '-DNDEBUG']
+     try:
+         proc = subprocess.Popen(
+             [CXX, '-fdiagnostics-color', '-c', '-x', 'c++', '/dev/null',
+-- 
+2.25.1
+
index 5275d6300262e7c260aa5dd88f110c6c95f1c2ef..5e63fdd14f414b346122012b10dcef331f3b144c 100644 (file)
@@ -44,6 +44,10 @@ RDEPEND="
        )
 "
 
+PATCHES=(
+       "${FILESDIR}"/ninja-cflags.patch
+)
+
 run_for_build() {
        if tc-is-cross-compiler; then
                local -x AR=$(tc-getBUILD_AR)
@@ -59,8 +63,8 @@ run_for_build() {
 src_compile() {
        tc-export AR CXX
 
-       # configure.py uses CFLAGS instead of CXXFLAGS
-       export CFLAGS=${CXXFLAGS}
+       # configure.py appends CFLAGS to CXXFLAGS
+       unset CFLAGS
 
        run_for_build ${EPYTHON} configure.py --bootstrap --verbose || die
 
index 9bf6dd5f8f971eeeb9f290029d185b0bdb51a537..36783d7d7b62b886f166eed6cbf262a36dc34ec6 100644 (file)
@@ -51,6 +51,10 @@ PATCHES=(
        "${FILESDIR}/ninja-1.9.0-musl.patch"
 )
 
+PATCHES=(
+       "${FILESDIR}"/ninja-cflags.patch
+)
+
 run_for_build() {
        if tc-is-cross-compiler; then
                local -x AR=$(tc-getBUILD_AR)
@@ -66,8 +70,8 @@ run_for_build() {
 src_compile() {
        tc-export AR CXX
 
-       # configure.py uses CFLAGS instead of CXXFLAGS
-       export CFLAGS=${CXXFLAGS}
+       # configure.py appends CFLAGS to CXXFLAGS
+       unset CFLAGS
 
        run_for_build ${EPYTHON} configure.py --bootstrap --verbose || die
 
index bf75daf0bbb4824f1eebc08f0eb829ee8e3b5fac..5d9e2fbb5af07ae2f2f758344fe4c433b3909704 100644 (file)
@@ -44,6 +44,10 @@ RDEPEND="
        )
 "
 
+PATCHES=(
+       "${FILESDIR}"/ninja-cflags.patch
+)
+
 run_for_build() {
        if tc-is-cross-compiler; then
                local -x AR=$(tc-getBUILD_AR)
@@ -59,8 +63,8 @@ run_for_build() {
 src_compile() {
        tc-export AR CXX
 
-       # configure.py uses CFLAGS instead of CXXFLAGS
-       export CFLAGS=${CXXFLAGS}
+       # configure.py appends CFLAGS to CXXFLAGS
+       unset CFLAGS
 
        run_for_build ${EPYTHON} configure.py --bootstrap --verbose || die