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.

+19 -36
-21
pkgs/applications/graphics/fluxus/default.nix
··· 22 , zlib 23 }: 24 let 25 - libs = [ 26 - alsa-lib 27 - bzip2 28 - fftw 29 - freeglut 30 - freetype 31 - glew 32 - libjack2 33 - libGL 34 - libGLU 35 - libjpeg 36 - liblo 37 - libpng 38 - libsndfile 39 - libtiff 40 - ode 41 - openal 42 - openssl 43 - zlib 44 - ]; 45 racket = racket_7_9; 46 in 47 stdenv.mkDerivation rec { ··· 77 "RacketPrefix=${racket}" 78 "RacketInclude=${racket}/include/racket" 79 "RacketLib=${racket}/lib/racket" 80 - "LIBPATH=${lib.makeLibraryPath libs}" 81 "DESTDIR=build" 82 ]; 83 configurePhase = ''
··· 22 , zlib 23 }: 24 let 25 racket = racket_7_9; 26 in 27 stdenv.mkDerivation rec { ··· 57 "RacketPrefix=${racket}" 58 "RacketInclude=${racket}/include/racket" 59 "RacketLib=${racket}/lib/racket" 60 "DESTDIR=build" 61 ]; 62 configurePhase = ''
+19 -15
pkgs/applications/graphics/fluxus/fix-build.patch
··· 1 - diff --git a/SConstruct b/SConstruct 2 - index 32cb644..650333a 100644 3 --- a/SConstruct 4 +++ b/SConstruct 5 @@ -6,7 +6,7 @@ ··· 11 12 MajorVersion = "0" 13 MinorVersion = "19" 14 - @@ -225,13 +225,18 @@ if env['PLATFORM'] == 'posix': 15 - ["asound", "alsa/asoundlib.h"], 16 - ["openal", "AL/al.h"]] 17 18 - +env.Append(ENV={'PATH': ' ' + os.environ['PATH'], }) 19 - +env.Append(LIBPATH=ARGUMENTS.get('LIBPATH', '').split(':')) 20 - +env.Append(CCFLAGS=' ' + os.environ.get('NIX_CFLAGS_COMPILE','')) 21 - +env.Append(CCFLAGS=' -DNULL=0') 22 - + 23 - ################################################################################ 24 # Make sure we have these libraries availible 25 26 if not GetOption('clean'): ··· 33 # detect ode precision 34 if not GetOption('clean'): 35 try: 36 - @@ -240,27 +245,27 @@ if not GetOption('clean'): 37 if isinstance(ode_str[0], str): 38 env.MergeFlags(ode_str[0]) 39 except: ··· 65 Exit(1) 66 67 if not conf.CheckFunc("dInitODE2"): 68 - @@ -334,7 +339,7 @@ if not GetOption('clean'): 69 ]) 70 71 if raco_status != 0: ··· 74 Exit(1) 75 76 77 - @@ -377,8 +382,8 @@ if not GetOption('clean') and static_modules: 78 79 app_env['LIBS'].remove("pthread") 80 app_env['LIBS'].remove("dl") ··· 85 86 # now go through the rest of the libs, removing them from 87 # the environment at the same time 88 - @@ -425,7 +430,7 @@ SConscript(dirs = build_dirs, 89 if not GetOption('clean'): 90 helpmap_status = subprocess.call(["racket", "makehelpmap.scm"], cwd="docs/helpmap") 91 if helpmap_status != 0:
··· 1 + scons does not use os environment by default: 2 + https://scons.org/doc/2.1.0/HTML/scons-user/x1750.html 3 + 4 + nixpkgs' cc-wrapper on the other hand relies on various NIX_* variables 5 + to be passed through like NIX_CFLAGS_COMPILE_BEFORE. 6 + 7 + While at it ported to python3-style print(). 8 --- a/SConstruct 9 +++ b/SConstruct 10 @@ -6,7 +6,7 @@ ··· 16 17 MajorVersion = "0" 18 MinorVersion = "19" 19 + @@ -100,6 +100,7 @@ IncludePaths = [ 20 + paranoid = ' -W -Wcast-qual -Wwrite-strings -Wcast-align -Wpointer-arith -Wconversion -Wredundant-decls -Wunreachable-code -Winline -Wlarger-than-256' 21 22 + env = Environment(CCFLAGS = '-ggdb -pipe -Wall -O3 -ffast-math -Wno-unused -fPIC -pthread', 23 + + ENV = os.environ, 24 + VERSION_NUM = FluxusVersion) 25 + env.MergeFlags(ARGUMENTS.get('CCFLAGS', '').split()) 26 + env.MergeFlags(ARGUMENTS.get('LDFLAGS', '').split()) 27 + @@ -229,9 +230,9 @@ if env['PLATFORM'] == 'posix': 28 # Make sure we have these libraries availible 29 30 if not GetOption('clean'): ··· 37 # detect ode precision 38 if not GetOption('clean'): 39 try: 40 + @@ -240,27 +241,27 @@ if not GetOption('clean'): 41 if isinstance(ode_str[0], str): 42 env.MergeFlags(ode_str[0]) 43 except: ··· 69 Exit(1) 70 71 if not conf.CheckFunc("dInitODE2"): 72 + @@ -334,7 +335,7 @@ if not GetOption('clean'): 73 ]) 74 75 if raco_status != 0: ··· 78 Exit(1) 79 80 81 + @@ -377,8 +378,8 @@ if not GetOption('clean') and static_modules: 82 83 app_env['LIBS'].remove("pthread") 84 app_env['LIBS'].remove("dl") ··· 89 90 # now go through the rest of the libs, removing them from 91 # the environment at the same time 92 + @@ -425,7 +426,7 @@ SConscript(dirs = build_dirs, 93 if not GetOption('clean'): 94 helpmap_status = subprocess.call(["racket", "makehelpmap.scm"], cwd="docs/helpmap") 95 if helpmap_status != 0: