public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Michał Górny" <mgorny@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-util/scons/files/, dev-util/scons/
Date: Sun,  1 Aug 2021 17:41:20 +0000 (UTC)	[thread overview]
Message-ID: <1627839676.2705c315b275862ed6f1c6a1976e6a42178ce957.mgorny@gentoo> (raw)

commit:     2705c315b275862ed6f1c6a1976e6a42178ce957
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sun Aug  1 17:38:20 2021 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sun Aug  1 17:41:16 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2705c315

dev-util/scons: Fix Gentoo patch

Closes: https://bugs.gentoo.org/806043
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 .../scons/files/scons-4.2.0-respect-cc-etc.patch   | 96 ++++++++++++++++++++++
 .../{scons-4.2.0.ebuild => scons-4.2.0-r1.ebuild}  |  2 +-
 2 files changed, 97 insertions(+), 1 deletion(-)

diff --git a/dev-util/scons/files/scons-4.2.0-respect-cc-etc.patch b/dev-util/scons/files/scons-4.2.0-respect-cc-etc.patch
new file mode 100644
index 00000000000..a075fec91d2
--- /dev/null
+++ b/dev-util/scons/files/scons-4.2.0-respect-cc-etc.patch
@@ -0,0 +1,96 @@
+From b6ba1f2b1feda529eca20fb8980f7c6c52397df6 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
+Date: Thu, 10 May 2018 08:01:08 +0200
+Subject: [PATCH] posix: Also force common toolchain vars for Gentoo
+
+---
+ SCons/Platform/posix.py | 21 +++++++++++++++++++++
+ SCons/Tool/cc.py        |  3 ++-
+ SCons/Tool/cxx.py       |  3 ++-
+ SCons/Tool/link.py      |  3 ++-
+ 4 files changed, 27 insertions(+), 3 deletions(-)
+
+diff --git a/src/SCons/Platform/posix.py b/src/SCons/Platform/posix.py
+index 37cd2377f..1246781de 100644
+--- a/src/SCons/Platform/posix.py
++++ b/src/SCons/Platform/posix.py
+@@ -33,6 +33,7 @@ import subprocess
+ from SCons.Platform import TempFileMunge
+ from SCons.Platform.virtualenv import ImportVirtualenv
+ from SCons.Platform.virtualenv import ignore_virtualenv, enable_virtualenv
++import SCons.Util
+ 
+ exitvalmap = {
+     2 : 127,
+@@ -86,6 +87,26 @@ def generate(env):
+         if 'ENV' in env:
+             new_env.update(env['ENV'])
+         env['ENV'] = new_env
++
++        # Furthermore, force common compiler/linker variables as well
++        envvar_mapping = {
++            'AR': 'AR',
++            'AS': 'AS',
++            'ASFLAGS': 'ASFLAGS',
++            'CC': 'CC',
++            'CXX': 'CXX',
++            'CFLAGS': 'CFLAGS',
++            'CXXFLAGS': 'CXXFLAGS',
++            'CPPFLAGS': 'CPPFLAGS',
++            'LDFLAGS': 'LINKFLAGS',
++        }
++
++        for envvar, toolvar in envvar_mapping.items():
++            if toolvar not in env and envvar in env['ENV']:
++                val = env['ENV'][envvar]
++                if toolvar.endswith('FLAGS'):
++                    val = SCons.Util.CLVar(val)
++                env[toolvar] = val
+     else:
+         if 'ENV' not in env:
+             env['ENV']        = {}
+diff --git a/src/SCons/Tool/cc.py b/src/SCons/Tool/cc.py
+index 590ec5fd3..5f9229a02 100644
+--- a/src/SCons/Tool/cc.py
++++ b/src/SCons/Tool/cc.py
+@@ -80,7 +80,8 @@ def generate(env):
+ 
+     if 'CC' not in env:
+         env['CC']    = env.Detect(compilers) or compilers[0]
+-    env['CFLAGS']    = SCons.Util.CLVar('')
++    if 'CFLAGS' not in env:
++        env['CFLAGS'] = SCons.Util.CLVar('')
+     env['CCCOM']     = '$CC -o $TARGET -c $CFLAGS $CCFLAGS $_CCCOMCOM $SOURCES'
+     env['SHCC']      = '$CC'
+     env['SHCFLAGS'] = SCons.Util.CLVar('$CFLAGS')
+diff --git a/src/SCons/Tool/cxx.py b/src/SCons/Tool/cxx.py
+index 128cdc4f6..1f852b64c 100644
+--- a/src/SCons/Tool/cxx.py
++++ b/src/SCons/Tool/cxx.py
+@@ -69,7 +69,8 @@ def generate(env):
+ 
+     if 'CXX' not in env:
+         env['CXX']    = env.Detect(compilers) or compilers[0]
+-    env['CXXFLAGS']   = SCons.Util.CLVar('')
++    if 'CXXFLAGS' not in env:
++        env['CXXFLAGS'] = SCons.Util.CLVar('')
+     env['CXXCOM']     = '$CXX -o $TARGET -c $CXXFLAGS $CCFLAGS $_CCCOMCOM $SOURCES'
+     env['SHCXX']      = '$CXX'
+     env['SHCXXFLAGS'] = SCons.Util.CLVar('$CXXFLAGS')
+diff --git a/src/SCons/Tool/link.py b/src/SCons/Tool/link.py
+index 24d17a31f..4ea9917e8 100644
+--- a/src/SCons/Tool/link.py
++++ b/src/SCons/Tool/link.py
+@@ -49,7 +49,8 @@ def generate(env):
+ 
+     env['SMARTLINK'] = smart_link
+     env['LINK'] = "$SMARTLINK"
+-    env['LINKFLAGS'] = SCons.Util.CLVar('')
++    if 'LINKFLAGS' not in env:
++        env['LINKFLAGS'] = SCons.Util.CLVar('')
+ 
+     # __RPATH is only set to something ($_RPATH typically) on platforms that support it.
+     env['LINKCOM'] = '$LINK -o $TARGET $LINKFLAGS $__RPATH $SOURCES $_LIBDIRFLAGS $_LIBFLAGS'
+-- 
+2.32.0
+

diff --git a/dev-util/scons/scons-4.2.0.ebuild b/dev-util/scons/scons-4.2.0-r1.ebuild
similarity index 98%
rename from dev-util/scons/scons-4.2.0.ebuild
rename to dev-util/scons/scons-4.2.0-r1.ebuild
index ab10b165363..9c816bfcc0b 100644
--- a/dev-util/scons/scons-4.2.0.ebuild
+++ b/dev-util/scons/scons-4.2.0-r1.ebuild
@@ -38,7 +38,7 @@ PATCHES=(
 	# support env passthrough for Gentoo ebuilds
 	"${FILESDIR}"/scons-4.1.0-env-passthrough.patch
 	# respect CC, CXX, C*FLAGS, LDFLAGS by default
-	"${FILESDIR}"/scons-4.0.0-respect-cc-etc-r1.patch
+	"${FILESDIR}"/scons-4.2.0-respect-cc-etc.patch
 )
 
 src_unpack() {


             reply	other threads:[~2021-08-01 17:41 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-01 17:41 Michał Górny [this message]
  -- strict thread matches above, loose matches on Subject: below --
2021-10-14  9:13 [gentoo-commits] repo/gentoo:master commit in: dev-util/scons/files/, dev-util/scons/ Sam James
2021-10-13  9:05 Michał Górny
2021-03-28 11:59 Michał Górny
2021-01-21 10:20 Michał Górny
2019-03-13  8:22 Michał Górny
2015-11-11 10:37 Lars Wendler

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1627839676.2705c315b275862ed6f1c6a1976e6a42178ce957.mgorny@gentoo \
    --to=mgorny@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox