mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-01-18 19:03:28 +00:00
fluxus: fix NIX_* environment propagations to scons
scons build system does not work by default in nixpkgs envoironment as it filters system environment and throws away NIX_* flags: https://scons.org/doc/2.1.0/HTML/scons-user/x1750.html Fix build system to always propagate os.environment.
This commit is contained in:
parent
b460ba1998
commit
c1aadcb9ac
@ -22,26 +22,6 @@
|
|||||||
, zlib
|
, zlib
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
libs = [
|
|
||||||
alsa-lib
|
|
||||||
bzip2
|
|
||||||
fftw
|
|
||||||
freeglut
|
|
||||||
freetype
|
|
||||||
glew
|
|
||||||
libjack2
|
|
||||||
libGL
|
|
||||||
libGLU
|
|
||||||
libjpeg
|
|
||||||
liblo
|
|
||||||
libpng
|
|
||||||
libsndfile
|
|
||||||
libtiff
|
|
||||||
ode
|
|
||||||
openal
|
|
||||||
openssl
|
|
||||||
zlib
|
|
||||||
];
|
|
||||||
racket = racket_7_9;
|
racket = racket_7_9;
|
||||||
in
|
in
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
@ -77,7 +57,6 @@ stdenv.mkDerivation rec {
|
|||||||
"RacketPrefix=${racket}"
|
"RacketPrefix=${racket}"
|
||||||
"RacketInclude=${racket}/include/racket"
|
"RacketInclude=${racket}/include/racket"
|
||||||
"RacketLib=${racket}/lib/racket"
|
"RacketLib=${racket}/lib/racket"
|
||||||
"LIBPATH=${lib.makeLibraryPath libs}"
|
|
||||||
"DESTDIR=build"
|
"DESTDIR=build"
|
||||||
];
|
];
|
||||||
configurePhase = ''
|
configurePhase = ''
|
||||||
|
@ -1,5 +1,10 @@
|
|||||||
diff --git a/SConstruct b/SConstruct
|
scons does not use os environment by default:
|
||||||
index 32cb644..650333a 100644
|
https://scons.org/doc/2.1.0/HTML/scons-user/x1750.html
|
||||||
|
|
||||||
|
nixpkgs' cc-wrapper on the other hand relies on various NIX_* variables
|
||||||
|
to be passed through like NIX_CFLAGS_COMPILE_BEFORE.
|
||||||
|
|
||||||
|
While at it ported to python3-style print().
|
||||||
--- a/SConstruct
|
--- a/SConstruct
|
||||||
+++ b/SConstruct
|
+++ b/SConstruct
|
||||||
@@ -6,7 +6,7 @@
|
@@ -6,7 +6,7 @@
|
||||||
@ -11,16 +16,15 @@ index 32cb644..650333a 100644
|
|||||||
|
|
||||||
MajorVersion = "0"
|
MajorVersion = "0"
|
||||||
MinorVersion = "19"
|
MinorVersion = "19"
|
||||||
@@ -225,13 +225,18 @@ if env['PLATFORM'] == 'posix':
|
@@ -100,6 +100,7 @@ IncludePaths = [
|
||||||
["asound", "alsa/asoundlib.h"],
|
paranoid = ' -W -Wcast-qual -Wwrite-strings -Wcast-align -Wpointer-arith -Wconversion -Wredundant-decls -Wunreachable-code -Winline -Wlarger-than-256'
|
||||||
["openal", "AL/al.h"]]
|
|
||||||
|
|
||||||
+env.Append(ENV={'PATH': ' ' + os.environ['PATH'], })
|
env = Environment(CCFLAGS = '-ggdb -pipe -Wall -O3 -ffast-math -Wno-unused -fPIC -pthread',
|
||||||
+env.Append(LIBPATH=ARGUMENTS.get('LIBPATH', '').split(':'))
|
+ ENV = os.environ,
|
||||||
+env.Append(CCFLAGS=' ' + os.environ.get('NIX_CFLAGS_COMPILE',''))
|
VERSION_NUM = FluxusVersion)
|
||||||
+env.Append(CCFLAGS=' -DNULL=0')
|
env.MergeFlags(ARGUMENTS.get('CCFLAGS', '').split())
|
||||||
+
|
env.MergeFlags(ARGUMENTS.get('LDFLAGS', '').split())
|
||||||
################################################################################
|
@@ -229,9 +230,9 @@ if env['PLATFORM'] == 'posix':
|
||||||
# Make sure we have these libraries availible
|
# Make sure we have these libraries availible
|
||||||
|
|
||||||
if not GetOption('clean'):
|
if not GetOption('clean'):
|
||||||
@ -33,7 +37,7 @@ index 32cb644..650333a 100644
|
|||||||
# detect ode precision
|
# detect ode precision
|
||||||
if not GetOption('clean'):
|
if not GetOption('clean'):
|
||||||
try:
|
try:
|
||||||
@@ -240,27 +245,27 @@ if not GetOption('clean'):
|
@@ -240,27 +241,27 @@ if not GetOption('clean'):
|
||||||
if isinstance(ode_str[0], str):
|
if isinstance(ode_str[0], str):
|
||||||
env.MergeFlags(ode_str[0])
|
env.MergeFlags(ode_str[0])
|
||||||
except:
|
except:
|
||||||
@ -65,7 +69,7 @@ index 32cb644..650333a 100644
|
|||||||
Exit(1)
|
Exit(1)
|
||||||
|
|
||||||
if not conf.CheckFunc("dInitODE2"):
|
if not conf.CheckFunc("dInitODE2"):
|
||||||
@@ -334,7 +339,7 @@ if not GetOption('clean'):
|
@@ -334,7 +335,7 @@ if not GetOption('clean'):
|
||||||
])
|
])
|
||||||
|
|
||||||
if raco_status != 0:
|
if raco_status != 0:
|
||||||
@ -74,7 +78,7 @@ index 32cb644..650333a 100644
|
|||||||
Exit(1)
|
Exit(1)
|
||||||
|
|
||||||
|
|
||||||
@@ -377,8 +382,8 @@ if not GetOption('clean') and static_modules:
|
@@ -377,8 +378,8 @@ if not GetOption('clean') and static_modules:
|
||||||
|
|
||||||
app_env['LIBS'].remove("pthread")
|
app_env['LIBS'].remove("pthread")
|
||||||
app_env['LIBS'].remove("dl")
|
app_env['LIBS'].remove("dl")
|
||||||
@ -85,7 +89,7 @@ index 32cb644..650333a 100644
|
|||||||
|
|
||||||
# now go through the rest of the libs, removing them from
|
# now go through the rest of the libs, removing them from
|
||||||
# the environment at the same time
|
# the environment at the same time
|
||||||
@@ -425,7 +430,7 @@ SConscript(dirs = build_dirs,
|
@@ -425,7 +426,7 @@ SConscript(dirs = build_dirs,
|
||||||
if not GetOption('clean'):
|
if not GetOption('clean'):
|
||||||
helpmap_status = subprocess.call(["racket", "makehelpmap.scm"], cwd="docs/helpmap")
|
helpmap_status = subprocess.call(["racket", "makehelpmap.scm"], cwd="docs/helpmap")
|
||||||
if helpmap_status != 0:
|
if helpmap_status != 0:
|
||||||
|
Loading…
Reference in New Issue
Block a user