From 77909a22a264f171b2f30e5c180c8bf10a63079d Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Mon, 11 Jun 2012 17:08:59 -0500 Subject: [PATCH] Fix kstreamripper build failures (part of the original commit) (cherry picked from commit a9b1841cb02aa39610031a9970bc0f9438415e68) --- admin/kde.py | 56 +++++++++++++++++++++++++++++++++++----------------- kde.py | 48 +++++++++++++++++++++++++++++++------------- 2 files changed, 72 insertions(+), 32 deletions(-) diff --git a/admin/kde.py b/admin/kde.py index b322aff..25c61eb 100644 --- a/admin/kde.py +++ b/admin/kde.py @@ -39,6 +39,7 @@ def detect_kde(env): kdeincludes= env['ARGS'].get('kdeincludes', None) kdelibs = env['ARGS'].get('kdelibs', None) qtincludes = env['ARGS'].get('qtincludes', None) + tqtincludes= env['ARGS'].get('tqtincludes', None) qtlibs = env['ARGS'].get('qtlibs', None) kdedir = env['ARGS'].get('kdedir', None) @@ -48,10 +49,10 @@ def detect_kde(env): if kdedir: str="which %s 2>/dev/null" % (kdedir+'/bin/kde-config') kde_config = os.popen(str).read().strip() if len(kde_config): - print GREEN + 'kde-config was found as ' + kde_config + print GREEN + 'kde-config was found as ' + kde_config + NORMAL else: - if kdedir: print RED + 'kde-config was NOT found in the folder given ' + kdedir - else: print RED + 'kde-config was NOT found in your PATH' + if kdedir: print RED + 'kde-config was NOT found in the folder given ' + kdedir + NORMAL + else: print RED + 'kde-config was NOT found in your PATH' + NORMAL print "Make sure kde is installed properly" print "(missing package kdebase-devel?)" env.Exit(1) @@ -138,26 +139,44 @@ 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"): + if os.path.isfile(qtdir + "/include/tqlayout.h"): # Automatic detection - print GREEN+"ok "+qtdir + "/include/ "+NORMAL - qtincludes = qtdir + "/include/" + 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 - qtincludes = "/usr/include/tqt" + 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 - qtincludes = "/usr/include/qt4" + 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 + env.Exit(1) + + ## check for the qt includes + print "Checking for the qt includes : ", + if qtincludes and os.path.isfile(qtincludes + "/qglobal.h"): + # The user told where to look for and it looks valid + print GREEN + "ok " + qtincludes + NORMAL + else: + if os.path.isfile(qtdir + "/include/qglobal.h"): + # Automatic detection + print GREEN + "ok " + qtdir + "/include/ " + NORMAL + qtincludes = qtdir + "/include/" + elif os.path.isfile("/usr/include/qt3/qglobal.h"): + # Debian probably + print YELLOW + "the qt headers were found in /usr/include/qt3/ " + NORMAL + qtincludes = "/usr/include/qt3" 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 kde includes : ", @@ -223,6 +242,7 @@ def detect_kde(env): ## qt libs and includes env['QTINCLUDEPATH']= qtincludes + env['TQTINCLUDEPATH']=tqtincludes if not qtlibs: qtlibs = qtdir+"/lib" env['QTLIBPATH']= qtlibs @@ -328,7 +348,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 @@ -365,7 +385,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): @@ -392,7 +412,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', diff --git a/kde.py b/kde.py index 76d728c..69f0766 100644 --- a/kde.py +++ b/kde.py @@ -37,6 +37,7 @@ def detect_kde(env): kdeincludes = env['ARGS'].get('kdeincludes', None) kdelibs = env['ARGS'].get('kdelibs', None) qtincludes = env['ARGS'].get('qtincludes', None) + tqtincludes = env['ARGS'].get('tqtincludes', None) qtlibs = env['ARGS'].get('qtlibs', None) kdedir = env['ARGS'].get('kdedir', None) @@ -49,10 +50,10 @@ def detect_kde(env): if kdedir: str="which %s 2>/dev/null" % (kdedir+'/bin/kde-config') kde_config = os.popen(str).read().strip() if len(kde_config): - print GREEN + 'kde-config was found as ' + kde_config + print GREEN + 'kde-config was found as ' + kde_config + NORMAL else: - if kdedir: print RED + 'kde-config was NOT found in the folder given ' + kdedir - else: print RED + 'kde-config was NOT found in your PATH' + if kdedir: print RED + 'kde-config was NOT found in the folder given ' + kdedir + NORMAL + else: print RED + 'kde-config was NOT found in your PATH' + NORMAL print "Make sure kde is installed properly" print "(missing package kdebase-devel?)" env.Exit(1) @@ -139,24 +140,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"): + if os.path.isfile(qtdir + "/include/tqlayout.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 + "/qglobal.h"): + # The user told where to look for and it looks valid + print GREEN + "ok " + qtincludes + NORMAL + else: + if os.path.isfile(qtdir + "/include/qglobal.h"): + # Automatic detection + print GREEN + "ok " + qtdir + "/include/ " + NORMAL + qtincludes = qtdir + "/include/" + elif os.path.isfile("/usr/include/qt3/qglobal.h"): + # Debian probably + print YELLOW + "the qt headers were found in /usr/include/qt3/ " + NORMAL + qtincludes = "/usr/include/qt3" else: print RED + "the qt headers were not found" + NORMAL env.Exit(1) @@ -227,6 +246,7 @@ def detect_kde(env): ## qt libs and includes env['QTINCLUDEPATH']=qtincludes + env['TQTINCLUDEPATH']=tqtincludes if not qtlibs: qtlibs=qtdir+"/lib" env['QTLIBPATH']=qtlibs @@ -432,7 +452,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 @@ -465,7 +485,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): @@ -492,7 +512,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',