Browse Source

Fix FTBFS with SCons 3.x

Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
master
Slávek Banko 2 years ago
parent
commit
ef18cc16fa
6 changed files with 56 additions and 56 deletions
  1. 1
    1
      SConstruct
  2. 4
    4
      admin/generic.py
  3. 47
    47
      admin/kde.py
  4. 2
    2
      doc/SConscript
  5. 1
    1
      po/SConscript
  6. 1
    1
      src/SConscript

+ 1
- 1
SConstruct View File

@@ -222,7 +222,7 @@ if 'dist' in COMMAND_LINE_TARGETS:
os.popen("rm -f "+FOLDER+"/config.py*")

## make the tarball
print GREEN+"Writing archive "+ARCHIVE+NORMAL
print(GREEN+"Writing archive "+ARCHIVE+NORMAL)
os.popen("tar cjf "+ARCHIVE+" "+FOLDER)

## remove the temporary directory

+ 4
- 4
admin/generic.py View File

@@ -53,7 +53,7 @@ ie: """+BOLD+"""scons configure debug=full prefix=/usr/local extraincludes=/tmp/
env['DESTDIR']=''
if 'install' in env['TARGS'] and os.environ.has_key('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
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):
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"):
env['KDECXXFLAGS'] = ['-DDEBUG', '-g3']
else:
@@ -128,14 +128,14 @@ ie: """+BOLD+"""scons configure debug=full prefix=/usr/local extraincludes=/tmp/
# User-specified prefix
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
print(CYAN+'** set the installation prefix for the project : ' + env['PREFIX'] +' **'+ NORMAL)
elif env.has_key('PREFIX'):
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
print(CYAN+'** set extra include paths for the project : ' + env['EXTRAINCLUDES'] +' **'+ NORMAL)
elif env.has_key('EXTRAINCLUDES'):
env.__delitem__('EXTRAINCLUDES')


+ 47
- 47
admin/kde.py View File

@@ -44,22 +44,22 @@ def detect_kde(env):
tdedir = env['ARGS'].get('tdedir', None)

## Detect the tde libraries
print "Checking for tde-config : ",
print("Checking for tde-config : ")
str="which tde-config 2>/dev/null"
if tdedir: str="which %s 2>/dev/null" % (tdedir+'/bin/tde-config')
kde_config = os.popen(str).read().strip()
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:
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
print "Make sure kde is installed properly"
print "(missing package tdebase-devel?)"
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)
print("Make sure kde is installed properly")
print("(missing package tdebase-devel?)")
env.Exit(1)
if tdedir: env['TDEDIR']=tdedir
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_major = tde_version.split('.')[0].lstrip('R')
tde_minor = tde_version.split('.')[1]
@@ -77,17 +77,17 @@ def detect_kde(env):
except:
pass
if int(tde_major) != 14:
print RED + tde_version
print RED + "Your tde version might be too old" + NORMAL
print RED + "Please make sure TDE is at least R14.0" + NORMAL
print(RED + tde_version)
print(RED + "Your tde version might be too old" + NORMAL)
print(RED + "Please make sure TDE is at least R14.0" + NORMAL)
else:
print GREEN + tde_version + NORMAL
print(GREEN + tde_version + NORMAL)

## Detect the qt library
print "Checking for the qt library : ",
print("Checking for the qt library : ")
qtdir = os.getenv("QTDIR")
if qtdir:
print GREEN + "qt is in " + qtdir + NORMAL
print(GREEN + "qt is in " + qtdir + NORMAL)
else:
libdir = os.popen(kde_config + ' --expandvars --install lib').read().strip()
libtdeuiSO = libdir+'/'+getSOfromLA(libdir+'/libtdeui.la')
@@ -98,103 +98,103 @@ def detect_kde(env):
pass
if m:
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:
print RED+"qt was not found"+NORMAL
print RED+"Please set QTDIR first (/usr/lib/qt3?)"+NORMAL
print(RED+"qt was not found"+NORMAL)
print(RED+"Please set QTDIR first (/usr/lib/qt3?)"+NORMAL)
env.Exit(1)
env['QTDIR'] = qtdir.strip()

## Find the necessary programs uic-tqt and moc
print "Checking for uic-tqt : ",
print("Checking for uic-tqt : ")
uic = qtdir + "/bin/uic-tqt"
if os.path.isfile(uic):
print GREEN+"uic-tqt was found as "+uic+NORMAL
print(GREEN+"uic-tqt was found as "+uic+NORMAL)
else:
uic = os.popen("which uic-tqt 2>/dev/null").read().strip()
if len(uic):
print YELLOW+"uic-tqt was found as "+uic+NORMAL
print(YELLOW+"uic-tqt was found as "+uic+NORMAL)
else:
uic = os.popen("which uic-tqt 2>/dev/null").read().strip()
if len(uic):
print YELLOW+"uic-tqt was found as "+uic+NORMAL
print(YELLOW+"uic-tqt was found as "+uic+NORMAL)
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['QT_UIC'] = uic

print "Checking for moc : ",
print("Checking for moc : ")
moc = qtdir + "/bin/moc"
if os.path.isfile(moc):
print GREEN+"moc was found as "+moc+NORMAL
print(GREEN+"moc was found as "+moc+NORMAL)
else:
moc = os.popen("which moc 2>/dev/null").read().strip()
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"):
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"):
moc = "/usr/share/qt3/bin/moc"
print YELLOW+"moc was found as "+moc+NORMAL
print(YELLOW+"moc was found as "+moc+NORMAL)
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['QT_MOC'] = moc

## 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"):
# The user told where to look for and it looks valid
print GREEN + "ok " + tqtincludes + NORMAL
print(GREEN + "ok " + tqtincludes + NORMAL)
else:
if os.path.isfile(qtdir + "/include/qlayout.h"):
# Automatic detection
print GREEN + "ok " + qtdir + "/include/ " + NORMAL
print(GREEN + "ok " + qtdir + "/include/ " + NORMAL)
tqtincludes = qtdir + "/include/"
elif os.path.isfile("/usr/include/tqt/tqlayout.h"):
# 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"
elif os.path.isfile("/usr/include/qt4/Qt/qglobal.h"):
# 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"
else:
print RED + "the qt headers were not found" + NORMAL
print(RED + "the qt headers were not found" + NORMAL)
env.Exit(1)
## 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"):
# The user told where to look for and it looks valid
print GREEN + "ok " + qtincludes + NORMAL
print(GREEN + "ok " + qtincludes + NORMAL)
else:
if os.path.isfile(qtdir + "/include/ntqglobal.h"):
# Automatic detection
print GREEN + "ok " + qtdir + "/include/ " + NORMAL
print(GREEN + "ok " + qtdir + "/include/ " + NORMAL)
qtincludes = qtdir + "/include/"
elif os.path.isfile("/usr/include/tqt3/ntqglobal.h"):
# 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"
else:
print RED + "the qt headers were not found" + NORMAL
print(RED + "the qt headers were not found" + NORMAL)
env.Exit(1)

print "Checking for the tde includes : ",
print("Checking for the tde includes : ")
kdeprefix = os.popen(kde_config + " --prefix").read().strip()
if not kdeincludes:
kdeincludes = kdeprefix+"/include/"
if os.path.isfile(kdeincludes + "/klineedit.h"):
print GREEN+"ok "+kdeincludes+NORMAL
print(GREEN+"ok "+kdeincludes+NORMAL)
else:
if os.path.isfile(kdeprefix+"/include/tde/klineedit.h"):
# 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/"
else:
print RED+"The kde includes were NOT found"+NORMAL
print(RED+"The kde includes were NOT found"+NORMAL)
env.Exit(1)

if prefix:
@@ -583,10 +583,10 @@ ie: """+BOLD+"""scons configure libdir=/usr/local/lib qtincludes=/usr/include/qt
basedir=env['DESTDIR']
if len(restype)>0:
if not lenv.has_key(restype):
print RED+"unknown resource type "+restype+NORMAL
print(RED+"unknown resource type "+restype+NORMAL)
else:
basedir += lenv[restype]+'/'
#print file # <- useful to trace stuff :)
#print(file) # <- useful to trace stuff :)
install_list = env.Install(basedir+subdir, files)
env.Alias('install', install_list)
return install_list
@@ -597,7 +597,7 @@ ie: """+BOLD+"""scons configure libdir=/usr/local/lib qtincludes=/usr/include/qt
basedir=env['DESTDIR']
if len(restype)>0:
if not lenv.has_key(restype):
print RED+"unknown resource type "+restype+NORMAL
print(RED+"unknown resource type "+restype+NORMAL)
else:
basedir += lenv[restype]+'/'
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:
tmp = iconfile.split('-')
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
[icon_dir, icon_type, icon_filename] = tmp
try:
destfile = '%s/%s/%s/%s' % (lenv['KDEICONS'], dir_dic[icon_dir], type_dic[icon_type], icon_filename)
except KeyError:
print RED + 'WARNING: unknown icon type: ' + iconfile + NORMAL
print(RED + 'WARNING: unknown icon type: ' + iconfile + NORMAL)
continue
## do not use KDEinstallas here, as parsing from an ide will be necessary
if 'install' in env['TARGS']:

+ 2
- 2
doc/SConscript View File

@@ -8,7 +8,7 @@

## First load the environment set in the top-level SConstruct file
Import( 'env' )
myenv=env.Copy()
myenv=env.Clone()

## The following looks complicated but it is not
## 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:
return
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
if i_am_a_documentation_writer:
for file in docbook_list:

+ 1
- 1
po/SConscript View File

@@ -10,7 +10,7 @@
## First load the environment set in the top-level SConstruct file
#Import( "env KDElang" )
Import('env')
myenv=env.Copy()
myenv=env.Clone()

## Make translations for the program "test1" in french (requires fr.po)
myenv['APPNAME'] = "kstreamripper"

+ 1
- 1
src/SConscript View File

@@ -14,7 +14,7 @@
## SConstruct file (set with 'Export') - this is very important

Import( 'env' )
myenv=env.Copy()
myenv=env.Clone()

#############################
## the programs to build

Loading…
Cancel
Save