biome: 1.9.2 -> 1.9.3 (#349335)
[NixPkgs.git] / pkgs / applications / graphics / fluxus / fix-build.patch
blobb44327520e654368db74bb2b6ee4dd385903d122
1 scons does not use os environment by default:
2 https://scons.org/doc/2.1.0/HTML/scons-user/x1750.html
4 nixpkgs' cc-wrapper on the other hand relies on various NIX_* variables
5 to be passed through like NIX_CFLAGS_COMPILE_BEFORE.
7 While at it ported to python3-style print().
8 --- a/SConstruct
9 +++ b/SConstruct
10 @@ -6,7 +6,7 @@
11 # application, then calls the sconscripts for libfluxus and
12 # the fluxus Racket modules
14 -import os, os.path, sys, commands, subprocess
15 +import os, os.path, sys, subprocess
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'
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
30 if not GetOption('clean'):
31 - print '--------------------------------------------------------'
32 - print 'Fluxus: Configuring Build Environment'
33 - print '--------------------------------------------------------'
34 + print('--------------------------------------------------------')
35 + print('Fluxus: Configuring Build Environment')
36 + print('--------------------------------------------------------')
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:
44 - print 'WARNING: unable to run ode-config, cannot detect ODE precision'
45 + print('WARNING: unable to run ode-config, cannot detect ODE precision')
47 conf = Configure(env)
49 # check Racket and OpenAL frameworks on osx
50 if env['PLATFORM'] == 'darwin':
51 if not conf.CheckHeader('scheme.h'):
52 - print "ERROR: 'racket3m' must be installed!"
53 + print("ERROR: 'racket3m' must be installed!")
54 Exit(1)
55 if racket_framework:
56 LibList = filter(lambda x: x[0] != 'racket3m', LibList)
57 # OpenAL should be installed everywhere
58 if not conf.CheckHeader('OpenAL/al.h'):
59 - print "ERROR: 'OpenAL' must be installed!"
60 + print("ERROR: 'OpenAL' must be installed!")
61 Exit(1)
63 # all libraries are required, and some of them require each other,
64 # hence the order is important, and autoadd=1
65 for (lib,headers) in LibList:
66 if not conf.CheckLibWithHeader(lib, headers, 'C', autoadd = 1):
67 - print "ERROR: '%s' must be installed!" % (lib)
68 + print("ERROR: '%s' must be installed!" % (lib))
69 Exit(1)
71 if not conf.CheckFunc("dInitODE2"):
72 @@ -334,7 +335,7 @@ if not GetOption('clean'):
75 if raco_status != 0:
76 - print "ERROR: Failed to run command 'raco'"
77 + print("ERROR: Failed to run command 'raco'")
78 Exit(1)
81 @@ -377,8 +378,8 @@ if not GetOption('clean') and static_modules:
83 app_env['LIBS'].remove("pthread")
84 app_env['LIBS'].remove("dl")
85 - app_env['LIBS'].remove("ode")
86 - app_env['LIBS'].remove("sndfile")
87 + app_env['LIBS'].remove("ode")
88 + app_env['LIBS'].remove("sndfile")
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:
96 - print "ERROR: Failed to build 'docs/helpmap'"
97 + print("ERROR: Failed to build 'docs/helpmap'")
98 Exit(1)
100 ################################################################################