Browse Source

Fix FTBFS with SCons 3.x

Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
Slávek Banko 1 year ago
parent
commit
ef18cc16fa
6 changed files with 56 additions and 56 deletions
  1. 1
    1
      SConstruct
  2. 4
    4
      admin/generic.py
  3. 47
    47
      admin/kde.py
  4. 2
    2
      doc/SConscript
  5. 1
    1
      po/SConscript
  6. 1
    1
      src/SConscript

+ 1
- 1
SConstruct View File

@@ -222,7 +222,7 @@ if 'dist' in COMMAND_LINE_TARGETS:
222 222
         os.popen("rm -f "+FOLDER+"/config.py*")
223 223
 
224 224
         ## make the tarball
225
-        print GREEN+"Writing archive "+ARCHIVE+NORMAL
225
+        print(GREEN+"Writing archive "+ARCHIVE+NORMAL)
226 226
         os.popen("tar cjf "+ARCHIVE+" "+FOLDER)
227 227
 
228 228
         ## remove the temporary directory

+ 4
- 4
admin/generic.py View File

@@ -53,7 +53,7 @@ ie: """+BOLD+"""scons configure debug=full prefix=/usr/local extraincludes=/tmp/
53 53
 	env['DESTDIR']=''
54 54
 	if 'install' in env['TARGS'] and os.environ.has_key('DESTDIR'):
55 55
 		env['DESTDIR']=os.environ['DESTDIR']+'/'
56
-		print CYAN+'** Enabling DESTDIR for the project ** ' + NORMAL + env['DESTDIR']
56
+		print(CYAN+'** Enabling DESTDIR for the project ** ' + NORMAL + env['DESTDIR'])
57 57
 
58 58
 	# load the options
59 59
 	from SCons.Options import Options, PathOption
@@ -92,7 +92,7 @@ ie: """+BOLD+"""scons configure debug=full prefix=/usr/local extraincludes=/tmp/
92 92
 
93 93
 		if env['ARGS'].get('debug', None):
94 94
 			debuglevel = env['ARGS'].get('debug', None)
95
-			print CYAN+'** Enabling debug for the project **' + NORMAL
95
+			print(CYAN+'** Enabling debug for the project **' + NORMAL)
96 96
 			if (debuglevel == "full"):
97 97
 				env['KDECXXFLAGS'] = ['-DDEBUG', '-g3']
98 98
 			else:
@@ -128,14 +128,14 @@ ie: """+BOLD+"""scons configure debug=full prefix=/usr/local extraincludes=/tmp/
128 128
 		# User-specified prefix
129 129
 		if env['ARGS'].get('prefix', None):
130 130
 			env['PREFIX'] = env['ARGS'].get('prefix', None)
131
-			print CYAN+'** set the installation prefix for the project : ' + env['PREFIX'] +' **'+ NORMAL
131
+			print(CYAN+'** set the installation prefix for the project : ' + env['PREFIX'] +' **'+ NORMAL)
132 132
 		elif env.has_key('PREFIX'):
133 133
 			env.__delitem__('PREFIX')
134 134
 
135 135
 		# User-specified include paths
136 136
 		env['EXTRAINCLUDES'] = env['ARGS'].get('extraincludes', None)
137 137
 		if env['ARGS'].get('extraincludes', None):
138
-			print CYAN+'** set extra include paths for the project : ' + env['EXTRAINCLUDES'] +' **'+ NORMAL
138
+			print(CYAN+'** set extra include paths for the project : ' + env['EXTRAINCLUDES'] +' **'+ NORMAL)
139 139
 		elif env.has_key('EXTRAINCLUDES'):
140 140
 			env.__delitem__('EXTRAINCLUDES')
141 141
 

+ 47
- 47
admin/kde.py View File

@@ -44,22 +44,22 @@ def detect_kde(env):
44 44
 	tdedir     = env['ARGS'].get('tdedir', None)
45 45
 
46 46
 	## Detect the tde libraries
47
-	print "Checking for tde-config           : ",
47
+	print("Checking for tde-config           : ")
48 48
 	str="which tde-config 2>/dev/null"
49 49
 	if tdedir: str="which %s 2>/dev/null" % (tdedir+'/bin/tde-config')
50 50
 	kde_config = os.popen(str).read().strip()
51 51
 	if len(kde_config):
52
-		print GREEN + 'tde-config was found as ' + kde_config + NORMAL
52
+		print(GREEN + 'tde-config was found as ' + kde_config + NORMAL)
53 53
 	else:
54
-		if tdedir: print RED + 'tde-config was NOT found in the folder given ' + tdedir + NORMAL
55
-		else: print RED + 'tde-config was NOT found in your PATH' + NORMAL
56
-		print "Make sure kde is installed properly"
57
-		print "(missing package tdebase-devel?)"
54
+		if tdedir: print(RED + 'tde-config was NOT found in the folder given ' + tdedir + NORMAL)
55
+		else: print(RED + 'tde-config was NOT found in your PATH' + NORMAL)
56
+		print("Make sure kde is installed properly")
57
+		print("(missing package tdebase-devel?)")
58 58
 		env.Exit(1)
59 59
 	if tdedir: env['TDEDIR']=tdedir
60 60
 	else: env['TDEDIR'] = os.popen(kde_config+' -prefix').read().strip()
61 61
 
62
-	print "Checking for tde version          : ",
62
+	print("Checking for tde version          : ")
63 63
 	tde_version = os.popen(kde_config+" --version|grep TDE").read().strip().split()[1]
64 64
 	tde_major = tde_version.split('.')[0].lstrip('R')
65 65
 	tde_minor = tde_version.split('.')[1]
@@ -77,17 +77,17 @@ def detect_kde(env):
77 77
 	except:
78 78
 		pass
79 79
 	if int(tde_major) != 14:
80
-		print RED + tde_version
81
-		print RED + "Your tde version might be too old" + NORMAL
82
-		print RED + "Please make sure TDE is at least R14.0" + NORMAL
80
+		print(RED + tde_version)
81
+		print(RED + "Your tde version might be too old" + NORMAL)
82
+		print(RED + "Please make sure TDE is at least R14.0" + NORMAL)
83 83
 	else:
84
-		print GREEN + tde_version + NORMAL
84
+		print(GREEN + tde_version + NORMAL)
85 85
 
86 86
 	## Detect the qt library
87
-	print "Checking for the qt library       : ",
87
+	print("Checking for the qt library       : ")
88 88
 	qtdir = os.getenv("QTDIR")
89 89
 	if qtdir:
90
-		print GREEN + "qt is in " + qtdir + NORMAL
90
+		print(GREEN + "qt is in " + qtdir + NORMAL)
91 91
 	else:
92 92
 		libdir = os.popen(kde_config + ' --expandvars --install lib').read().strip()
93 93
 		libtdeuiSO = libdir+'/'+getSOfromLA(libdir+'/libtdeui.la')
@@ -98,103 +98,103 @@ def detect_kde(env):
98 98
 			pass
99 99
 		if m:
100 100
 			qtdir = m.group(1)
101
-			print YELLOW+"qt was found as " + m.group(1) + NORMAL
101
+			print(YELLOW+"qt was found as " + m.group(1) + NORMAL)
102 102
 		else:
103
-			print RED+"qt was not found"+NORMAL
104
-			print RED+"Please set QTDIR first (/usr/lib/qt3?)"+NORMAL
103
+			print(RED+"qt was not found"+NORMAL)
104
+			print(RED+"Please set QTDIR first (/usr/lib/qt3?)"+NORMAL)
105 105
 			env.Exit(1)
106 106
 	env['QTDIR'] = qtdir.strip()
107 107
 
108 108
 	## Find the necessary programs uic-tqt and moc
109
-	print "Checking for uic-tqt              : ",
109
+	print("Checking for uic-tqt              : ")
110 110
 	uic = qtdir + "/bin/uic-tqt"
111 111
 	if os.path.isfile(uic):
112
-		print GREEN+"uic-tqt was found as "+uic+NORMAL
112
+		print(GREEN+"uic-tqt was found as "+uic+NORMAL)
113 113
 	else:
114 114
 		uic = os.popen("which uic-tqt 2>/dev/null").read().strip()
115 115
 		if len(uic):
116
-			print YELLOW+"uic-tqt was found as "+uic+NORMAL
116
+			print(YELLOW+"uic-tqt was found as "+uic+NORMAL)
117 117
 		else:
118 118
 			uic = os.popen("which uic-tqt 2>/dev/null").read().strip()
119 119
 			if len(uic):
120
-				print YELLOW+"uic-tqt was found as "+uic+NORMAL
120
+				print(YELLOW+"uic-tqt was found as "+uic+NORMAL)
121 121
 			else:
122
-				print RED+"uic-tqt was not found - set QTDIR put it in your PATH ?"+NORMAL
122
+				print(RED+"uic-tqt was not found - set QTDIR put it in your PATH ?"+NORMAL)
123 123
 				env.Exit(1)
124 124
 	env['QT_UIC'] = uic
125 125
 
126
-	print "Checking for moc                  : ",
126
+	print("Checking for moc                  : ")
127 127
 	moc = qtdir + "/bin/moc"
128 128
 	if os.path.isfile(moc):
129
-		print GREEN+"moc was found as "+moc+NORMAL
129
+		print(GREEN+"moc was found as "+moc+NORMAL)
130 130
 	else:
131 131
 		moc = os.popen("which moc 2>/dev/null").read().strip()
132 132
 		if len(moc):
133
-			print YELLOW+"moc was found as "+moc+NORMAL
133
+			print(YELLOW+"moc was found as "+moc+NORMAL)
134 134
 		elif os.path.isfile("/usr/share/tqt3/bin/moc"):
135 135
 			moc = "/usr/share/tqt3/bin/moc"
136
-			print YELLOW+"moc was found as "+moc+NORMAL
136
+			print(YELLOW+"moc was found as "+moc+NORMAL)
137 137
 		elif os.path.isfile("/usr/share/qt3/bin/moc"):
138 138
 			moc = "/usr/share/qt3/bin/moc"
139
-			print YELLOW+"moc was found as "+moc+NORMAL
139
+			print(YELLOW+"moc was found as "+moc+NORMAL)
140 140
 		else:
141
-			print RED+"moc was not found - set QTDIR or put it in your PATH ?"+NORMAL
141
+			print(RED+"moc was not found - set QTDIR or put it in your PATH ?"+NORMAL)
142 142
 			env.Exit(1)
143 143
 	env['QT_MOC'] = moc
144 144
 
145 145
 	## check for the tqt includes
146
-	print "Checking for the tqt includes     : ",
146
+	print("Checking for the tqt includes     : ")
147 147
 	if tqtincludes and os.path.isfile(tqtincludes + "/tqlayout.h"):
148 148
 		# The user told where to look for and it looks valid
149
-		print GREEN + "ok " + tqtincludes + NORMAL
149
+		print(GREEN + "ok " + tqtincludes + NORMAL)
150 150
 	else:
151 151
 		if os.path.isfile(qtdir + "/include/qlayout.h"):
152 152
 			# Automatic detection
153
-			print GREEN + "ok " + qtdir + "/include/ " + NORMAL
153
+			print(GREEN + "ok " + qtdir + "/include/ " + NORMAL)
154 154
 			tqtincludes = qtdir + "/include/"
155 155
 		elif os.path.isfile("/usr/include/tqt/tqlayout.h"):
156 156
 			# Debian probably
157
-			print YELLOW + "the qt headers were found in /usr/include/tqt/ " + NORMAL
157
+			print(YELLOW + "the qt headers were found in /usr/include/tqt/ " + NORMAL)
158 158
 			tqtincludes = "/usr/include/tqt"
159 159
 		elif os.path.isfile("/usr/include/qt4/Qt/qglobal.h"):
160 160
 			# Debian probably
161
-			print YELLOW + "the qt headers were found in /usr/include/qt4/ " + NORMAL
161
+			print(YELLOW + "the qt headers were found in /usr/include/qt4/ " + NORMAL)
162 162
 			tqtincludes = "/usr/include/qt4"
163 163
 		else:
164
-			print RED + "the qt headers were not found" + NORMAL
164
+			print(RED + "the qt headers were not found" + NORMAL)
165 165
 			env.Exit(1)
166 166
 			
167 167
 	## check for the qt includes
168
-	print "Checking for the qt includes      : ",
168
+	print("Checking for the qt includes      : ")
169 169
 	if qtincludes and os.path.isfile(qtincludes + "/ntqglobal.h"):
170 170
 		# The user told where to look for and it looks valid
171
-		print GREEN + "ok " + qtincludes + NORMAL
171
+		print(GREEN + "ok " + qtincludes + NORMAL)
172 172
 	else:
173 173
 		if os.path.isfile(qtdir + "/include/ntqglobal.h"):
174 174
 			# Automatic detection
175
-			print GREEN + "ok " + qtdir + "/include/ " + NORMAL
175
+			print(GREEN + "ok " + qtdir + "/include/ " + NORMAL)
176 176
 			qtincludes = qtdir + "/include/"
177 177
 		elif os.path.isfile("/usr/include/tqt3/ntqglobal.h"):
178 178
 			# Debian probably
179
-			print YELLOW + "the qt headers were found in /usr/include/tqt3/ " + NORMAL
179
+			print(YELLOW + "the qt headers were found in /usr/include/tqt3/ " + NORMAL)
180 180
 			qtincludes = "/usr/include/tqt3"
181 181
 		else:
182
-			print RED + "the qt headers were not found" + NORMAL
182
+			print(RED + "the qt headers were not found" + NORMAL)
183 183
 			env.Exit(1)
184 184
 
185
-	print "Checking for the tde includes     : ",
185
+	print("Checking for the tde includes     : ")
186 186
 	kdeprefix = os.popen(kde_config + " --prefix").read().strip()
187 187
 	if not kdeincludes:
188 188
 		kdeincludes = kdeprefix+"/include/"
189 189
 	if os.path.isfile(kdeincludes + "/klineedit.h"):
190
-		print GREEN+"ok "+kdeincludes+NORMAL
190
+		print(GREEN+"ok "+kdeincludes+NORMAL)
191 191
 	else:
192 192
 		if os.path.isfile(kdeprefix+"/include/tde/klineedit.h"):
193 193
 			# Debian, Fedora probably
194
-			print YELLOW+"the kde headers were found in "+kdeprefix+"/include/tde/"+NORMAL
194
+			print(YELLOW+"the kde headers were found in "+kdeprefix+"/include/tde/"+NORMAL)
195 195
 			kdeincludes = kdeprefix + "/include/tde/"
196 196
 		else:
197
-			print RED+"The kde includes were NOT found"+NORMAL
197
+			print(RED+"The kde includes were NOT found"+NORMAL)
198 198
 			env.Exit(1)
199 199
 
200 200
 	if prefix:
@@ -583,10 +583,10 @@ ie: """+BOLD+"""scons configure libdir=/usr/local/lib qtincludes=/usr/include/qt
583 583
 		basedir=env['DESTDIR']
584 584
 		if len(restype)>0:
585 585
 			if not lenv.has_key(restype):
586
-				print RED+"unknown resource type "+restype+NORMAL
586
+				print(RED+"unknown resource type "+restype+NORMAL)
587 587
 			else:
588 588
 				basedir += lenv[restype]+'/'
589
-		#print file # <- useful to trace stuff :)
589
+		#print(file) # <- useful to trace stuff :)
590 590
 		install_list =  env.Install(basedir+subdir, files)
591 591
 		env.Alias('install', install_list)
592 592
 		return install_list
@@ -597,7 +597,7 @@ ie: """+BOLD+"""scons configure libdir=/usr/local/lib qtincludes=/usr/include/qt
597 597
 		basedir=env['DESTDIR']
598 598
 		if len(restype)>0:
599 599
 			if not lenv.has_key(restype):
600
-				print RED+"unknown resource type "+restype+NORMAL
600
+				print(RED+"unknown resource type "+restype+NORMAL)
601 601
 			else:
602 602
 				basedir += lenv[restype]+'/'
603 603
 		install_list = env.InstallAs(basedir+destfile, file)
@@ -705,13 +705,13 @@ ie: """+BOLD+"""scons configure libdir=/usr/local/lib qtincludes=/usr/include/qt
705 705
 		for iconfile in iconfiles:
706 706
 			tmp = iconfile.split('-')
707 707
 			if len(tmp) != 3:
708
-				print RED + 'WARNING: icon filename has unknown format: ' + iconfile + NORMAL
708
+				print(RED + 'WARNING: icon filename has unknown format: ' + iconfile + NORMAL)
709 709
 				continue
710 710
 			[icon_dir, icon_type, icon_filename] = tmp
711 711
 			try:
712 712
 				destfile = '%s/%s/%s/%s' % (lenv['KDEICONS'], dir_dic[icon_dir], type_dic[icon_type], icon_filename)
713 713
 			except KeyError:
714
-				print RED + 'WARNING: unknown icon type: ' + iconfile + NORMAL
714
+				print(RED + 'WARNING: unknown icon type: ' + iconfile + NORMAL)
715 715
 				continue
716 716
 			## do not use KDEinstallas here, as parsing from an ide will be necessary
717 717
 			if 'install' in env['TARGS']:

+ 2
- 2
doc/SConscript View File

@@ -8,7 +8,7 @@
8 8
 
9 9
 ## First load the environment set in the top-level SConstruct file
10 10
 Import( 'env' )
11
-myenv=env.Copy()
11
+myenv=env.Clone()
12 12
 
13 13
 ## The following looks complicated but it is not
14 14
 ## We first define a function to install all files as documentation
@@ -70,7 +70,7 @@ def processfolder(folder, lang, destination=""):
70 70
 	if len(docbook_list) == 0:
71 71
 		return
72 72
 	if not os.path.isfile( folder+'index.docbook' ):
73
-		print "Error, index.docbook was not found in "+folder+'/index.docbook'
73
+		print("Error, index.docbook was not found in "+folder+'/index.docbook')
74 74
 		return
75 75
 	if i_am_a_documentation_writer:
76 76
 		for file in docbook_list:

+ 1
- 1
po/SConscript View File

@@ -10,7 +10,7 @@
10 10
 ## First load the environment set in the top-level SConstruct file
11 11
 #Import( "env KDElang" )
12 12
 Import('env')
13
-myenv=env.Copy()
13
+myenv=env.Clone()
14 14
 
15 15
 ## Make translations for the program "test1" in french (requires fr.po)
16 16
 myenv['APPNAME'] = "kstreamripper"

+ 1
- 1
src/SConscript View File

@@ -14,7 +14,7 @@
14 14
 ## SConstruct file (set with 'Export') - this is very important
15 15
 
16 16
 Import( 'env' )
17
-myenv=env.Copy()
17
+myenv=env.Clone()
18 18
 
19 19
 #############################
20 20
 ## the programs to build

Loading…
Cancel
Save