summaryrefslogtreecommitdiff
path: root/dev-build/scons/files
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2024-01-17 20:06:58 +0000
committerV3n3RiX <venerix@koprulu.sector>2024-01-17 20:06:58 +0000
commit08c5e4df7a4b66ba8dbb827ca2e3a973d4f19ab0 (patch)
tree347af25df153363454776e1fe95fc4e8100a7e7d /dev-build/scons/files
parentfc6e577018dec28e18904f9ad5c1417976e3c728 (diff)
gentoo auto-resync : 17:01:2024 - 20:06:58
Diffstat (limited to 'dev-build/scons/files')
-rw-r--r--dev-build/scons/files/scons-4.1.0-env-passthrough.patch41
-rw-r--r--dev-build/scons/files/scons-4.2.0-respect-cc-etc.patch96
2 files changed, 137 insertions, 0 deletions
diff --git a/dev-build/scons/files/scons-4.1.0-env-passthrough.patch b/dev-build/scons/files/scons-4.1.0-env-passthrough.patch
new file mode 100644
index 000000000000..06ec2f217611
--- /dev/null
+++ b/dev-build/scons/files/scons-4.1.0-env-passthrough.patch
@@ -0,0 +1,41 @@
+From fb07dc4b4fa178b0c424c5f400b18669abd8960e Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
+Date: Wed, 9 May 2018 17:04:49 +0200
+Subject: [PATCH] posix: Support GENTOO_SCONS_ENV_PASSTHROUGH=1
+
+Support GENTOO_SCONS_ENV_PASSTHROUGH=1 variable to override the default
+of wiping the environment and resetting PATH to default, and instead
+pass all variables through.
+---
+ SCons/Platform/posix.py | 15 ++++++++++++---
+ 1 file changed, 12 insertions(+), 3 deletions(-)
+
+diff --git a/SCons/Platform/posix.py b/SCons/Platform/posix.py
+index 4c9f8f9ba..fbc81196d 100644
+--- a/src/SCons/Platform/posix.py
++++ b/src/SCons/Platform/posix.py
+@@ -82,9 +82,18 @@ def generate(env):
+ pspawn = piped_env_spawn
+ # Note that this means that 'escape' is no longer used
+
+- if 'ENV' not in env:
+- env['ENV'] = {}
+- env['ENV']['PATH'] = '/usr/local/bin:/opt/bin:/bin:/usr/bin:/snap/bin'
++ # Force pass-through of environment variables in Gentoo builds
++ import os
++ if os.environ.get('GENTOO_SCONS_ENV_PASSTHROUGH', False):
++ new_env = os.environ.copy()
++ if 'ENV' in env:
++ new_env.update(env['ENV'])
++ env['ENV'] = new_env
++ else:
++ if 'ENV' not in env:
++ env['ENV'] = {}
++ env['ENV']['PATH'] = '/usr/local/bin:/opt/bin:/bin:/usr/bin:/snap/bin'
++
+ env['OBJPREFIX'] = ''
+ env['OBJSUFFIX'] = '.o'
+ env['SHOBJPREFIX'] = '$OBJPREFIX'
+--
+2.30.0
+
diff --git a/dev-build/scons/files/scons-4.2.0-respect-cc-etc.patch b/dev-build/scons/files/scons-4.2.0-respect-cc-etc.patch
new file mode 100644
index 000000000000..a075fec91d22
--- /dev/null
+++ b/dev-build/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
+