|
|
|
@ -36,10 +36,10 @@ The variables used when configuring are :
|
|
|
|
|
|
|
|
|
|
* libsuffix : for those who need /usr/lib64 and the like ..
|
|
|
|
|
|
|
|
|
|
* kdeincludes: path to the kde includes (/usr/include/kde on debian, ...)
|
|
|
|
|
* kdeincludes: path to the kde includes (/usr/include/tde on debian, ...)
|
|
|
|
|
* qtincludes : same punishment, for qt includes (/usr/include/qt on debian, ...)
|
|
|
|
|
|
|
|
|
|
* kdelibs : path to the kde libs, for linking the programs
|
|
|
|
|
* tdelibs : path to the kde libs, for linking the programs
|
|
|
|
|
* qtlibs : same punishment, for qt libraries
|
|
|
|
|
|
|
|
|
|
eg: scons configure libdir=/usr/local/lib qtincludes=/usr/include/qt
|
|
|
|
@ -56,7 +56,7 @@ def exists(env):
|
|
|
|
|
return True
|
|
|
|
|
|
|
|
|
|
def detect_kde(env):
|
|
|
|
|
""" Detect the qt and kde environment using kde-config mostly """
|
|
|
|
|
""" Detect the qt and kde environment using tde-config mostly """
|
|
|
|
|
import os, sys, re
|
|
|
|
|
|
|
|
|
|
prefix = env['ARGS'].get('prefix', None)
|
|
|
|
@ -65,7 +65,7 @@ def detect_kde(env):
|
|
|
|
|
libdir = env['ARGS'].get('libdir', None)
|
|
|
|
|
libsuffix = env['ARGS'].get('libsuffix', '')
|
|
|
|
|
kdeincludes = env['ARGS'].get('kdeincludes', None)
|
|
|
|
|
kdelibs = env['ARGS'].get('kdelibs', None)
|
|
|
|
|
tdelibs = env['ARGS'].get('tdelibs', None)
|
|
|
|
|
qtincludes = env['ARGS'].get('qtincludes', None)
|
|
|
|
|
qtlibs = env['ARGS'].get('qtlibs', None)
|
|
|
|
|
|
|
|
|
@ -73,20 +73,20 @@ def detect_kde(env):
|
|
|
|
|
libdir = libdir+libsuffix
|
|
|
|
|
|
|
|
|
|
## Detect the kde libraries
|
|
|
|
|
print "Checking for kde-config : ",
|
|
|
|
|
kde_config = os.popen("which kde-config 2>/dev/null").read().strip()
|
|
|
|
|
print "Checking for tde-config : ",
|
|
|
|
|
kde_config = os.popen("which tde-config 2>/dev/null").read().strip()
|
|
|
|
|
if len(kde_config):
|
|
|
|
|
print GREEN + "kde-config was found" + NORMAL
|
|
|
|
|
print GREEN + "tde-config was found" + NORMAL
|
|
|
|
|
else:
|
|
|
|
|
print RED + "kde-config was NOT found in your PATH"+ NORMAL
|
|
|
|
|
print RED + "tde-config was NOT found in your PATH"+ NORMAL
|
|
|
|
|
print "Make sure kde is installed properly"
|
|
|
|
|
print "(missing package kdebase-devel?)"
|
|
|
|
|
# TODO : prompt the user for the path of kde-config ?
|
|
|
|
|
print "(missing package tdebase-devel?)"
|
|
|
|
|
# TODO : prompt the user for the path of tde-config ?
|
|
|
|
|
sys.exit(1)
|
|
|
|
|
env['KDEDIR'] = os.popen('kde-config -prefix').read().strip()
|
|
|
|
|
env['TDEDIR'] = os.popen('tde-config -prefix').read().strip()
|
|
|
|
|
|
|
|
|
|
print "Checking for kde version : ",
|
|
|
|
|
kde_version = os.popen("kde-config --version|grep KDE").read().strip().split()[1]
|
|
|
|
|
kde_version = os.popen("tde-config --version|grep KDE").read().strip().split()[1]
|
|
|
|
|
if int(kde_version[0]) != 3 or int(kde_version[2]) < 2:
|
|
|
|
|
print RED + kde_version
|
|
|
|
|
print RED + "Your kde version can be too old" + NORMAL
|
|
|
|
@ -100,7 +100,7 @@ def detect_kde(env):
|
|
|
|
|
if qtdir:
|
|
|
|
|
print GREEN + "qt is in " + qtdir + NORMAL
|
|
|
|
|
else:
|
|
|
|
|
m = re.search('(.*)/lib/libqt.*', os.popen('ldd `kde-config --expandvars --install lib`' + '/libkdeui.so.4 | grep libqt').read().strip().split()[2])
|
|
|
|
|
m = re.search('(.*)/lib/libqt.*', os.popen('ldd `tde-config --expandvars --install lib`' + '/libtdeui.so.4 | grep libqt').read().strip().split()[2])
|
|
|
|
|
if m:
|
|
|
|
|
qtdir = m.group(1)
|
|
|
|
|
print YELLOW + "qt was found as " + m.group(1) + NORMAL
|
|
|
|
@ -163,16 +163,16 @@ def detect_kde(env):
|
|
|
|
|
sys.exit(1)
|
|
|
|
|
|
|
|
|
|
print "Checking for the kde includes : ",
|
|
|
|
|
kdeprefix = os.popen("kde-config --prefix").read().strip()
|
|
|
|
|
kdeprefix = os.popen("tde-config --prefix").read().strip()
|
|
|
|
|
if not kdeincludes:
|
|
|
|
|
kdeincludes = kdeprefix+"/include/"
|
|
|
|
|
if os.path.isfile(kdeincludes + "/klineedit.h"):
|
|
|
|
|
print GREEN + "ok " + kdeincludes + NORMAL
|
|
|
|
|
else:
|
|
|
|
|
if os.path.isfile(kdeprefix+"/include/kde/klineedit.h"):
|
|
|
|
|
if os.path.isfile(kdeprefix+"/include/tde/klineedit.h"):
|
|
|
|
|
# Debian, Fedora probably
|
|
|
|
|
print YELLOW + "the kde headers were found in " + kdeprefix + "/include/kde/" + NORMAL
|
|
|
|
|
kdeincludes = kdeprefix + "/include/kde/"
|
|
|
|
|
print YELLOW + "the kde headers were found in " + kdeprefix + "/include/tde/" + NORMAL
|
|
|
|
|
kdeincludes = kdeprefix + "/include/tde/"
|
|
|
|
|
else:
|
|
|
|
|
print RED + "The kde includes were NOT found" + NORMAL
|
|
|
|
|
sys.exit(1)
|
|
|
|
@ -189,42 +189,42 @@ def detect_kde(env):
|
|
|
|
|
subst_vars = lambda x: x.replace('${exec_prefix}', execprefix).replace('${datadir}',
|
|
|
|
|
datadir).replace('${libdir}', libdir)
|
|
|
|
|
debian_fix = lambda x: x.replace('/usr/share', '${datadir}')
|
|
|
|
|
env['KDEBIN'] = subst_vars(os.popen('kde-config --install exe').read().strip())
|
|
|
|
|
env['KDEAPPS'] = subst_vars(os.popen('kde-config --install apps').read().strip())
|
|
|
|
|
env['KDEDATA'] = subst_vars(os.popen('kde-config --install data').read().strip())
|
|
|
|
|
env['KDEMODULE']= subst_vars(os.popen('kde-config --install module').read().strip())
|
|
|
|
|
env['KDELOCALE']= subst_vars(os.popen('kde-config --install locale').read().strip())
|
|
|
|
|
env['KDEDOC'] = subst_vars( debian_fix(os.popen('kde-config --install html').read().strip()) )
|
|
|
|
|
env['KDEKCFG'] = subst_vars(os.popen('kde-config --install kcfg').read().strip())
|
|
|
|
|
env['KDEXDG'] = subst_vars(os.popen('kde-config --install xdgdata-apps').read().strip())
|
|
|
|
|
env['KDEMENU'] = subst_vars(os.popen('kde-config --install apps').read().strip())
|
|
|
|
|
env['KDEMIME'] = subst_vars(os.popen('kde-config --install mime').read().strip())
|
|
|
|
|
env['KDEICONS'] = subst_vars(os.popen('kde-config --install icon').read().strip())
|
|
|
|
|
env['KDESERV'] = subst_vars(os.popen('kde-config --install services').read().strip())
|
|
|
|
|
env['KDEBIN'] = subst_vars(os.popen('tde-config --install exe').read().strip())
|
|
|
|
|
env['KDEAPPS'] = subst_vars(os.popen('tde-config --install apps').read().strip())
|
|
|
|
|
env['KDEDATA'] = subst_vars(os.popen('tde-config --install data').read().strip())
|
|
|
|
|
env['KDEMODULE']= subst_vars(os.popen('tde-config --install module').read().strip())
|
|
|
|
|
env['KDELOCALE']= subst_vars(os.popen('tde-config --install locale').read().strip())
|
|
|
|
|
env['KDEDOC'] = subst_vars( debian_fix(os.popen('tde-config --install html').read().strip()) )
|
|
|
|
|
env['KDEKCFG'] = subst_vars(os.popen('tde-config --install kcfg').read().strip())
|
|
|
|
|
env['KDEXDG'] = subst_vars(os.popen('tde-config --install xdgdata-apps').read().strip())
|
|
|
|
|
env['KDEMENU'] = subst_vars(os.popen('tde-config --install apps').read().strip())
|
|
|
|
|
env['KDEMIME'] = subst_vars(os.popen('tde-config --install mime').read().strip())
|
|
|
|
|
env['KDEICONS'] = subst_vars(os.popen('tde-config --install icon').read().strip())
|
|
|
|
|
env['KDESERV'] = subst_vars(os.popen('tde-config --install services').read().strip())
|
|
|
|
|
else:
|
|
|
|
|
# the user has given no prefix, install as a normal kde app
|
|
|
|
|
env['PREFIX'] = os.popen('kde-config --prefix').read().strip()
|
|
|
|
|
|
|
|
|
|
env['KDEBIN'] = os.popen('kde-config --expandvars --install exe').read().strip()
|
|
|
|
|
env['KDEAPPS'] = os.popen('kde-config --expandvars --install apps').read().strip()
|
|
|
|
|
env['KDEDATA'] = os.popen('kde-config --expandvars --install data').read().strip()
|
|
|
|
|
env['KDEMODULE']= os.popen('kde-config --expandvars --install module').read().strip()
|
|
|
|
|
env['KDELOCALE']= os.popen('kde-config --expandvars --install locale').read().strip()
|
|
|
|
|
env['KDEDOC'] = os.popen('kde-config --expandvars --install html').read().strip()
|
|
|
|
|
env['KDEKCFG'] = os.popen('kde-config --expandvars --install kcfg').read().strip()
|
|
|
|
|
env['KDEXDG'] = os.popen('kde-config --expandvars --install xdgdata-apps').read().strip()
|
|
|
|
|
env['KDEMENU'] = os.popen('kde-config --expandvars --install apps').read().strip()
|
|
|
|
|
env['KDEMIME'] = os.popen('kde-config --expandvars --install mime').read().strip()
|
|
|
|
|
env['KDEICONS'] = os.popen('kde-config --expandvars --install icon').read().strip()
|
|
|
|
|
env['KDESERV'] = os.popen('kde-config --expandvars --install services').read().strip()
|
|
|
|
|
|
|
|
|
|
env['QTPLUGINS']=os.popen('kde-config --expandvars --install qtplugins').read().strip()
|
|
|
|
|
env['PREFIX'] = os.popen('tde-config --prefix').read().strip()
|
|
|
|
|
|
|
|
|
|
env['KDEBIN'] = os.popen('tde-config --expandvars --install exe').read().strip()
|
|
|
|
|
env['KDEAPPS'] = os.popen('tde-config --expandvars --install apps').read().strip()
|
|
|
|
|
env['KDEDATA'] = os.popen('tde-config --expandvars --install data').read().strip()
|
|
|
|
|
env['KDEMODULE']= os.popen('tde-config --expandvars --install module').read().strip()
|
|
|
|
|
env['KDELOCALE']= os.popen('tde-config --expandvars --install locale').read().strip()
|
|
|
|
|
env['KDEDOC'] = os.popen('tde-config --expandvars --install html').read().strip()
|
|
|
|
|
env['KDEKCFG'] = os.popen('tde-config --expandvars --install kcfg').read().strip()
|
|
|
|
|
env['KDEXDG'] = os.popen('tde-config --expandvars --install xdgdata-apps').read().strip()
|
|
|
|
|
env['KDEMENU'] = os.popen('tde-config --expandvars --install apps').read().strip()
|
|
|
|
|
env['KDEMIME'] = os.popen('tde-config --expandvars --install mime').read().strip()
|
|
|
|
|
env['KDEICONS'] = os.popen('tde-config --expandvars --install icon').read().strip()
|
|
|
|
|
env['KDESERV'] = os.popen('tde-config --expandvars --install services').read().strip()
|
|
|
|
|
|
|
|
|
|
env['QTPLUGINS']=os.popen('tde-config --expandvars --install qtplugins').read().strip()
|
|
|
|
|
|
|
|
|
|
## kde libs and includes
|
|
|
|
|
env['KDEINCLUDEPATH']= kdeincludes
|
|
|
|
|
if not kdelibs:
|
|
|
|
|
kdelibs = os.popen('kde-config --expandvars --install lib').read().strip()
|
|
|
|
|
env['KDELIBPATH']= kdelibs
|
|
|
|
|
if not tdelibs:
|
|
|
|
|
tdelibs = os.popen('tde-config --expandvars --install lib').read().strip()
|
|
|
|
|
env['KDELIBPATH']= tdelibs
|
|
|
|
|
|
|
|
|
|
## qt libs and includes
|
|
|
|
|
env['QTINCLUDEPATH']= qtincludes
|
|
|
|
@ -246,9 +246,9 @@ def generate(env):
|
|
|
|
|
"""+BOLD+"""* datadir """+NORMAL+""": install path for the data, ie: /usr/local/share
|
|
|
|
|
"""+BOLD+"""* libdir """+NORMAL+""": install path for the libs, ie: /usr/lib
|
|
|
|
|
"""+BOLD+"""* libsuffix """+NORMAL+""": suffix of libraries on amd64, ie: 64, 32
|
|
|
|
|
"""+BOLD+"""* kdeincludes"""+NORMAL+""": path to the kde includes (/usr/include/kde on debian, ...)
|
|
|
|
|
"""+BOLD+"""* kdeincludes"""+NORMAL+""": path to the kde includes (/usr/include/tde on debian, ...)
|
|
|
|
|
"""+BOLD+"""* qtincludes """+NORMAL+""": same punishment, for qt includes (/usr/include/qt on debian, ...)
|
|
|
|
|
"""+BOLD+"""* kdelibs """+NORMAL+""": path to the kde libs, for linking the programs
|
|
|
|
|
"""+BOLD+"""* tdelibs """+NORMAL+""": path to the kde libs, for linking the programs
|
|
|
|
|
"""+BOLD+"""* qtlibs """+NORMAL+""": same punishment, for qt libraries
|
|
|
|
|
ie: """+BOLD+"""scons configure libdir=/usr/local/lib qtincludes=/usr/include/qt
|
|
|
|
|
"""+NORMAL)
|
|
|
|
@ -409,7 +409,7 @@ ie: """+BOLD+"""scons configure libdir=/usr/local/lib qtincludes=/usr/include/qt
|
|
|
|
|
( 'QT_UIC', 'moc directory'),
|
|
|
|
|
( 'QT_MOC', 'moc executable command'),
|
|
|
|
|
( 'QTPLUGINS', 'uic executable command'),
|
|
|
|
|
( 'KDEDIR', 'root of kde directory' ),
|
|
|
|
|
( 'TDEDIR', 'root of kde directory' ),
|
|
|
|
|
( 'KDELIBPATH', 'path to the kde libs' ),
|
|
|
|
|
( 'KDEINCLUDEPATH', 'path to the kde includes' ),
|
|
|
|
|
|
|
|
|
@ -431,7 +431,7 @@ ie: """+BOLD+"""scons configure libdir=/usr/local/lib qtincludes=/usr/include/qt
|
|
|
|
|
opts.Update(env)
|
|
|
|
|
|
|
|
|
|
# reconfigure when things are missing
|
|
|
|
|
if 'configure' in env['TARGS'] or not env.has_key('QTDIR') or not env.has_key('KDEDIR'):
|
|
|
|
|
if 'configure' in env['TARGS'] or not env.has_key('QTDIR') or not env.has_key('TDEDIR'):
|
|
|
|
|
detect_kde(env)
|
|
|
|
|
|
|
|
|
|
# finally save the configuration
|
|
|
|
@ -469,7 +469,7 @@ ie: """+BOLD+"""scons configure libdir=/usr/local/lib qtincludes=/usr/include/qt
|
|
|
|
|
act=[]
|
|
|
|
|
act.append('$QT_UIC $QT_UIC_HFLAGS -o '+target[0].path+' '+source[0].path)
|
|
|
|
|
act.append('rm -f ' +target[1].path)
|
|
|
|
|
act.append('echo \'#include <klocale.h>\' >> '+target[1].path)
|
|
|
|
|
act.append('echo \'#include <tdelocale.h>\' >> '+target[1].path)
|
|
|
|
|
act.append('echo \'#include <kdialog.h>\' >> '+target[1].path)
|
|
|
|
|
act.append('$QT_UIC $QT_UIC_CFLAGS -impl '+target[0].path+' -o '+target[1].path+'.tmp '+source[0].path)
|
|
|
|
|
act.append('cat '+target[1].path+'.tmp >> '+target[1].path)
|
|
|
|
@ -517,7 +517,7 @@ ie: """+BOLD+"""scons configure libdir=/usr/local/lib qtincludes=/usr/include/qt
|
|
|
|
|
###### kcfg file processing
|
|
|
|
|
def kcfgGenerator(target, source, env, for_signature):
|
|
|
|
|
act=[]
|
|
|
|
|
act.append('kconfig_compiler -d'+str(source[0].get_dir())+' '+source[1].path+' '+source[0].path)
|
|
|
|
|
act.append('tdeconfig_compiler -d'+str(source[0].get_dir())+' '+source[1].path+' '+source[0].path)
|
|
|
|
|
return act
|
|
|
|
|
|
|
|
|
|
def kcfgEmitter(target, source, env):
|
|
|
|
@ -687,7 +687,7 @@ ie: """+BOLD+"""scons configure libdir=/usr/local/lib qtincludes=/usr/include/qt
|
|
|
|
|
for ofile in other_files:
|
|
|
|
|
if ofile == file:
|
|
|
|
|
print RED+"WARNING: You have included "+file+".kcfg and another file of the same prefix"+NORMAL
|
|
|
|
|
print "Files generated by kconfig_compiler (settings.h, settings.cpp) must not be included"
|
|
|
|
|
print "Files generated by tdeconfig_compiler (settings.h, settings.cpp) must not be included"
|
|
|
|
|
#for file in skel_files:
|
|
|
|
|
# for ofile in other_files:
|
|
|
|
|
# if ofile == file:
|
|
|
|
|