summaryrefslogtreecommitdiff
path: root/dev-util/scons/files
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2018-07-14 21:03:06 +0100
committerV3n3RiX <venerix@redcorelinux.org>2018-07-14 21:03:06 +0100
commit8376ef56580626e9c0f796d5b85b53a0a1c7d5f5 (patch)
tree7681bbd4e8b05407772df40a4bf04cbbc8afc3fa /dev-util/scons/files
parent30a9caf154332f12ca60756e1b75d2f0e3e1822d (diff)
gentoo resync : 14.07.2018
Diffstat (limited to 'dev-util/scons/files')
-rw-r--r--dev-util/scons/files/scons-2.5.1-respect-path.patch34
-rw-r--r--dev-util/scons/files/scons-3.0.1-env-passthrough.patch40
-rw-r--r--dev-util/scons/files/scons-3.0.1-respect-cc-etc-r1.patch88
3 files changed, 162 insertions, 0 deletions
diff --git a/dev-util/scons/files/scons-2.5.1-respect-path.patch b/dev-util/scons/files/scons-2.5.1-respect-path.patch
new file mode 100644
index 000000000000..d5da07bc980b
--- /dev/null
+++ b/dev-util/scons/files/scons-2.5.1-respect-path.patch
@@ -0,0 +1,34 @@
+Clang/LLVM is installed in an "odd" location (/usr/lib/llvm/<ver>/bin/)
+which is added to PATH. Since we cannot know <ver> upfront, it's wrong
+to hardcode the PATH at the time of installation else we'd break after a
+Clang update. Since Clang is the primary compiler on Darwin, just
+extract the relevant path on each invocation.
+
+--- a/engine/SCons/Platform/posix.py
++++ b/engine/SCons/Platform/posix.py
+@@ -87,9 +87,15 @@
+ pspawn = piped_env_spawn
+ # Note that this means that 'escape' is no longer used
+
++ with open('@GENTOO_PORTAGE_EPREFIX@/etc/profile.env', 'r') as f:
++ for l in f:
++ if "export PATH=" in l:
++ path = l.split('=')[1].strip("'")
++ break
++
+ if 'ENV' not in env:
+ env['ENV'] = {}
+- env['ENV']['PATH'] = '/usr/local/bin:/opt/bin:/bin:/usr/bin'
++ env['ENV']['PATH'] = path
+ env['OBJPREFIX'] = ''
+ env['OBJSUFFIX'] = '.o'
+ env['SHOBJPREFIX'] = '$OBJPREFIX'
+@@ -104,7 +110,7 @@
+ env['LIBSUFFIXES'] = [ '$LIBSUFFIX', '$SHLIBSUFFIX' ]
+ env['PSPAWN'] = pspawn
+ env['SPAWN'] = spawn
+- env['SHELL'] = 'sh'
++ env['SHELL'] = '@GENTOO_PORTAGE_EPREFIX@/bin/sh'
+ env['ESCAPE'] = escape
+ env['TEMPFILE'] = TempFileMunge
+ env['TEMPFILEPREFIX'] = '@'
diff --git a/dev-util/scons/files/scons-3.0.1-env-passthrough.patch b/dev-util/scons/files/scons-3.0.1-env-passthrough.patch
new file mode 100644
index 000000000000..16de316766b1
--- /dev/null
+++ b/dev-util/scons/files/scons-3.0.1-env-passthrough.patch
@@ -0,0 +1,40 @@
+From f2f8536be12f1d095382e7598060c1eb51eb5337 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.
+---
+ src/engine/SCons/Platform/posix.py | 14 +++++++++++---
+ 1 file changed, 11 insertions(+), 3 deletions(-)
+
+diff --git a/src/engine/SCons/Platform/posix.py b/src/engine/SCons/Platform/posix.py
+index 8db08db1..af34650c 100644
+--- a/src/engine/SCons/Platform/posix.py
++++ b/src/engine/SCons/Platform/posix.py
+@@ -87,9 +87,17 @@ 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'
++ # Force pass-through of environment variables in Gentoo builds
++ 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'
++
+ env['OBJPREFIX'] = ''
+ env['OBJSUFFIX'] = '.o'
+ env['SHOBJPREFIX'] = '$OBJPREFIX'
+--
+2.17.0
+
diff --git a/dev-util/scons/files/scons-3.0.1-respect-cc-etc-r1.patch b/dev-util/scons/files/scons-3.0.1-respect-cc-etc-r1.patch
new file mode 100644
index 000000000000..748646b14f10
--- /dev/null
+++ b/dev-util/scons/files/scons-3.0.1-respect-cc-etc-r1.patch
@@ -0,0 +1,88 @@
+From 68fc19b7fd6b65ab850e4fd8ef5e85c672989f92 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
+
+---
+ src/engine/SCons/Platform/posix.py | 20 ++++++++++++++++++++
+ src/engine/SCons/Tool/cc.py | 3 ++-
+ src/engine/SCons/Tool/cxx.py | 3 ++-
+ src/engine/SCons/Tool/link.py | 3 ++-
+ 4 files changed, 26 insertions(+), 3 deletions(-)
+
+diff --git a/src/engine/SCons/Platform/posix.py b/src/engine/SCons/Platform/posix.py
+index af34650c..5533c87c 100644
+--- a/src/engine/SCons/Platform/posix.py
++++ b/src/engine/SCons/Platform/posix.py
+@@ -93,6 +93,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/engine/SCons/Tool/cc.py b/src/engine/SCons/Tool/cc.py
+index 590ec5fd..5f9229a0 100644
+--- a/src/engine/SCons/Tool/cc.py
++++ b/src/engine/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/engine/SCons/Tool/cxx.py b/src/engine/SCons/Tool/cxx.py
+index 430851c8..ca5ab563 100644
+--- a/src/engine/SCons/Tool/cxx.py
++++ b/src/engine/SCons/Tool/cxx.py
+@@ -74,7 +74,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/engine/SCons/Tool/link.py b/src/engine/SCons/Tool/link.py
+index 07e92507..614d1779 100644
+--- a/src/engine/SCons/Tool/link.py
++++ b/src/engine/SCons/Tool/link.py
+@@ -292,7 +292,8 @@ def generate(env):
+ env.Append(SHLIBEMITTER = [shlib_emitter])
+ 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'
+ env['LIBDIRPREFIX']='-L'
+--
+2.17.0
+