From a9b1841cb02aa39610031a9970bc0f9438415e68 Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Mon, 11 Jun 2012 17:08:59 -0500 Subject: Fix kstreamripper build failures --- kde.py | 46 +++++++++++++++++++++++++++++++++------------- 1 file changed, 33 insertions(+), 13 deletions(-) (limited to 'kde.py') diff --git a/kde.py b/kde.py index f25cd5f..a3ceda1 100644 --- a/kde.py +++ b/kde.py @@ -37,6 +37,7 @@ def detect_kde(env): kdeincludes = env['ARGS'].get('kdeincludes', None) tdelibs = env['ARGS'].get('tdelibs', None) qtincludes = env['ARGS'].get('qtincludes', None) + tqtincludes = env['ARGS'].get('tqtincludes', None) qtlibs = env['ARGS'].get('qtlibs', None) tdedir = env['ARGS'].get('tdedir', None) @@ -49,10 +50,10 @@ def detect_kde(env): 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 + 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 - else: print RED + 'tde-config was NOT found in your PATH' + 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) @@ -142,24 +143,42 @@ def detect_kde(env): env.Exit(1) env['QT_MOC'] = moc - ## check for the qt and kde includes - print "Checking for the qt includes : ", - if qtincludes and os.path.isfile(qtincludes + "/tqlayout.h"): + ## check 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 " + qtincludes + NORMAL + print GREEN + "ok " + tqtincludes + NORMAL else: if os.path.isfile(qtdir + "/include/qlayout.h"): # Automatic detection print GREEN + "ok " + qtdir + "/include/ " + NORMAL - qtincludes = qtdir + "/include/" + 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 - qtincludes = "/usr/include/tqt" + 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 - qtincludes = "/usr/include/qt4" + tqtincludes = "/usr/include/qt4" + else: + print RED + "the qt headers were not found" + NORMAL + env.Exit(1) + + ## check 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 + else: + if os.path.isfile(qtdir + "/include/ntqglobal.h"): + # Automatic detection + 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 + qtincludes = "/usr/include/tqt3" else: print RED + "the qt headers were not found" + NORMAL env.Exit(1) @@ -230,6 +249,7 @@ def detect_kde(env): ## qt libs and includes env['QTINCLUDEPATH']=qtincludes + env['TQTINCLUDEPATH']=tqtincludes if not qtlibs: qtlibs=qtdir+"/lib" env['QTLIBPATH']=qtlibs @@ -435,7 +455,7 @@ ie: """+BOLD+"""scons configure libdir=/usr/local/lib qtincludes=/usr/include/qt opts.Save(cachefile, env) ## set default variables, one can override them in sconscript files - env.Append(CXXFLAGS = ['-I'+env['KDEINCLUDEPATH'], '-I'+env['QTINCLUDEPATH'] ]) + env.Append(CXXFLAGS = ['-I'+env['KDEINCLUDEPATH'], '-I'+env['QTINCLUDEPATH'], '-I'+env['TQTINCLUDEPATH'], '-include', 'tqt.h' ]) env.Append(LIBPATH = [env['KDELIBPATH'], env['QTLIBPATH'] ]) env['STATIC_AND_SHARED_OBJECTS_ARE_THE_SAME'] = 1 @@ -468,7 +488,7 @@ ie: """+BOLD+"""scons configure libdir=/usr/local/lib qtincludes=/usr/include/qt act.append('cat '+target[1].path+'.tmp >> '+target[1].path) act.append('rm -f '+target[1].path+'.tmp') act.append('echo \'#include "' + target[2].name + '"\' >> '+target[1].path) - act.append('moc-tqt $QT_MOC -o '+target[2].path+' '+target[0].path) + act.append('moc-tqt $QT_MOC '+target[0].path+' '+target[2].path) return act def uicEmitter(target, source, env): @@ -495,7 +515,7 @@ ie: """+BOLD+"""scons configure libdir=/usr/local/lib qtincludes=/usr/include/qt src_suffix = '.ui') ## moc file processing - env['QT_MOCCOM'] = ('$QT_MOC -o ${TARGETS[0]} $SOURCE') + env['QT_MOCCOM'] = ('moc-tqt $QT_MOC $SOURCE ${TARGETS[0]}') MOC_BUILDER = Builder( action = '$QT_MOCCOM', -- cgit v1.2.3