Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

scons: Pass few envvars to the build env to fix mingw-gcc #239

Merged
merged 1 commit into from May 11, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 9 additions & 3 deletions scons/PKGBUILD
Expand Up @@ -2,21 +2,27 @@

pkgname=scons
pkgver=2.3.4
pkgrel=2
pkgrel=3
pkgdesc="Extensible Python-based build utility"
arch=('any')
groups=('base-devel')
url="http://scons.org"
license=('MIT')
depends=('python2')
source=("http://downloads.sourceforge.net/sourceforge/$pkgname/$pkgname-$pkgver.tar.gz"
scons-2.3.4-cyglink-msys2.patch)
scons-2.3.4-cyglink-msys2.patch
scons-2.3.4-msys2-plat-mingw-env.patch)
md5sums=('91fbbb67c2c65b03c746601baac4a6a5'
'8449f7f389bdd54f07d8ab27a8b7b48f')
'8449f7f389bdd54f07d8ab27a8b7b48f'
'4eb3a62a2fff6cac1cccd45a21cbcd8a')

prepare() {
cd "$srcdir/$pkgname-$pkgver"

# avoid errors when re-running makepkg
rm -f engine/SCons/Platform/msys.py engine/SCons/Tool/msyslink.py
patch -p1 -i ${srcdir}/scons-2.3.4-cyglink-msys2.patch
patch -p0 -i ${srcdir}/scons-2.3.4-msys2-plat-mingw-env.patch
}

package() {
Expand Down
24 changes: 24 additions & 0 deletions scons/scons-2.3.4-msys2-plat-mingw-env.patch
@@ -0,0 +1,24 @@
--- engine/SCons/Platform/msys.py.orig 2015-05-06 15:26:45.478712800 +0200
+++ engine/SCons/Platform/msys.py 2015-05-06 15:33:07.915575600 +0200
@@ -38,6 +38,21 @@
def generate(env):
posix.generate(env)

+ # (copied from win32.py, for when msys2 scons is used for building mingw packages)
+ # Import things from the external environment to the construction
+ # environment's ENV. This is a potential slippery slope, because we
+ # *don't* want to make builds dependent on the user's environment by
+ # default. We're doing this for SystemRoot, though, because it's
+ # needed for anything that uses sockets, and seldom changes, and
+ # for SystemDrive because it's related.
+ #
+ # Weigh the impact carefully before adding other variables to this list.
+ import_env = [ 'SystemDrive', 'SystemRoot', 'TEMP', 'TMP' ]
+ for var in import_env:
+ v = os.environ.get(var)
+ if v:
+ env['ENV'][var] = v
+
env['ENV']['PATH'] = os.getenv('PATH')
env['SPAWN'] = (lambda sh, esc, cmd, args, env_param:
subprocess.call(['sh', '-c', ' '.join(args)]))