diff options
author | François Andriot <[email protected]> | 2018-07-20 12:41:46 +0900 |
---|---|---|
committer | Michele Calgaro <[email protected]> | 2018-07-20 12:43:17 +0900 |
commit | 19cdd9e7fded073d6a3fcca77d3c07567dc49706 (patch) | |
tree | 23259660497635362db44ce9a0e06f8fb2dd54a7 /admin | |
parent | 7ae5fbd1e6d995863805678d85cf4a5fb4ed91bd (diff) | |
download | kstreamripper-19cdd9e7fded073d6a3fcca77d3c07567dc49706.tar.gz kstreamripper-19cdd9e7fded073d6a3fcca77d3c07567dc49706.zip |
Fixed FTBFS in OpenSUSE (all versions) and Fedora 28.
Signed-off-by: François Andriot <[email protected]>
Signed-off-by: Michele Calgaro <[email protected]>
(cherry picked from commit 9fa6391b3fb8853c6cd7f717f117c62189e266ec)
Diffstat (limited to 'admin')
-rw-r--r-- | admin/generic.py | 36 | ||||
-rw-r--r-- | admin/kde.py | 21 |
2 files changed, 29 insertions, 28 deletions
diff --git a/admin/generic.py b/admin/generic.py index b5c8dd5..e0fa6b1 100644 --- a/admin/generic.py +++ b/admin/generic.py @@ -37,7 +37,7 @@ ie: """+BOLD+"""scons configure debug=full prefix=/usr/local extraincludes=/tmp/ ## Global cache directory ## Put all project files in it so a rm -rf cache will clean up the config - if not env.has_key('CACHEDIR'): + if not 'CACHEDIR' in env: env['CACHEDIR'] = os.getcwd()+'/cache/' if not os.path.isdir(env['CACHEDIR']): os.mkdir(env['CACHEDIR']) @@ -51,7 +51,7 @@ ie: """+BOLD+"""scons configure debug=full prefix=/usr/local extraincludes=/tmp/ # Special trick for installing rpms ... env['DESTDIR']='' - if 'install' in env['TARGS'] and os.environ.has_key('DESTDIR'): + if 'install' in env['TARGS'] and 'DESTDIR' in os.environ: env['DESTDIR']=os.environ['DESTDIR']+'/' print(CYAN+'** Enabling DESTDIR for the project ** ' + NORMAL + env['DESTDIR']) @@ -75,19 +75,19 @@ ie: """+BOLD+"""scons configure debug=full prefix=/usr/local extraincludes=/tmp/ import SCons.Util # configure the environment if needed - if 'configure' in env['TARGS'] or not env.has_key('ISCONFIGURED'): + if 'configure' in env['TARGS'] or not 'ISCONFIGURED' in env: # be paranoid, unset existing variables - if env.has_key('KDECXXFLAGS'): + if 'KDECXXFLAGS' in env: env.__delitem__('KDECXXFLAGS') - if env.has_key('KDECCFLAGS'): + if 'KDECCFLAGS' in env: env.__delitem__('KDECCFLAGS') - if env.has_key('KDELINKFLAGS'): + if 'KDELINKFLAGS' in env: env.__delitem__('KDELINKFLAGS') - if env.has_key('PREFIX'): + if 'PREFIX' in env: env.__delitem__('PREFIX') - if env.has_key('EXTRAINCLUDES'): + if 'EXTRAINCLUDES' in env: env.__delitem__('EXTRAINCLUDES') - if env.has_key('ISCONFIGURED'): + if 'ISCONFIGURED' in env: env.__delitem__('ISCONFIGURED') if env['ARGS'].get('debug', None): @@ -98,19 +98,19 @@ ie: """+BOLD+"""scons configure debug=full prefix=/usr/local extraincludes=/tmp/ else: env['KDECXXFLAGS'] = ['-DDEBUG', '-g'] else: - if os.environ.has_key('CXXFLAGS'): + if 'CXXFLAGS' in os.environ: # user-defined flags (gentooers will be elighted) env['KDECXXFLAGS'] = SCons.Util.CLVar( os.environ['CXXFLAGS'] ) env.Append( KDECXXFLAGS = ['-DNDEBUG', '-DNO_DEBUG'] ) else: env.Append(KDECXXFLAGS = ['-O2', '-DNDEBUG', '-DNO_DEBUG']) - if os.environ.has_key('CFLAGS'): + if 'CFLAGS' in os.environ: env['KDECCFLAGS'] = SCons.Util.CLVar( os.environ['CFLAGS'] ) ## FreeBSD settings (contributed by will at freebsd dot org) if os.uname()[0] == "FreeBSD": - if os.environ.has_key('PTHREAD_LIBS'): + if 'PTHREAD_LIBS' in os.environ: env.AppendUnique( KDELINKFLAGS = SCons.Util.CLVar( os.environ['PTHREAD_LIBS'] ) ) else: syspf = os.popen('/sbin/sysctl kern.osreldate') @@ -129,14 +129,14 @@ ie: """+BOLD+"""scons configure debug=full prefix=/usr/local extraincludes=/tmp/ if env['ARGS'].get('prefix', None): env['PREFIX'] = env['ARGS'].get('prefix', None) print(CYAN+'** set the installation prefix for the project : ' + env['PREFIX'] +' **'+ NORMAL) - elif env.has_key('PREFIX'): + elif 'PREFIX' in env: env.__delitem__('PREFIX') # User-specified include paths env['EXTRAINCLUDES'] = env['ARGS'].get('extraincludes', None) if env['ARGS'].get('extraincludes', None): print(CYAN+'** set extra include paths for the project : ' + env['EXTRAINCLUDES'] +' **'+ NORMAL) - elif env.has_key('EXTRAINCLUDES'): + elif 'EXTRAINCLUDES' in env: env.__delitem__('EXTRAINCLUDES') env['ISCONFIGURED']=1 @@ -144,16 +144,16 @@ ie: """+BOLD+"""scons configure debug=full prefix=/usr/local extraincludes=/tmp/ # And finally save the options in the cache opts.Save(cachefile, env) - if env.has_key('KDECXXFLAGS'): + if 'KDECXXFLAGS' in env: env.AppendUnique( CPPFLAGS = env['KDECXXFLAGS'] ) - if env.has_key('KDECCFLAGS'): + if 'KDECCFLAGS' in env: env.AppendUnique( CCFLAGS = env['KDECCFLAGS'] ) - if env.has_key('KDELINKFLAGS'): + if 'KDELINKFLAGS' in env: env.AppendUnique( LINKFLAGS = env['KDELINKFLAGS'] ) - if env.has_key('EXTRAINCLUDES'): + if 'EXTRAINCLUDES' in env: incpaths = [] for dir in str(env['EXTRAINCLUDES']).split(':'): incpaths.append( dir ) diff --git a/admin/kde.py b/admin/kde.py index e6cbdb1..8a70106 100644 --- a/admin/kde.py +++ b/admin/kde.py @@ -124,18 +124,18 @@ def detect_kde(env): env['QT_UIC'] = uic print("Checking for moc : ") - moc = qtdir + "/bin/moc" + moc = qtdir + "/bin/tmoc" if os.path.isfile(moc): print(GREEN+"moc was found as "+moc+NORMAL) else: - moc = os.popen("which moc 2>/dev/null").read().strip() + moc = os.popen("which tmoc 2>/dev/null").read().strip() if len(moc): print(YELLOW+"moc was found as "+moc+NORMAL) - elif os.path.isfile("/usr/share/tqt3/bin/moc"): - moc = "/usr/share/tqt3/bin/moc" + elif os.path.isfile("/usr/share/tqt3/bin/tmoc"): + moc = "/usr/share/tqt3/bin/tmoc" print(YELLOW+"moc was found as "+moc+NORMAL) - elif os.path.isfile("/usr/share/qt3/bin/moc"): - moc = "/usr/share/qt3/bin/moc" + elif os.path.isfile("/usr/share/qt3/bin/tmoc"): + moc = "/usr/share/qt3/bin/tmoc" print(YELLOW+"moc was found as "+moc+NORMAL) else: print(RED+"moc was not found - set QTDIR or put it in your PATH ?"+NORMAL) @@ -245,7 +245,7 @@ def detect_kde(env): ## qt libs and includes env['QTINCLUDEPATH']= qtincludes - env['TQTINCLUDEPATH']=tqtincludes + env['TQTINCLUDEPATH']= tqtincludes if not qtlibs: qtlibs = qtdir+"/lib" env['QTLIBPATH']= qtlibs @@ -271,7 +271,7 @@ def mocscan(target, source, env): if os.path.isfile(uiname): continue - hname = splitext(cpp.name)[0] + ".h" + hname = splitext(cpp.name)[0] + ".h" h = SCons.Node.FS.find_file(hname, (cpp.get_dir(),) ) if h: @@ -319,6 +319,7 @@ ie: """+BOLD+"""scons configure libdir=/usr/local/lib qtincludes=/usr/include/qt ( 'QTDIR', 'root of qt directory' ), ( 'QTLIBPATH', 'path to the qt libraries' ), ( 'QTINCLUDEPATH', 'path to the qt includes' ), + ( 'TQTINCLUDEPATH', 'path to the tqt includes' ), ( 'QT_UIC', 'moc directory'), ( 'QT_MOC', 'moc executable command'), ( 'QTPLUGINS', 'uic executable command'), @@ -530,7 +531,7 @@ ie: """+BOLD+"""scons configure libdir=/usr/local/lib qtincludes=/usr/include/qt shared_obj.src_builder.append('Transfiles') ## find the files to moc, dcop, and link against kde and qt - env.AppendUnique(PROGEMITTER=[mocscan], SHLIBEMITTER=[mocscan], LIBEMITTER =[mocscan]) + env.AppendUnique(PROGEMITTER=[mocscan], SHLIBEMITTER=[mocscan], LIBEMITTER =[mocscan]) ########################################### ## Handy helpers for building kde programs @@ -568,7 +569,7 @@ ie: """+BOLD+"""scons configure libdir=/usr/local/lib qtincludes=/usr/include/qt kcfg_files.append(bs) elif ext == '.skel': skel_files.append(bs) - else: + else: other_files.append(bs) return src |