about summary refs log tree commit diff
path: root/pkgs/applications/graphics/fluxus/fix-build.patch
blob: b44327520e654368db74bb2b6ee4dd385903d122 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
scons does not use os environment by default:
  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
+++ b/SConstruct
@@ -6,7 +6,7 @@
 # application, then calls the sconscripts for libfluxus and
 # the fluxus Racket modules
 
-import os, os.path, sys, commands, subprocess
+import os, os.path, sys, subprocess
 
 MajorVersion = "0"
 MinorVersion = "19"
@@ -100,6 +100,7 @@ IncludePaths = [
 paranoid = ' -W -Wcast-qual -Wwrite-strings -Wcast-align -Wpointer-arith -Wconversion -Wredundant-decls -Wunreachable-code -Winline -Wlarger-than-256'
 
 env = Environment(CCFLAGS = '-ggdb -pipe -Wall -O3 -ffast-math -Wno-unused -fPIC -pthread',
+                  ENV = os.environ,
                   VERSION_NUM = FluxusVersion)
 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
 
 if not GetOption('clean'):
-        print '--------------------------------------------------------'
-        print 'Fluxus: Configuring Build Environment'
-        print '--------------------------------------------------------'
+        print('--------------------------------------------------------')
+        print('Fluxus: Configuring Build Environment')
+        print('--------------------------------------------------------')
         # detect ode precision
         if not GetOption('clean'):
           try:
@@ -240,27 +241,27 @@ if not GetOption('clean'):
             if isinstance(ode_str[0], str):
               env.MergeFlags(ode_str[0])
           except:
-            print 'WARNING: unable to run ode-config, cannot detect ODE precision'
+            print('WARNING: unable to run ode-config, cannot detect ODE precision')
 
         conf = Configure(env)
 
         # check Racket and OpenAL frameworks on osx
         if env['PLATFORM'] == 'darwin':
                 if not conf.CheckHeader('scheme.h'):
-                        print "ERROR: 'racket3m' must be installed!"
+                        print("ERROR: 'racket3m' must be installed!")
                         Exit(1)
                 if racket_framework:
                   LibList = filter(lambda x: x[0] != 'racket3m', LibList)
                 # OpenAL should be installed everywhere
                 if not conf.CheckHeader('OpenAL/al.h'):
-                        print "ERROR: 'OpenAL' must be installed!"
+                        print("ERROR: 'OpenAL' must be installed!")
                         Exit(1)
 
         # all libraries are required, and some of them require each other,
         # hence the order is important, and autoadd=1
         for (lib,headers) in LibList:
                 if not conf.CheckLibWithHeader(lib, headers, 'C', autoadd = 1):
-                        print "ERROR: '%s' must be installed!" % (lib)
+                        print("ERROR: '%s' must be installed!" % (lib))
                         Exit(1)
 
         if not conf.CheckFunc("dInitODE2"):
@@ -334,7 +335,7 @@ if not GetOption('clean'):
 			])
 
 	if raco_status != 0:
-		print "ERROR: Failed to run command 'raco'"
+		print("ERROR: Failed to run command 'raco'")
 		Exit(1)
 
 
@@ -377,8 +378,8 @@ if not GetOption('clean') and static_modules:
 
 		app_env['LIBS'].remove("pthread")
 		app_env['LIBS'].remove("dl")
-                app_env['LIBS'].remove("ode")
-                app_env['LIBS'].remove("sndfile")
+		app_env['LIBS'].remove("ode")
+		app_env['LIBS'].remove("sndfile")
 
 		# now go through the rest of the libs, removing them from
 		# the environment at the same time
@@ -425,7 +426,7 @@ SConscript(dirs = build_dirs,
 if not GetOption('clean'):
     helpmap_status = subprocess.call(["racket", "makehelpmap.scm"], cwd="docs/helpmap")
     if helpmap_status != 0:
-        print "ERROR: Failed to build 'docs/helpmap'"
+        print("ERROR: Failed to build 'docs/helpmap'")
         Exit(1)
 
 ################################################################################