summarylogtreecommitdiffstats
path: root/sconstruct_tapeutape.diff
blob: 4bf3d5ed205c2e5bd4c40ba8002ff005f5ab0752 (plain)
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
reverted:
--- SConstruct_old	2017-10-15 14:56:37.472283752 +0200
+++ SConstruct	2017-10-15 14:50:10.448966259 +0200
@@ -1,6 +1,15 @@
 # ENVIRONMENT
 env = Environment(CPPFLAGS=' -I/usr/include/libxml2 -I/usr/include/lash-1.0',LIBS=['asound','pthread','xml2','sndfile','samplerate','jack'])
 
+# CONFIGURATION OPTIONS
+opts = Variables('tapeutape.conf') 
+opts.Add(PathVariable('PREFIX', 'Directory to install under', '/usr/local', PathVariable.PathIsDir))
+opts.Add(PathVariable("DESTDIR", 'Root directory to install into', '/usr/local', PathVariable.PathIsDir))
+opts.Update(env)
+#opts.Save('tapeutape.conf', env)  # Save, so user doesn't have to specify PREFIX every time
+
+Help(opts.GenerateHelpText(env))
+
 # SOURCE FILES
 base = Glob('src/base/*.cpp')
 audio = Glob('src/audio/*.cpp')
@@ -20,10 +29,10 @@
 	######## GCC
 	f = FindFile('g++', ['/usr/bin', '/usr/local/bin'])
 	if f:
+		print ('Checking for g++...yes')
-		print 'Checking for g++...yes'
 	else:
 		missing+='g++\n'
+		print ('Checking for g++...no')
-		print 'Checking for g++...no'
 	######## JACK
 	if not conf.CheckCHeader('jack/jack.h'):
 		missing+='jack\n'
@@ -56,24 +65,22 @@
 			missing+='fltk\n'
 		else:
 			sources+=ui
+			env.ParseConfig('fltk-config --cxxflags --ldflags')
-			env.ParseConfig('fltk-config --libs --cxxflags --ldflags')
 			env.Append(CPPFLAGS = ' -DWITH_GUI ')
 	env = conf.Finish()
 
 	#IF SOMETHING WAS MISSING
 	if(missing!=''):
 		if(optlang=='fr'):
+			print ('\nLes dependances suivantes sont manquantes:\n')
+			print (missing)
+			print ('\n')
+			print ('hehe')
-			print '\nLes dependances suivantes sont manquantes:\n'
-			print missing
-			print '\n'
-			print """Merci de les installer (paquetages -dev ou -devel) puis de re-entrer la commande 'scons lang=fr'
-				"""
 		else:
+			print ('\nThe following dependencies are missing:\n')
+			print (missing)
+			print ('\n')
+			print ('hehe2')
-			print '\nThe following dependencies are missing:\n'
-			print missing
-			print '\n'
-			print """Please install them (packages -dev or -devel) and re-type 'scons'
-				"""
 		Exit(1)
 	
 # BUILD
@@ -88,9 +95,9 @@
 		env['LINKCOMSTR'] = "Linking $TARGET"
 
 # INSTALL
+bin = env.Install('$DESTDIR/$PREFIX/bin', 'tapeutape')
+desktop = env.Install('$DESTDIR/$PREFIX/share/applications', 'data/tapeutape.desktop')
+icon = env.Install('$DESTDIR/$PREFIX/share/pixmaps', 'data/tapeutape.png')
-bin = env.Install('/usr/local/bin', 'tapeutape')
-desktop = env.Install('/usr/local/share/applications', 'data/tapeutape.desktop')
-icon = env.Install('/usr/local/share/pixmaps', 'data/tapeutape.png')
 env.Alias('install', [bin,desktop,icon])
 
 # HELP
@@ -104,6 +111,8 @@
 
 		Si tout se passe bien, entrez 'scons install' en tant qu'administrateur 
 		pour installer Tapeutape dans /usr/local/
+			utilisez DESTDIR ou PREFIX pour installer dans d'autres endroits, 
+			p. ex. 'scons PREFIX="/usr" install'
 
 		Si vous voulez nettoyer la compilation, entrez 'scons -c'
 		Si vous voulez desinstaller Tapeutape, entrez 'scons -c install'
@@ -119,6 +128,8 @@
 
 		If everything went good, type 'scons install' as root 
 		to install Tapeutape in /usr/local/
+			use DESTDIR or PREFIX to install in other places, 
+			e.g. 'scons PREFIX="/usr" install'
 
 		If you want to clean the build, type 'scons -c'
 		If you want to uninstall Tapeutape, type 'scons -c install'