|
|
@ -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']:
|
|
|
|