Browse Source

Fixed FTBFS in OpenSUSE (all versions) and Fedora 28.

Signed-off-by: François Andriot <albator78@libertysurf.fr>
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
François Andriot 7 months ago
parent
commit
9fa6391b3f
3 changed files with 30 additions and 30 deletions
  1. 18
    18
      admin/generic.py
  2. 11
    10
      admin/kde.py
  3. 1
    2
      src/SConscript

+ 18
- 18
admin/generic.py View File

@@ -37,7 +37,7 @@ ie: """+BOLD+"""scons configure debug=full prefix=/usr/local extraincludes=/tmp/
37 37
 	
38 38
 	## Global cache directory
39 39
 	## Put all project files in it so a rm -rf cache will clean up the config
40
-	if not env.has_key('CACHEDIR'):
40
+	if not 'CACHEDIR' in env:
41 41
 		env['CACHEDIR'] = os.getcwd()+'/cache/'
42 42
 	if not os.path.isdir(env['CACHEDIR']):
43 43
 		os.mkdir(env['CACHEDIR'])
@@ -51,7 +51,7 @@ ie: """+BOLD+"""scons configure debug=full prefix=/usr/local extraincludes=/tmp/
51 51
 	
52 52
 	# Special trick for installing rpms ...
53 53
 	env['DESTDIR']=''
54
-	if 'install' in env['TARGS'] and os.environ.has_key('DESTDIR'):
54
+	if 'install' in env['TARGS'] and 'DESTDIR' in os.environ:
55 55
 		env['DESTDIR']=os.environ['DESTDIR']+'/'
56 56
 		print(CYAN+'** Enabling DESTDIR for the project ** ' + NORMAL + env['DESTDIR'])
57 57
 
@@ -75,19 +75,19 @@ ie: """+BOLD+"""scons configure debug=full prefix=/usr/local extraincludes=/tmp/
75 75
 	import SCons.Util
76 76
 
77 77
 	# configure the environment if needed
78
-	if 'configure' in env['TARGS'] or not env.has_key('ISCONFIGURED'):
78
+	if 'configure' in env['TARGS'] or not 'ISCONFIGURED' in env:
79 79
 		# be paranoid, unset existing variables
80
-		if env.has_key('KDECXXFLAGS'):
80
+		if 'KDECXXFLAGS' in env:
81 81
 			env.__delitem__('KDECXXFLAGS')
82
-		if env.has_key('KDECCFLAGS'):
82
+		if 'KDECCFLAGS' in env:
83 83
 			env.__delitem__('KDECCFLAGS')
84
-		if env.has_key('KDELINKFLAGS'):
84
+		if 'KDELINKFLAGS' in env:
85 85
 			env.__delitem__('KDELINKFLAGS')
86
-		if env.has_key('PREFIX'):
86
+		if 'PREFIX' in env:
87 87
 			env.__delitem__('PREFIX')
88
-		if env.has_key('EXTRAINCLUDES'):
88
+		if 'EXTRAINCLUDES' in env:
89 89
 			env.__delitem__('EXTRAINCLUDES')
90
-		if env.has_key('ISCONFIGURED'):
90
+		if 'ISCONFIGURED' in env:
91 91
 			env.__delitem__('ISCONFIGURED')
92 92
 
93 93
 		if env['ARGS'].get('debug', None):
@@ -98,19 +98,19 @@ ie: """+BOLD+"""scons configure debug=full prefix=/usr/local extraincludes=/tmp/
98 98
 			else:
99 99
 				env['KDECXXFLAGS'] = ['-DDEBUG', '-g']
100 100
 		else:
101
-			if os.environ.has_key('CXXFLAGS'):
101
+			if 'CXXFLAGS' in os.environ:
102 102
 				# user-defined flags (gentooers will be elighted)
103 103
 				env['KDECXXFLAGS'] = SCons.Util.CLVar( os.environ['CXXFLAGS'] )
104 104
 				env.Append( KDECXXFLAGS = ['-DNDEBUG', '-DNO_DEBUG'] )
105 105
 			else:
106 106
 				env.Append(KDECXXFLAGS = ['-O2', '-DNDEBUG', '-DNO_DEBUG'])
107 107
 
108
-		if os.environ.has_key('CFLAGS'):
108
+		if 'CFLAGS' in os.environ:
109 109
 			env['KDECCFLAGS'] = SCons.Util.CLVar( os.environ['CFLAGS'] )
110 110
 
111 111
 		## FreeBSD settings (contributed by will at freebsd dot org)
112 112
 		if os.uname()[0] == "FreeBSD":
113
-		        if os.environ.has_key('PTHREAD_LIBS'):
113
+		        if 'PTHREAD_LIBS' in os.environ:
114 114
 		                env.AppendUnique( KDELINKFLAGS = SCons.Util.CLVar( os.environ['PTHREAD_LIBS'] ) )
115 115
 		        else:
116 116
 		                syspf = os.popen('/sbin/sysctl kern.osreldate')
@@ -129,14 +129,14 @@ ie: """+BOLD+"""scons configure debug=full prefix=/usr/local extraincludes=/tmp/
129 129
 		if env['ARGS'].get('prefix', None):
130 130
 			env['PREFIX'] = env['ARGS'].get('prefix', None)
131 131
 			print(CYAN+'** set the installation prefix for the project : ' + env['PREFIX'] +' **'+ NORMAL)
132
-		elif env.has_key('PREFIX'):
132
+		elif 'PREFIX' in env:
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 138
 			print(CYAN+'** set extra include paths for the project : ' + env['EXTRAINCLUDES'] +' **'+ NORMAL)
139
-		elif env.has_key('EXTRAINCLUDES'):
139
+		elif 'EXTRAINCLUDES' in env:
140 140
 			env.__delitem__('EXTRAINCLUDES')
141 141
 
142 142
 		env['ISCONFIGURED']=1
@@ -144,16 +144,16 @@ ie: """+BOLD+"""scons configure debug=full prefix=/usr/local extraincludes=/tmp/
144 144
 		# And finally save the options in the cache
145 145
 		opts.Save(cachefile, env)
146 146
 
147
-	if env.has_key('KDECXXFLAGS'):
147
+	if 'KDECXXFLAGS' in env:
148 148
                 env.AppendUnique( CPPFLAGS = env['KDECXXFLAGS'] )
149 149
 
150
-	if env.has_key('KDECCFLAGS'):
150
+	if 'KDECCFLAGS' in env:
151 151
 		env.AppendUnique( CCFLAGS = env['KDECCFLAGS'] )
152 152
 
153
-	if env.has_key('KDELINKFLAGS'):
153
+	if 'KDELINKFLAGS' in env:
154 154
 		env.AppendUnique( LINKFLAGS = env['KDELINKFLAGS'] )
155 155
 
156
-	if env.has_key('EXTRAINCLUDES'):
156
+	if 'EXTRAINCLUDES' in env:
157 157
 		incpaths = []
158 158
 		for dir in str(env['EXTRAINCLUDES']).split(':'):
159 159
 			incpaths.append( dir )

+ 11
- 10
admin/kde.py View File

@@ -124,18 +124,18 @@ def detect_kde(env):
124 124
 	env['QT_UIC'] = uic
125 125
 
126 126
 	print("Checking for moc                  : ")
127
-	moc = qtdir + "/bin/moc"
127
+	moc = qtdir + "/bin/tmoc"
128 128
 	if os.path.isfile(moc):
129 129
 		print(GREEN+"moc was found as "+moc+NORMAL)
130 130
 	else:
131
-		moc = os.popen("which moc 2>/dev/null").read().strip()
131
+		moc = os.popen("which tmoc 2>/dev/null").read().strip()
132 132
 		if len(moc):
133 133
 			print(YELLOW+"moc was found as "+moc+NORMAL)
134
-		elif os.path.isfile("/usr/share/tqt3/bin/moc"):
135
-			moc = "/usr/share/tqt3/bin/moc"
134
+		elif os.path.isfile("/usr/share/tqt3/bin/tmoc"):
135
+			moc = "/usr/share/tqt3/bin/tmoc"
136 136
 			print(YELLOW+"moc was found as "+moc+NORMAL)
137
-		elif os.path.isfile("/usr/share/qt3/bin/moc"):
138
-			moc = "/usr/share/qt3/bin/moc"
137
+		elif os.path.isfile("/usr/share/qt3/bin/tmoc"):
138
+			moc = "/usr/share/qt3/bin/tmoc"
139 139
 			print(YELLOW+"moc was found as "+moc+NORMAL)
140 140
 		else:
141 141
 			print(RED+"moc was not found - set QTDIR or put it in your PATH ?"+NORMAL)
@@ -245,7 +245,7 @@ def detect_kde(env):
245 245
 
246 246
 	## qt libs and includes
247 247
 	env['QTINCLUDEPATH']= qtincludes
248
-	env['TQTINCLUDEPATH']=tqtincludes
248
+	env['TQTINCLUDEPATH']= tqtincludes
249 249
 	if not qtlibs:
250 250
 		qtlibs = qtdir+"/lib"
251 251
 	env['QTLIBPATH']= qtlibs
@@ -271,7 +271,7 @@ def mocscan(target, source, env):
271 271
 		if os.path.isfile(uiname):
272 272
 			continue
273 273
 
274
-                hname = splitext(cpp.name)[0] + ".h"
274
+		hname = splitext(cpp.name)[0] + ".h"
275 275
 		h = SCons.Node.FS.find_file(hname, (cpp.get_dir(),) )
276 276
 
277 277
 		if h:
@@ -319,6 +319,7 @@ ie: """+BOLD+"""scons configure libdir=/usr/local/lib qtincludes=/usr/include/qt
319 319
 		( 'QTDIR', 'root of qt directory' ),
320 320
 		( 'QTLIBPATH', 'path to the qt libraries' ),
321 321
 		( 'QTINCLUDEPATH', 'path to the qt includes' ),
322
+		( 'TQTINCLUDEPATH', 'path to the tqt includes' ),
322 323
 		( 'QT_UIC', 'moc directory'),
323 324
 		( 'QT_MOC', 'moc executable command'),
324 325
 		( 'QTPLUGINS', 'uic executable command'),
@@ -530,7 +531,7 @@ ie: """+BOLD+"""scons configure libdir=/usr/local/lib qtincludes=/usr/include/qt
530 531
 	shared_obj.src_builder.append('Transfiles')
531 532
 
532 533
 	## find the files to moc, dcop, and link against kde and qt
533
-        env.AppendUnique(PROGEMITTER=[mocscan], SHLIBEMITTER=[mocscan], LIBEMITTER =[mocscan])
534
+	env.AppendUnique(PROGEMITTER=[mocscan], SHLIBEMITTER=[mocscan], LIBEMITTER =[mocscan])
534 535
 
535 536
 	###########################################
536 537
 	## Handy helpers for building kde programs
@@ -568,7 +569,7 @@ ie: """+BOLD+"""scons configure libdir=/usr/local/lib qtincludes=/usr/include/qt
568 569
 				kcfg_files.append(bs)
569 570
 			elif ext == '.skel':
570 571
                                 skel_files.append(bs)
571
-                        else:
572
+			else:
572 573
                                 other_files.append(bs)
573 574
 		return src
574 575
 

+ 1
- 2
src/SConscript View File

@@ -44,7 +44,6 @@ myenv.KDEaddpaths_includes( ['./', '../'] )
44 44
 
45 45
 ## Necessary libraries to link against
46 46
 myenv.KDEaddlibs( ['tqt-mt', 'tqt', 'tdecore', 'tdeio', 'tdeui', 'tdednssd'] )
47
-if env['KDEm2']>3: myenv.KDEaddlibs( ['tdednssd'])
48 47
 #############################
49 48
 ## Data to install
50 49
 
@@ -57,7 +56,7 @@ myenv.KDEinstall( 'KDEDATA', 'kstreamripper', 'kstreamripperui.rc' )
57 56
 ## Warning : there is a difference between the normal destop file used for the menu
58 57
 ##     and the servicetype desktop file, so they go in different directories
59 58
 ##     you will find more information in 'test3'
60
-myenv.KDEinstall( 'KDEMENU', 'Utilities', 'kstreamripper.desktop')
59
+myenv.KDEinstall( 'KDEXDG', '', 'kstreamripper.desktop')
61 60
 
62 61
 ## Use this when you need to install a mimetype file
63 62
 #myenv.KDEinstall( 'KDEMIME', 'application', 'x-test1.desktop' )

Loading…
Cancel
Save