Fix FTBFS with SCons 3.x

Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
pull/1/head
Slávek Banko 7 years ago
parent fc8ec3fd3e
commit ef18cc16fa

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

@ -53,7 +53,7 @@ ie: """+BOLD+"""scons configure debug=full prefix=/usr/local extraincludes=/tmp/
env['DESTDIR']='' env['DESTDIR']=''
if 'install' in env['TARGS'] and os.environ.has_key('DESTDIR'): if 'install' in env['TARGS'] and os.environ.has_key('DESTDIR'):
env['DESTDIR']=os.environ['DESTDIR']+'/' env['DESTDIR']=os.environ['DESTDIR']+'/'
print CYAN+'** Enabling DESTDIR for the project ** ' + NORMAL + env['DESTDIR'] print(CYAN+'** Enabling DESTDIR for the project ** ' + NORMAL + env['DESTDIR'])
# load the options # load the options
from SCons.Options import Options, PathOption from SCons.Options import Options, PathOption
@ -92,7 +92,7 @@ ie: """+BOLD+"""scons configure debug=full prefix=/usr/local extraincludes=/tmp/
if env['ARGS'].get('debug', None): if env['ARGS'].get('debug', None):
debuglevel = env['ARGS'].get('debug', None) debuglevel = env['ARGS'].get('debug', None)
print CYAN+'** Enabling debug for the project **' + NORMAL print(CYAN+'** Enabling debug for the project **' + NORMAL)
if (debuglevel == "full"): if (debuglevel == "full"):
env['KDECXXFLAGS'] = ['-DDEBUG', '-g3'] env['KDECXXFLAGS'] = ['-DDEBUG', '-g3']
else: else:
@ -128,14 +128,14 @@ ie: """+BOLD+"""scons configure debug=full prefix=/usr/local extraincludes=/tmp/
# User-specified prefix # User-specified prefix
if env['ARGS'].get('prefix', None): if env['ARGS'].get('prefix', None):
env['PREFIX'] = env['ARGS'].get('prefix', None) env['PREFIX'] = env['ARGS'].get('prefix', None)
print CYAN+'** set the installation prefix for the project : ' + env['PREFIX'] +' **'+ NORMAL print(CYAN+'** set the installation prefix for the project : ' + env['PREFIX'] +' **'+ NORMAL)
elif env.has_key('PREFIX'): elif env.has_key('PREFIX'):
env.__delitem__('PREFIX') env.__delitem__('PREFIX')
# User-specified include paths # User-specified include paths
env['EXTRAINCLUDES'] = env['ARGS'].get('extraincludes', None) env['EXTRAINCLUDES'] = env['ARGS'].get('extraincludes', None)
if env['ARGS'].get('extraincludes', None): if env['ARGS'].get('extraincludes', None):
print CYAN+'** set extra include paths for the project : ' + env['EXTRAINCLUDES'] +' **'+ NORMAL print(CYAN+'** set extra include paths for the project : ' + env['EXTRAINCLUDES'] +' **'+ NORMAL)
elif env.has_key('EXTRAINCLUDES'): elif env.has_key('EXTRAINCLUDES'):
env.__delitem__('EXTRAINCLUDES') env.__delitem__('EXTRAINCLUDES')

@ -44,22 +44,22 @@ def detect_kde(env):
tdedir = env['ARGS'].get('tdedir', None) tdedir = env['ARGS'].get('tdedir', None)
## Detect the tde libraries ## Detect the tde libraries
print "Checking for tde-config : ", print("Checking for tde-config : ")
str="which tde-config 2>/dev/null" str="which tde-config 2>/dev/null"
if tdedir: str="which %s 2>/dev/null" % (tdedir+'/bin/tde-config') if tdedir: str="which %s 2>/dev/null" % (tdedir+'/bin/tde-config')
kde_config = os.popen(str).read().strip() kde_config = os.popen(str).read().strip()
if len(kde_config): if len(kde_config):
print GREEN + 'tde-config was found as ' + kde_config + NORMAL print(GREEN + 'tde-config was found as ' + kde_config + NORMAL)
else: else:
if tdedir: print RED + 'tde-config was NOT found in the folder given ' + tdedir + NORMAL if tdedir: print(RED + 'tde-config was NOT found in the folder given ' + tdedir + NORMAL)
else: print RED + 'tde-config was NOT found in your PATH' + NORMAL else: print(RED + 'tde-config was NOT found in your PATH' + NORMAL)
print "Make sure kde is installed properly" print("Make sure kde is installed properly")
print "(missing package tdebase-devel?)" print("(missing package tdebase-devel?)")
env.Exit(1) env.Exit(1)
if tdedir: env['TDEDIR']=tdedir if tdedir: env['TDEDIR']=tdedir
else: env['TDEDIR'] = os.popen(kde_config+' -prefix').read().strip() else: env['TDEDIR'] = os.popen(kde_config+' -prefix').read().strip()
print "Checking for tde version : ", print("Checking for tde version : ")
tde_version = os.popen(kde_config+" --version|grep TDE").read().strip().split()[1] tde_version = os.popen(kde_config+" --version|grep TDE").read().strip().split()[1]
tde_major = tde_version.split('.')[0].lstrip('R') tde_major = tde_version.split('.')[0].lstrip('R')
tde_minor = tde_version.split('.')[1] tde_minor = tde_version.split('.')[1]
@ -77,17 +77,17 @@ def detect_kde(env):
except: except:
pass pass
if int(tde_major) != 14: if int(tde_major) != 14:
print RED + tde_version print(RED + tde_version)
print RED + "Your tde version might be too old" + NORMAL print(RED + "Your tde version might be too old" + NORMAL)
print RED + "Please make sure TDE is at least R14.0" + NORMAL print(RED + "Please make sure TDE is at least R14.0" + NORMAL)
else: else:
print GREEN + tde_version + NORMAL print(GREEN + tde_version + NORMAL)
## Detect the qt library ## Detect the qt library
print "Checking for the qt library : ", print("Checking for the qt library : ")
qtdir = os.getenv("QTDIR") qtdir = os.getenv("QTDIR")
if qtdir: if qtdir:
print GREEN + "qt is in " + qtdir + NORMAL print(GREEN + "qt is in " + qtdir + NORMAL)
else: else:
libdir = os.popen(kde_config + ' --expandvars --install lib').read().strip() libdir = os.popen(kde_config + ' --expandvars --install lib').read().strip()
libtdeuiSO = libdir+'/'+getSOfromLA(libdir+'/libtdeui.la') libtdeuiSO = libdir+'/'+getSOfromLA(libdir+'/libtdeui.la')
@ -98,103 +98,103 @@ def detect_kde(env):
pass pass
if m: if m:
qtdir = m.group(1) qtdir = m.group(1)
print YELLOW+"qt was found as " + m.group(1) + NORMAL print(YELLOW+"qt was found as " + m.group(1) + NORMAL)
else: else:
print RED+"qt was not found"+NORMAL print(RED+"qt was not found"+NORMAL)
print RED+"Please set QTDIR first (/usr/lib/qt3?)"+NORMAL print(RED+"Please set QTDIR first (/usr/lib/qt3?)"+NORMAL)
env.Exit(1) env.Exit(1)
env['QTDIR'] = qtdir.strip() env['QTDIR'] = qtdir.strip()
## Find the necessary programs uic-tqt and moc ## Find the necessary programs uic-tqt and moc
print "Checking for uic-tqt : ", print("Checking for uic-tqt : ")
uic = qtdir + "/bin/uic-tqt" uic = qtdir + "/bin/uic-tqt"
if os.path.isfile(uic): if os.path.isfile(uic):
print GREEN+"uic-tqt was found as "+uic+NORMAL print(GREEN+"uic-tqt was found as "+uic+NORMAL)
else: else:
uic = os.popen("which uic-tqt 2>/dev/null").read().strip() uic = os.popen("which uic-tqt 2>/dev/null").read().strip()
if len(uic): if len(uic):
print YELLOW+"uic-tqt was found as "+uic+NORMAL print(YELLOW+"uic-tqt was found as "+uic+NORMAL)
else: else:
uic = os.popen("which uic-tqt 2>/dev/null").read().strip() uic = os.popen("which uic-tqt 2>/dev/null").read().strip()
if len(uic): if len(uic):
print YELLOW+"uic-tqt was found as "+uic+NORMAL print(YELLOW+"uic-tqt was found as "+uic+NORMAL)
else: else:
print RED+"uic-tqt was not found - set QTDIR put it in your PATH ?"+NORMAL print(RED+"uic-tqt was not found - set QTDIR put it in your PATH ?"+NORMAL)
env.Exit(1) env.Exit(1)
env['QT_UIC'] = uic env['QT_UIC'] = uic
print "Checking for moc : ", print("Checking for moc : ")
moc = qtdir + "/bin/moc" moc = qtdir + "/bin/moc"
if os.path.isfile(moc): if os.path.isfile(moc):
print GREEN+"moc was found as "+moc+NORMAL print(GREEN+"moc was found as "+moc+NORMAL)
else: else:
moc = os.popen("which moc 2>/dev/null").read().strip() moc = os.popen("which moc 2>/dev/null").read().strip()
if len(moc): if len(moc):
print YELLOW+"moc was found as "+moc+NORMAL print(YELLOW+"moc was found as "+moc+NORMAL)
elif os.path.isfile("/usr/share/tqt3/bin/moc"): elif os.path.isfile("/usr/share/tqt3/bin/moc"):
moc = "/usr/share/tqt3/bin/moc" moc = "/usr/share/tqt3/bin/moc"
print YELLOW+"moc was found as "+moc+NORMAL print(YELLOW+"moc was found as "+moc+NORMAL)
elif os.path.isfile("/usr/share/qt3/bin/moc"): elif os.path.isfile("/usr/share/qt3/bin/moc"):
moc = "/usr/share/qt3/bin/moc" moc = "/usr/share/qt3/bin/moc"
print YELLOW+"moc was found as "+moc+NORMAL print(YELLOW+"moc was found as "+moc+NORMAL)
else: else:
print RED+"moc was not found - set QTDIR or put it in your PATH ?"+NORMAL print(RED+"moc was not found - set QTDIR or put it in your PATH ?"+NORMAL)
env.Exit(1) env.Exit(1)
env['QT_MOC'] = moc env['QT_MOC'] = moc
## check for the tqt includes ## check for the tqt includes
print "Checking for the tqt includes : ", print("Checking for the tqt includes : ")
if tqtincludes and os.path.isfile(tqtincludes + "/tqlayout.h"): if tqtincludes and os.path.isfile(tqtincludes + "/tqlayout.h"):
# The user told where to look for and it looks valid # The user told where to look for and it looks valid
print GREEN + "ok " + tqtincludes + NORMAL print(GREEN + "ok " + tqtincludes + NORMAL)
else: else:
if os.path.isfile(qtdir + "/include/qlayout.h"): if os.path.isfile(qtdir + "/include/qlayout.h"):
# Automatic detection # Automatic detection
print GREEN + "ok " + qtdir + "/include/ " + NORMAL print(GREEN + "ok " + qtdir + "/include/ " + NORMAL)
tqtincludes = qtdir + "/include/" tqtincludes = qtdir + "/include/"
elif os.path.isfile("/usr/include/tqt/tqlayout.h"): elif os.path.isfile("/usr/include/tqt/tqlayout.h"):
# Debian probably # Debian probably
print YELLOW + "the qt headers were found in /usr/include/tqt/ " + NORMAL print(YELLOW + "the qt headers were found in /usr/include/tqt/ " + NORMAL)
tqtincludes = "/usr/include/tqt" tqtincludes = "/usr/include/tqt"
elif os.path.isfile("/usr/include/qt4/Qt/qglobal.h"): elif os.path.isfile("/usr/include/qt4/Qt/qglobal.h"):
# Debian probably # Debian probably
print YELLOW + "the qt headers were found in /usr/include/qt4/ " + NORMAL print(YELLOW + "the qt headers were found in /usr/include/qt4/ " + NORMAL)
tqtincludes = "/usr/include/qt4" tqtincludes = "/usr/include/qt4"
else: else:
print RED + "the qt headers were not found" + NORMAL print(RED + "the qt headers were not found" + NORMAL)
env.Exit(1) env.Exit(1)
## check for the qt includes ## check for the qt includes
print "Checking for the qt includes : ", print("Checking for the qt includes : ")
if qtincludes and os.path.isfile(qtincludes + "/ntqglobal.h"): if qtincludes and os.path.isfile(qtincludes + "/ntqglobal.h"):
# The user told where to look for and it looks valid # The user told where to look for and it looks valid
print GREEN + "ok " + qtincludes + NORMAL print(GREEN + "ok " + qtincludes + NORMAL)
else: else:
if os.path.isfile(qtdir + "/include/ntqglobal.h"): if os.path.isfile(qtdir + "/include/ntqglobal.h"):
# Automatic detection # Automatic detection
print GREEN + "ok " + qtdir + "/include/ " + NORMAL print(GREEN + "ok " + qtdir + "/include/ " + NORMAL)
qtincludes = qtdir + "/include/" qtincludes = qtdir + "/include/"
elif os.path.isfile("/usr/include/tqt3/ntqglobal.h"): elif os.path.isfile("/usr/include/tqt3/ntqglobal.h"):
# Debian probably # Debian probably
print YELLOW + "the qt headers were found in /usr/include/tqt3/ " + NORMAL print(YELLOW + "the qt headers were found in /usr/include/tqt3/ " + NORMAL)
qtincludes = "/usr/include/tqt3" qtincludes = "/usr/include/tqt3"
else: else:
print RED + "the qt headers were not found" + NORMAL print(RED + "the qt headers were not found" + NORMAL)
env.Exit(1) env.Exit(1)
print "Checking for the tde includes : ", print("Checking for the tde includes : ")
kdeprefix = os.popen(kde_config + " --prefix").read().strip() kdeprefix = os.popen(kde_config + " --prefix").read().strip()
if not kdeincludes: if not kdeincludes:
kdeincludes = kdeprefix+"/include/" kdeincludes = kdeprefix+"/include/"
if os.path.isfile(kdeincludes + "/klineedit.h"): if os.path.isfile(kdeincludes + "/klineedit.h"):
print GREEN+"ok "+kdeincludes+NORMAL print(GREEN+"ok "+kdeincludes+NORMAL)
else: else:
if os.path.isfile(kdeprefix+"/include/tde/klineedit.h"): if os.path.isfile(kdeprefix+"/include/tde/klineedit.h"):
# Debian, Fedora probably # Debian, Fedora probably
print YELLOW+"the kde headers were found in "+kdeprefix+"/include/tde/"+NORMAL print(YELLOW+"the kde headers were found in "+kdeprefix+"/include/tde/"+NORMAL)
kdeincludes = kdeprefix + "/include/tde/" kdeincludes = kdeprefix + "/include/tde/"
else: else:
print RED+"The kde includes were NOT found"+NORMAL print(RED+"The kde includes were NOT found"+NORMAL)
env.Exit(1) env.Exit(1)
if prefix: if prefix:
@ -583,10 +583,10 @@ ie: """+BOLD+"""scons configure libdir=/usr/local/lib qtincludes=/usr/include/qt
basedir=env['DESTDIR'] basedir=env['DESTDIR']
if len(restype)>0: if len(restype)>0:
if not lenv.has_key(restype): if not lenv.has_key(restype):
print RED+"unknown resource type "+restype+NORMAL print(RED+"unknown resource type "+restype+NORMAL)
else: else:
basedir += lenv[restype]+'/' basedir += lenv[restype]+'/'
#print file # <- useful to trace stuff :) #print(file) # <- useful to trace stuff :)
install_list = env.Install(basedir+subdir, files) install_list = env.Install(basedir+subdir, files)
env.Alias('install', install_list) env.Alias('install', install_list)
return install_list return install_list
@ -597,7 +597,7 @@ ie: """+BOLD+"""scons configure libdir=/usr/local/lib qtincludes=/usr/include/qt
basedir=env['DESTDIR'] basedir=env['DESTDIR']
if len(restype)>0: if len(restype)>0:
if not lenv.has_key(restype): if not lenv.has_key(restype):
print RED+"unknown resource type "+restype+NORMAL print(RED+"unknown resource type "+restype+NORMAL)
else: else:
basedir += lenv[restype]+'/' basedir += lenv[restype]+'/'
install_list = env.InstallAs(basedir+destfile, file) install_list = env.InstallAs(basedir+destfile, file)
@ -705,13 +705,13 @@ ie: """+BOLD+"""scons configure libdir=/usr/local/lib qtincludes=/usr/include/qt
for iconfile in iconfiles: for iconfile in iconfiles:
tmp = iconfile.split('-') tmp = iconfile.split('-')
if len(tmp) != 3: if len(tmp) != 3:
print RED + 'WARNING: icon filename has unknown format: ' + iconfile + NORMAL print(RED + 'WARNING: icon filename has unknown format: ' + iconfile + NORMAL)
continue continue
[icon_dir, icon_type, icon_filename] = tmp [icon_dir, icon_type, icon_filename] = tmp
try: try:
destfile = '%s/%s/%s/%s' % (lenv['KDEICONS'], dir_dic[icon_dir], type_dic[icon_type], icon_filename) destfile = '%s/%s/%s/%s' % (lenv['KDEICONS'], dir_dic[icon_dir], type_dic[icon_type], icon_filename)
except KeyError: except KeyError:
print RED + 'WARNING: unknown icon type: ' + iconfile + NORMAL print(RED + 'WARNING: unknown icon type: ' + iconfile + NORMAL)
continue continue
## do not use KDEinstallas here, as parsing from an ide will be necessary ## do not use KDEinstallas here, as parsing from an ide will be necessary
if 'install' in env['TARGS']: if 'install' in env['TARGS']:

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

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

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

Loading…
Cancel
Save