|
|
|
@ -31,7 +31,7 @@ from distutils import log
|
|
|
|
|
from distutils import file_util
|
|
|
|
|
from distutils import dir_util
|
|
|
|
|
from distutils.util import byte_compile
|
|
|
|
|
import qtuicompiler
|
|
|
|
|
import tqtuicompiler
|
|
|
|
|
import stat
|
|
|
|
|
import os,os.path,imp,glob
|
|
|
|
|
import sys
|
|
|
|
@ -56,7 +56,7 @@ def setup(**arg_dict):
|
|
|
|
|
'build_messages' : BuildI18NMessages,
|
|
|
|
|
'install_messages' : InstallI18NMessages,
|
|
|
|
|
'update_messages' : UpdateI18NMessages,
|
|
|
|
|
'checkpyqt' : CheckPyQt,
|
|
|
|
|
'checkpytqt' : CheckPyTQt,
|
|
|
|
|
'checkpytde' : CheckPyTDE,
|
|
|
|
|
'uninstall' : Uninstall,
|
|
|
|
|
'build' : BuildKDE,
|
|
|
|
@ -79,7 +79,7 @@ def setup(**arg_dict):
|
|
|
|
|
class KDEDistribution(Distribution):
|
|
|
|
|
def __init__(self,attrs=None):
|
|
|
|
|
self.min_kde_version = None
|
|
|
|
|
self.min_qt_version = None
|
|
|
|
|
self.min_tqt_version = None
|
|
|
|
|
self.kcontrol_modules = None
|
|
|
|
|
self.tdeioslaves = None
|
|
|
|
|
self.executable_links = None
|
|
|
|
@ -179,7 +179,7 @@ class InstallKDE(install):
|
|
|
|
|
|
|
|
|
|
sub_commands = install.sub_commands[:]
|
|
|
|
|
sub_commands.insert(0, ('checkpytde',None) )
|
|
|
|
|
sub_commands.insert(0, ('checkpyqt',None) )
|
|
|
|
|
sub_commands.insert(0, ('checkpytqt',None) )
|
|
|
|
|
sub_commands.append( ('install_executable_links',has_executable_links) )
|
|
|
|
|
sub_commands.append( ('install_messages',has_messages) )
|
|
|
|
|
sub_commands.append( ('install_html',has_docbook_html) )
|
|
|
|
@ -501,11 +501,11 @@ class BuildKControlModule(Command):
|
|
|
|
|
('kde-inc-dir=',None,'Directory containing C++ header files for KDE'),
|
|
|
|
|
('kde-lib-dir=',None,'Directory containing library files for KDE'),
|
|
|
|
|
('kde-kcm-lib-dir=',None,'Directory for KDE kcm library files'),
|
|
|
|
|
('qt-inc-dir=',None,'Directory containing C++ header files for Qt'),
|
|
|
|
|
('qt-lib-dir=',None,'Directory containing library files for Qt'),
|
|
|
|
|
('tqt-inc-dir=',None,'Directory containing C++ header files for TQt'),
|
|
|
|
|
('tqt-lib-dir=',None,'Directory containing library files for TQt'),
|
|
|
|
|
('sip-dir=',None,'Directory containing the sip library files'),
|
|
|
|
|
('clib=',None,'gcc library and path'),
|
|
|
|
|
('pyqt-dir=',None,'PyQt module directory'),
|
|
|
|
|
('pytqt-dir=',None,'PyTQt module directory'),
|
|
|
|
|
('pytde-dir=',None,'PyTDE module directory'),
|
|
|
|
|
('data-dir=',None,'installation directory for data (script) files')]
|
|
|
|
|
|
|
|
|
@ -517,11 +517,11 @@ class BuildKControlModule(Command):
|
|
|
|
|
self.kde_inc_dir = None
|
|
|
|
|
self.kde_lib_dir = None
|
|
|
|
|
self.kde_kcm_lib_dir = None
|
|
|
|
|
self.qt_inc_dir = None
|
|
|
|
|
self.qt_lib_dir = None
|
|
|
|
|
self.tqt_inc_dir = None
|
|
|
|
|
self.tqt_lib_dir = None
|
|
|
|
|
self.sip_dir = None
|
|
|
|
|
self.clib = None
|
|
|
|
|
self.pyqt_dir = None
|
|
|
|
|
self.pytqt_dir = None
|
|
|
|
|
self.pytde_dir = None
|
|
|
|
|
self.data_dir = None
|
|
|
|
|
|
|
|
|
@ -561,38 +561,37 @@ class BuildKControlModule(Command):
|
|
|
|
|
self.announce("Using %s for KDE KCM library files" % self.kde_kcm_lib_dir)
|
|
|
|
|
|
|
|
|
|
# TQt inc dir
|
|
|
|
|
if self.qt_inc_dir is None:
|
|
|
|
|
if self.tqt_inc_dir is None:
|
|
|
|
|
canidatepaths = []
|
|
|
|
|
qtinc = os.getenv("QTINC")
|
|
|
|
|
if qtinc != None:
|
|
|
|
|
canidatepaths.append(qtinc)
|
|
|
|
|
qtdir = os.getenv("TQTDIR")
|
|
|
|
|
if qtdir != None:
|
|
|
|
|
canidatepaths.append(os.path.join(qtdir,"include"))
|
|
|
|
|
tqtinc = os.getenv("TQTINC")
|
|
|
|
|
if tqtinc != None:
|
|
|
|
|
canidatepaths.append(tqtinc)
|
|
|
|
|
tqtdir = os.getenv("TQTDIR")
|
|
|
|
|
if tqtdir != None:
|
|
|
|
|
canidatepaths.append(os.path.join(tqtdir,"include"))
|
|
|
|
|
canidatepaths.append(os.path.join(install.prefix,"lib/tqt3/include"))
|
|
|
|
|
canidatepaths.append(os.path.join(install.prefix,"lib/qt3/include"))
|
|
|
|
|
canidatepaths.append(os.path.join(install.prefix,"include"))
|
|
|
|
|
canidatepaths.append("/opt/tqt3/include")
|
|
|
|
|
canidatepaths.append("/usr/include/tqt3")
|
|
|
|
|
self.qt_inc_dir = FindFileInPaths('ntqstring.h',canidatepaths)
|
|
|
|
|
if self.qt_inc_dir is None:
|
|
|
|
|
self.qt_inc_dir = FindFileInPaths('qstring.h',canidatepaths)
|
|
|
|
|
if self.qt_inc_dir is None:
|
|
|
|
|
self.tqt_inc_dir = FindFileInPaths('ntqstring.h',canidatepaths)
|
|
|
|
|
if self.tqt_inc_dir is None:
|
|
|
|
|
self.tqt_inc_dir = FindFileInPaths('tqstring.h',canidatepaths)
|
|
|
|
|
if self.tqt_inc_dir is None:
|
|
|
|
|
raise SystemExit("Failed to find the TQt header file directory")
|
|
|
|
|
if FindFileInPaths('ntqstring.h',[self.qt_inc_dir]) is None:
|
|
|
|
|
if FindFileInPaths('qstring.h',[self.qt_inc_dir]) is None:
|
|
|
|
|
raise SystemExit("Failed to find TQt header files in: %s" % self.qt_inc_dir)
|
|
|
|
|
self.announce("Using %s for TQt header files" % self.qt_inc_dir)
|
|
|
|
|
if FindFileInPaths('ntqstring.h',[self.tqt_inc_dir]) is None:
|
|
|
|
|
if FindFileInPaths('tqstring.h',[self.tqt_inc_dir]) is None:
|
|
|
|
|
raise SystemExit("Failed to find TQt header files in: %s" % self.tqt_inc_dir)
|
|
|
|
|
self.announce("Using %s for TQt header files" % self.tqt_inc_dir)
|
|
|
|
|
|
|
|
|
|
# TQt lib dir
|
|
|
|
|
if self.qt_lib_dir is None:
|
|
|
|
|
if self.tqt_lib_dir is None:
|
|
|
|
|
canidatepaths = []
|
|
|
|
|
tqtlib = os.getenv("TQTLIB")
|
|
|
|
|
if tqtlib != None:
|
|
|
|
|
canidatepaths.append(tqtlib)
|
|
|
|
|
qtdir = os.getenv("TQTDIR")
|
|
|
|
|
if qtdir != None:
|
|
|
|
|
canidatepaths.append(os.path.join(qtdir,get_libdir_name()))
|
|
|
|
|
tqtdir = os.getenv("TQTDIR")
|
|
|
|
|
if tqtdir != None:
|
|
|
|
|
canidatepaths.append(os.path.join(tqtdir,get_libdir_name()))
|
|
|
|
|
canidatepaths.append(os.path.join(install.prefix,"lib/tqt3/"+get_libdir_name()))
|
|
|
|
|
canidatepaths.append(os.path.join(install.prefix,"lib/tqt3/"+get_libdir_name()))
|
|
|
|
|
canidatepaths.append(os.path.join(install.prefix,get_libdir_name()))
|
|
|
|
@ -600,26 +599,23 @@ class BuildKControlModule(Command):
|
|
|
|
|
canidatepaths.append("/opt/tqt/"+get_libdir_name())
|
|
|
|
|
canidatepaths.append("/opt/tqt/lib/"+get_libdir_name())
|
|
|
|
|
canidatepaths.append("/opt/tqt3/lib/"+get_libdir_name())
|
|
|
|
|
self.qt_lib_dir = FindFileInPaths('libtqt*',canidatepaths)
|
|
|
|
|
if self.qt_lib_dir is None:
|
|
|
|
|
self.tqt_lib_dir = FindFileInPaths('libtqt*',canidatepaths)
|
|
|
|
|
if self.tqt_lib_dir is None:
|
|
|
|
|
canidatepaths = []
|
|
|
|
|
tqtlib = os.getenv("TQTLIB")
|
|
|
|
|
if tqtlib != None:
|
|
|
|
|
canidatepaths.append(tqtlib)
|
|
|
|
|
qtdir = os.getenv("TQTDIR")
|
|
|
|
|
if qtdir != None:
|
|
|
|
|
canidatepaths.append(os.path.join(qtdir,get_libdir_name()))
|
|
|
|
|
tqtdir = os.getenv("TQTDIR")
|
|
|
|
|
if tqtdir != None:
|
|
|
|
|
canidatepaths.append(os.path.join(tqtdir,get_libdir_name()))
|
|
|
|
|
canidatepaths.append(os.path.join(install.prefix,"lib/tqt3/"+get_libdir_name()))
|
|
|
|
|
canidatepaths.append(os.path.join(install.prefix,"lib/qt3/"+get_libdir_name()))
|
|
|
|
|
canidatepaths.append(os.path.join(install.prefix,get_libdir_name()))
|
|
|
|
|
canidatepaths.append("/opt/tqt3/"+get_libdir_name())
|
|
|
|
|
canidatepaths.append("/opt/qt/"+get_libdir_name())
|
|
|
|
|
canidatepaths.append("/opt/qt/lib/"+get_libdir_name())
|
|
|
|
|
canidatepaths.append("/opt/qt3/lib/"+get_libdir_name())
|
|
|
|
|
self.qt_lib_dir = FindFileInPaths('libtqt*',canidatepaths)
|
|
|
|
|
if self.qt_lib_dir is None:
|
|
|
|
|
canidatepaths.append("/opt/tqt3/lib/"+get_libdir_name())
|
|
|
|
|
self.tqt_lib_dir = FindFileInPaths('libtqt*',canidatepaths)
|
|
|
|
|
if self.tqt_lib_dir is None:
|
|
|
|
|
raise SystemExit("Failed to find TQt library files")
|
|
|
|
|
self.announce("Using %s for TQt library files" % self.qt_lib_dir)
|
|
|
|
|
self.announce("Using %s for TQt library files" % self.tqt_lib_dir)
|
|
|
|
|
|
|
|
|
|
# Python dir
|
|
|
|
|
if self.python_dir is None:
|
|
|
|
@ -633,13 +629,13 @@ class BuildKControlModule(Command):
|
|
|
|
|
self.announce("Using %s for Python header files" % self.python_inc_dir)
|
|
|
|
|
|
|
|
|
|
# PyTQt dir
|
|
|
|
|
if self.pyqt_dir is None:
|
|
|
|
|
self.pyqt_dir = FindFileInPaths("PyTQt", sys.path)
|
|
|
|
|
if self.pyqt_dir is None:
|
|
|
|
|
self.pyqt_dir = os.path.join(sysconfig.get_python_lib(), 'PyTQt')
|
|
|
|
|
if (FindFileInPaths("libtqtcmodule*",[self.pyqt_dir]) is None) and (FindFileInPaths("qt*",[self.pyqt_dir]) is None):
|
|
|
|
|
raise SystemExit("Failed to find the PyTQt directory: %s" % self.pyqt_dir)
|
|
|
|
|
self.announce("Using %s for PyTQt modules" % self.pyqt_dir)
|
|
|
|
|
if self.pytqt_dir is None:
|
|
|
|
|
self.pytqt_dir = FindFileInPaths("PyTQt", sys.path)
|
|
|
|
|
if self.pytqt_dir is None:
|
|
|
|
|
self.pytqt_dir = os.path.join(sysconfig.get_python_lib(), 'PyTQt')
|
|
|
|
|
if (FindFileInPaths("libtqtcmodule*",[self.pytqt_dir]) is None) and (FindFileInPaths("tqt*",[self.pytqt_dir]) is None):
|
|
|
|
|
raise SystemExit("Failed to find the PyTQt directory: %s" % self.pytqt_dir)
|
|
|
|
|
self.announce("Using %s for PyTQt modules" % self.pytqt_dir)
|
|
|
|
|
|
|
|
|
|
# PyTDE dir
|
|
|
|
|
if self.pytde_dir is None:
|
|
|
|
@ -796,7 +792,7 @@ class BuildKControlModule(Command):
|
|
|
|
|
cmdlist.append("-I" + self.python_inc_dir)
|
|
|
|
|
cmdlist.append("-I" + self.kde_inc_dir)
|
|
|
|
|
cmdlist.append("-I" + self.kde_inc_dir + "/tde")
|
|
|
|
|
cmdlist.append("-I" + self.qt_inc_dir)
|
|
|
|
|
cmdlist.append("-I" + self.tqt_inc_dir)
|
|
|
|
|
cmdlist.append("-I/usr/include/tqt")
|
|
|
|
|
cmdlist.append("-I.")
|
|
|
|
|
# input
|
|
|
|
@ -831,28 +827,28 @@ class BuildKControlModule(Command):
|
|
|
|
|
|
|
|
|
|
# FIXME I doubt half of these libraries need to be here.
|
|
|
|
|
linklist.append(self.sip_dir+"/sip_tqt.so")
|
|
|
|
|
# PyQt libs
|
|
|
|
|
linklist.append(self.pyqt_dir+"/qt.so")
|
|
|
|
|
# PyTQt libs
|
|
|
|
|
linklist.append(self.pytqt_dir+"/tqt.so")
|
|
|
|
|
# PyTDE libs
|
|
|
|
|
linklist.append(self.pytde_dir+"/tdecore.so")
|
|
|
|
|
linklist.append(self.pytde_dir+"/tdeui.so")
|
|
|
|
|
|
|
|
|
|
# linklist.append("-L"+self.sip_dir); linklist.append("-lsip_tqt")
|
|
|
|
|
# # PyQt libs
|
|
|
|
|
# linklist.append("-L"+self.pyqt_dir); linklist.append("-lqtcmodule")
|
|
|
|
|
# # PyTQt libs
|
|
|
|
|
# linklist.append("-L"+self.pytqt_dir); linklist.append("-lqtcmodule")
|
|
|
|
|
# # PyTDE libs
|
|
|
|
|
# linklist.append("-L"+self.pytde_dir); linklist.append("-ltdecorecmodule"); linklist.append("-ltdeuicmodule")
|
|
|
|
|
|
|
|
|
|
linklist.append("-L"+self.kde_lib_dir); linklist.append("-L/opt/trinity/lib"); linklist.append("-ltdecore"); linklist.append("-lpythonize")
|
|
|
|
|
linklist.append("-L"+self.qt_lib_dir); linklist.append("-ltqt-mt")
|
|
|
|
|
linklist.append("-L"+self.tqt_lib_dir); linklist.append("-ltqt-mt")
|
|
|
|
|
linklist.append("-lm")
|
|
|
|
|
linklist.append("-lc")
|
|
|
|
|
linklist.append(self.clib)
|
|
|
|
|
|
|
|
|
|
linklist.append("-R"); linklist.append(self.python_dir)
|
|
|
|
|
linklist.append("-R"); linklist.append(self.qt_lib_dir)
|
|
|
|
|
linklist.append("-R"); linklist.append(self.tqt_lib_dir)
|
|
|
|
|
linklist.append("-R"); linklist.append(self.sip_dir)
|
|
|
|
|
linklist.append("-R"); linklist.append(self.pyqt_dir)
|
|
|
|
|
linklist.append("-R"); linklist.append(self.pytqt_dir)
|
|
|
|
|
linklist.append("-R"); linklist.append(self.pytde_dir)
|
|
|
|
|
linklist.append("-R"); linklist.append(self.kde_lib_dir)
|
|
|
|
|
|
|
|
|
@ -944,10 +940,10 @@ static TDECModule* return_instance( TQWidget *parent, const char *name ) {
|
|
|
|
|
|
|
|
|
|
// Inject a helper function
|
|
|
|
|
TQString bridge = TQString("import sip_tqt\n"
|
|
|
|
|
"from PyTQt import qt\n"
|
|
|
|
|
"from PyTQt import tqt\n"
|
|
|
|
|
"def kcontrol_bridge_" FACTORY "(parent,name):\n"
|
|
|
|
|
" if parent!=0:\n"
|
|
|
|
|
" wparent = sip_tqt.wrapinstance(parent,qt.TQWidget)\n"
|
|
|
|
|
" wparent = sip_tqt.wrapinstance(parent,tqt.TQWidget)\n"
|
|
|
|
|
" else:\n"
|
|
|
|
|
" wparent = None\n"
|
|
|
|
|
" inst = " FACTORY "(wparent, name)\n"
|
|
|
|
@ -1320,7 +1316,7 @@ class UpdateI18NMessages(Command):
|
|
|
|
|
# Compile any UI files
|
|
|
|
|
for dir in self.distribution.i18n[1]:
|
|
|
|
|
for file in glob.glob(os.path.join(dir,'*.ui')):
|
|
|
|
|
qtuicompiler.UpdateUI(file,kde=True)
|
|
|
|
|
tqtuicompiler.UpdateUI(file,kde=True)
|
|
|
|
|
|
|
|
|
|
# Fetch all of the python files.
|
|
|
|
|
for dir in self.distribution.i18n[1]:
|
|
|
|
@ -1449,11 +1445,11 @@ class BuildTdeioslave(Command):
|
|
|
|
|
('kde-lib-dir=',None,'Directory containing library files for KDE'),
|
|
|
|
|
('kde-tdeioslave-lib-dir=',None,'Directory for KDE tdeioslave library files'),
|
|
|
|
|
('kde-protocol-dir=',None,'Directory for KDE tdeioslave protocol files'),
|
|
|
|
|
('qt-inc-dir=',None,'Directory containing C++ header files for Qt'),
|
|
|
|
|
('qt-lib-dir=',None,'Directory containing library files for Qt'),
|
|
|
|
|
('tqt-inc-dir=',None,'Directory containing C++ header files for TQt'),
|
|
|
|
|
('tqt-lib-dir=',None,'Directory containing library files for TQt'),
|
|
|
|
|
('sip-dir=','/usr/lib/pyshared/python*','Directory containing the sip library files'),
|
|
|
|
|
('clib=',None,'gcc library and path'),
|
|
|
|
|
('pyqt-dir=','/usr/lib/pyshared/python*','PyQt module directory'),
|
|
|
|
|
('pytqt-dir=','/usr/lib/pyshared/python*','PyTQt module directory'),
|
|
|
|
|
('pytde-dir=',None,'PyTDE module directory'),
|
|
|
|
|
('data-dir=',None,'installation directory for data (script) files')]
|
|
|
|
|
|
|
|
|
@ -1466,11 +1462,11 @@ class BuildTdeioslave(Command):
|
|
|
|
|
self.kde_lib_dir = None
|
|
|
|
|
self.kde_tdeioslave_lib_dir = None
|
|
|
|
|
self.kde_protocol_dir = None
|
|
|
|
|
self.qt_inc_dir = None
|
|
|
|
|
self.qt_lib_dir = None
|
|
|
|
|
self.tqt_inc_dir = None
|
|
|
|
|
self.tqt_lib_dir = None
|
|
|
|
|
self.sip_dir = None
|
|
|
|
|
self.clib = None
|
|
|
|
|
self.pyqt_dir = None
|
|
|
|
|
self.pytqt_dir = None
|
|
|
|
|
self.pytde_dir = None
|
|
|
|
|
self.data_dir = None
|
|
|
|
|
|
|
|
|
@ -1510,40 +1506,37 @@ class BuildTdeioslave(Command):
|
|
|
|
|
self.announce("Using %s for KDE Tdeioslave library files" % self.kde_tdeioslave_lib_dir)
|
|
|
|
|
|
|
|
|
|
# TQt inc dir
|
|
|
|
|
if self.qt_inc_dir is None:
|
|
|
|
|
if self.tqt_inc_dir is None:
|
|
|
|
|
canidatepaths = []
|
|
|
|
|
qtinc = os.getenv("QTINC")
|
|
|
|
|
if qtinc != None:
|
|
|
|
|
canidatepaths.append(qtinc)
|
|
|
|
|
qtdir = os.getenv("TQTDIR")
|
|
|
|
|
if qtdir != None:
|
|
|
|
|
canidatepaths.append(os.path.join(qtdir,"include"))
|
|
|
|
|
tqtinc = os.getenv("TQTINC")
|
|
|
|
|
if tqtinc != None:
|
|
|
|
|
canidatepaths.append(tqtinc)
|
|
|
|
|
tqtdir = os.getenv("TQTDIR")
|
|
|
|
|
if tqtdir != None:
|
|
|
|
|
canidatepaths.append(os.path.join(tqtdir,"include"))
|
|
|
|
|
canidatepaths.append(os.path.join(install.prefix,"lib/tqt3/include"))
|
|
|
|
|
canidatepaths.append(os.path.join(install.prefix,"lib/qt3/include"))
|
|
|
|
|
canidatepaths.append(os.path.join(install.prefix,"include"))
|
|
|
|
|
canidatepaths.append("/opt/tqt3/include")
|
|
|
|
|
canidatepaths.append("/opt/qt/include")
|
|
|
|
|
canidatepaths.append("/opt/qt/lib/include")
|
|
|
|
|
canidatepaths.append("/opt/qt3/lib/include")
|
|
|
|
|
self.qt_inc_dir = FindFileInPaths('ntqstring.h',canidatepaths)
|
|
|
|
|
if self.qt_inc_dir is None:
|
|
|
|
|
self.qt_inc_dir = FindFileInPaths('qstring.h',canidatepaths)
|
|
|
|
|
if self.qt_inc_dir is None:
|
|
|
|
|
canidatepaths.append("/opt/tqt3/lib/include")
|
|
|
|
|
self.tqt_inc_dir = FindFileInPaths('ntqstring.h',canidatepaths)
|
|
|
|
|
if self.tqt_inc_dir is None:
|
|
|
|
|
self.tqt_inc_dir = FindFileInPaths('tqstring.h',canidatepaths)
|
|
|
|
|
if self.tqt_inc_dir is None:
|
|
|
|
|
raise SystemExit("Failed to find the TQt header file directory")
|
|
|
|
|
if FindFileInPaths('ntqstring.h',[self.qt_inc_dir]) is None:
|
|
|
|
|
if FindFileInPaths('qstring.h',[self.qt_inc_dir]) is None:
|
|
|
|
|
raise SystemExit("Failed to find TQt header files in: %s" % self.qt_inc_dir)
|
|
|
|
|
self.announce("Using %s for TQt header files" % self.qt_inc_dir)
|
|
|
|
|
if FindFileInPaths('ntqstring.h',[self.tqt_inc_dir]) is None:
|
|
|
|
|
if FindFileInPaths('tqstring.h',[self.tqt_inc_dir]) is None:
|
|
|
|
|
raise SystemExit("Failed to find TQt header files in: %s" % self.tqt_inc_dir)
|
|
|
|
|
self.announce("Using %s for TQt header files" % self.tqt_inc_dir)
|
|
|
|
|
|
|
|
|
|
# TQt lib dir
|
|
|
|
|
if self.qt_lib_dir is None:
|
|
|
|
|
if self.tqt_lib_dir is None:
|
|
|
|
|
canidatepaths = []
|
|
|
|
|
tqtlib = os.getenv("TQTLIB")
|
|
|
|
|
if tqtlib != None:
|
|
|
|
|
canidatepaths.append(tqtlib)
|
|
|
|
|
qtdir = os.getenv("TQTDIR")
|
|
|
|
|
if qtdir != None:
|
|
|
|
|
canidatepaths.append(os.path.join(qtdir,get_libdir_name()))
|
|
|
|
|
tqtdir = os.getenv("TQTDIR")
|
|
|
|
|
if tqtdir != None:
|
|
|
|
|
canidatepaths.append(os.path.join(tqtdir,get_libdir_name()))
|
|
|
|
|
canidatepaths.append(os.path.join(install.prefix,"lib/tqt3/"+get_libdir_name()))
|
|
|
|
|
canidatepaths.append(os.path.join(install.prefix,"lib/tqt3/"+get_libdir_name()))
|
|
|
|
|
canidatepaths.append(os.path.join(install.prefix,get_libdir_name()))
|
|
|
|
@ -1551,26 +1544,23 @@ class BuildTdeioslave(Command):
|
|
|
|
|
canidatepaths.append("/opt/tqt/"+get_libdir_name())
|
|
|
|
|
canidatepaths.append("/opt/tqt/lib/"+get_libdir_name())
|
|
|
|
|
canidatepaths.append("/opt/tqt3/lib/"+get_libdir_name())
|
|
|
|
|
self.qt_lib_dir = FindFileInPaths('libtqt*',canidatepaths)
|
|
|
|
|
if self.qt_lib_dir is None:
|
|
|
|
|
self.tqt_lib_dir = FindFileInPaths('libtqt*',canidatepaths)
|
|
|
|
|
if self.tqt_lib_dir is None:
|
|
|
|
|
canidatepaths = []
|
|
|
|
|
tqtlib = os.getenv("TQTLIB")
|
|
|
|
|
if tqtlib != None:
|
|
|
|
|
canidatepaths.append(tqtlib)
|
|
|
|
|
qtdir = os.getenv("TQTDIR")
|
|
|
|
|
if qtdir != None:
|
|
|
|
|
canidatepaths.append(os.path.join(qtdir,get_libdir_name()))
|
|
|
|
|
tqtdir = os.getenv("TQTDIR")
|
|
|
|
|
if tqtdir != None:
|
|
|
|
|
canidatepaths.append(os.path.join(tqtdir,get_libdir_name()))
|
|
|
|
|
canidatepaths.append(os.path.join(install.prefix,"lib/tqt3/"+get_libdir_name()))
|
|
|
|
|
canidatepaths.append(os.path.join(install.prefix,"lib/qt3/"+get_libdir_name()))
|
|
|
|
|
canidatepaths.append(os.path.join(install.prefix,get_libdir_name()))
|
|
|
|
|
canidatepaths.append("/opt/tqt3/"+get_libdir_name())
|
|
|
|
|
canidatepaths.append("/opt/qt/"+get_libdir_name())
|
|
|
|
|
canidatepaths.append("/opt/qt/lib/"+get_libdir_name())
|
|
|
|
|
canidatepaths.append("/opt/qt3/lib/"+get_libdir_name())
|
|
|
|
|
self.qt_lib_dir = FindFileInPaths('libtqt*',canidatepaths)
|
|
|
|
|
if self.qt_lib_dir is None:
|
|
|
|
|
canidatepaths.append("/opt/tqt3/lib/"+get_libdir_name())
|
|
|
|
|
self.tqt_lib_dir = FindFileInPaths('libtqt*',canidatepaths)
|
|
|
|
|
if self.tqt_lib_dir is None:
|
|
|
|
|
raise SystemExit("Failed to find TQt library files")
|
|
|
|
|
self.announce("Using %s for TQt library files" % self.qt_lib_dir)
|
|
|
|
|
self.announce("Using %s for TQt library files" % self.tqt_lib_dir)
|
|
|
|
|
|
|
|
|
|
# Python dir
|
|
|
|
|
if self.python_dir is None:
|
|
|
|
@ -1584,13 +1574,13 @@ class BuildTdeioslave(Command):
|
|
|
|
|
self.announce("Using %s for Python header files" % self.python_inc_dir)
|
|
|
|
|
|
|
|
|
|
# PyTQt dir
|
|
|
|
|
if self.pyqt_dir is None:
|
|
|
|
|
self.pyqt_dir = FindFileInPaths("PyTQt", sys.path)
|
|
|
|
|
if self.pyqt_dir is None:
|
|
|
|
|
self.pyqt_dir = os.path.join(sysconfig.get_python_lib(), 'PyTQt')
|
|
|
|
|
if (FindFileInPaths("libtqtcmodule*",[self.pyqt_dir]) is None) and (FindFileInPaths("qt*",[self.pyqt_dir]) is None):
|
|
|
|
|
raise SystemExit("Failed to find the PyTQt directory: %s" % self.pyqt_dir)
|
|
|
|
|
self.announce("Using %s for PyTQt modules" % self.pyqt_dir)
|
|
|
|
|
if self.pytqt_dir is None:
|
|
|
|
|
self.pytqt_dir = FindFileInPaths("PyTQt", sys.path)
|
|
|
|
|
if self.pytqt_dir is None:
|
|
|
|
|
self.pytqt_dir = os.path.join(sysconfig.get_python_lib(), 'PyTQt')
|
|
|
|
|
if (FindFileInPaths("libtqtcmodule*",[self.pytqt_dir]) is None) and (FindFileInPaths("tqt*",[self.pytqt_dir]) is None):
|
|
|
|
|
raise SystemExit("Failed to find the PyTQt directory: %s" % self.pytqt_dir)
|
|
|
|
|
self.announce("Using %s for PyTQt modules" % self.pytqt_dir)
|
|
|
|
|
|
|
|
|
|
# PyTDE dir
|
|
|
|
|
if self.pytde_dir is None:
|
|
|
|
@ -1731,7 +1721,7 @@ class BuildTdeioslave(Command):
|
|
|
|
|
cmdlist.append("-I" + self.python_inc_dir)
|
|
|
|
|
cmdlist.append("-I" + self.kde_inc_dir)
|
|
|
|
|
cmdlist.append("-I" + self.kde_inc_dir + "/tde")
|
|
|
|
|
cmdlist.append("-I" + self.qt_inc_dir)
|
|
|
|
|
cmdlist.append("-I" + self.tqt_inc_dir)
|
|
|
|
|
cmdlist.append("-I/usr/include/tqt")
|
|
|
|
|
cmdlist.append("-I.")
|
|
|
|
|
# input
|
|
|
|
@ -1767,26 +1757,26 @@ class BuildTdeioslave(Command):
|
|
|
|
|
# FIXME I doubt half of these libraries need to be here.
|
|
|
|
|
linklist.append(self.sip_dir+"/sip_tqt.so")
|
|
|
|
|
# PyTQt libs
|
|
|
|
|
linklist.append(self.pyqt_dir+"/qt.so")
|
|
|
|
|
linklist.append(self.pytqt_dir+"/tqt.so")
|
|
|
|
|
# PyTDE libs
|
|
|
|
|
linklist.append(self.pytde_dir+"/tdecore.so")
|
|
|
|
|
|
|
|
|
|
# linklist.append("-L"+self.sip_dir); linklist.append("-lsip_tqt")
|
|
|
|
|
# # PyTQt libs
|
|
|
|
|
# linklist.append("-L"+self.pyqt_dir); linklist.append("-lqtcmodule")
|
|
|
|
|
# linklist.append("-L"+self.pytqt_dir); linklist.append("-lqtcmodule")
|
|
|
|
|
# # PyTDE libs
|
|
|
|
|
# linklist.append("-L"+self.pytde_dir); linklist.append("-ltdecorecmodule"); linklist.append("-ltdeuicmodule")
|
|
|
|
|
|
|
|
|
|
linklist.append("-L"+self.kde_lib_dir); linklist.append("-L/opt/trinity/lib"); linklist.append("-ltdecore"); linklist.append("-lpythonize")
|
|
|
|
|
linklist.append("-L"+self.qt_lib_dir); linklist.append("-lqt-mt")
|
|
|
|
|
linklist.append("-L"+self.tqt_lib_dir); linklist.append("-lqt-mt")
|
|
|
|
|
linklist.append("-lm")
|
|
|
|
|
linklist.append("-lc")
|
|
|
|
|
linklist.append(self.clib)
|
|
|
|
|
|
|
|
|
|
linklist.append("-R"); linklist.append(self.python_dir)
|
|
|
|
|
linklist.append("-R"); linklist.append(self.qt_lib_dir)
|
|
|
|
|
linklist.append("-R"); linklist.append(self.tqt_lib_dir)
|
|
|
|
|
linklist.append("-R"); linklist.append(self.sip_dir)
|
|
|
|
|
linklist.append("-R"); linklist.append(self.pyqt_dir)
|
|
|
|
|
linklist.append("-R"); linklist.append(self.pytqt_dir)
|
|
|
|
|
linklist.append("-R"); linklist.append(self.pytde_dir)
|
|
|
|
|
linklist.append("-R"); linklist.append(self.kde_lib_dir)
|
|
|
|
|
|
|
|
|
@ -2010,7 +2000,7 @@ class InstallTdeioslave(Command):
|
|
|
|
|
return dir_util.mkpath(name, mode, dry_run=self.dry_run)
|
|
|
|
|
|
|
|
|
|
###########################################################################
|
|
|
|
|
class CheckPyQt(Command):
|
|
|
|
|
class CheckPyTQt(Command):
|
|
|
|
|
description = "Checks for the presence of a working PyTQt installation"
|
|
|
|
|
|
|
|
|
|
user_options = []
|
|
|
|
@ -2019,17 +2009,17 @@ class CheckPyQt(Command):
|
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
def finalize_options(self):
|
|
|
|
|
self.min_qt_version = self.distribution.min_qt_version
|
|
|
|
|
self.min_tqt_version = self.distribution.min_tqt_version
|
|
|
|
|
|
|
|
|
|
def run(self):
|
|
|
|
|
if self.min_qt_version!=None:
|
|
|
|
|
qtver,kdever = get_qt_kde_versions()
|
|
|
|
|
if compare_versions(self.min_qt_version,qtver)==1:
|
|
|
|
|
raise SystemExit("Your TQt version is too old. Version %s or higher is required, found %s." % (self.min_qt_version,qtver))
|
|
|
|
|
self.announce("Found TQt version %s." % qtver)
|
|
|
|
|
if self.min_tqt_version!=None:
|
|
|
|
|
tqtver,kdever = get_tqt_kde_versions()
|
|
|
|
|
if compare_versions(self.min_tqt_version,tqtver)==1:
|
|
|
|
|
raise SystemExit("Your TQt version is too old. Version %s or higher is required, found %s." % (self.min_tqt_version,tqtver))
|
|
|
|
|
self.announce("Found TQt version %s." % tqtver)
|
|
|
|
|
try:
|
|
|
|
|
self.announce("Checking for a working PyTQt...")
|
|
|
|
|
from PyTQt import qt
|
|
|
|
|
from PyTQt import tqt
|
|
|
|
|
self.announce(" ...PyTQt is working")
|
|
|
|
|
except:
|
|
|
|
|
raise SystemExit("Couldn't import TQt! Please make sure that PyTQt is installed and working.")
|
|
|
|
@ -2050,7 +2040,7 @@ class CheckPyTDE(Command):
|
|
|
|
|
|
|
|
|
|
def run(self):
|
|
|
|
|
if self.min_kde_version!=None:
|
|
|
|
|
qtver,kdever = get_qt_kde_versions()
|
|
|
|
|
tqtver,kdever = get_tqt_kde_versions()
|
|
|
|
|
if compare_versions(self.min_kde_version,kdever)==1:
|
|
|
|
|
raise SystemExit("Your TDE version is too old. Version %s or higher is required, found %s." % (self.min_kde_version,kdever))
|
|
|
|
|
self.announce("Found KDE version %s." % kdever)
|
|
|
|
@ -2208,24 +2198,26 @@ def compare_versions(a,b):
|
|
|
|
|
return 0
|
|
|
|
|
|
|
|
|
|
###########################################################################
|
|
|
|
|
def get_qt_kde_versions():
|
|
|
|
|
def get_tqt_kde_versions():
|
|
|
|
|
versioninfo = ask_kde_config('--version')
|
|
|
|
|
qtver = None
|
|
|
|
|
tqtver = None
|
|
|
|
|
kdever = None
|
|
|
|
|
if versioninfo!=None:
|
|
|
|
|
for line in versioninfo.splitlines():
|
|
|
|
|
if line.startswith("Qt: "):
|
|
|
|
|
qtver = line[4:]
|
|
|
|
|
if line.startswith("TQt: "):
|
|
|
|
|
tqtver = line[4:]
|
|
|
|
|
elif line.startswith("Qt: "):
|
|
|
|
|
tqtver = line[4:]
|
|
|
|
|
elif line.startswith("TDE: "):
|
|
|
|
|
kdever = line[5:]
|
|
|
|
|
return qtver,kdever
|
|
|
|
|
return tqtver,kdever
|
|
|
|
|
|
|
|
|
|
###########################################################################
|
|
|
|
|
def compile_tqtdesigner(ui_files,
|
|
|
|
|
force=0,
|
|
|
|
|
prefix=None, base_dir=None,
|
|
|
|
|
verbose=1, dry_run=0):
|
|
|
|
|
"""Compile a collection of QT Designer UI files to .py
|
|
|
|
|
"""Compile a collection of TQT Designer UI files to .py
|
|
|
|
|
|
|
|
|
|
If 'dry_run' is true, doesn't actually do anything that would
|
|
|
|
|
affect the filesystem.
|
|
|
|
@ -2246,12 +2238,12 @@ def compile_tqtdesigner(ui_files,
|
|
|
|
|
|
|
|
|
|
pyfile_base = os.path.basename(pyfile)
|
|
|
|
|
if force or newer(uifile, pyfile):
|
|
|
|
|
log.info("compiling Qt-Designer UI %s to %s", file, pyfile_base)
|
|
|
|
|
log.info("compiling TQt-Designer UI %s to %s", file, pyfile_base)
|
|
|
|
|
if not dry_run:
|
|
|
|
|
qtuicompiler.CompileUI(uifile, pyfile)
|
|
|
|
|
tqtuicompiler.CompileUI(uifile, pyfile)
|
|
|
|
|
generated_files.append(pyfile)
|
|
|
|
|
else:
|
|
|
|
|
log.debug("skipping Qt-Designer compilation of %s to %s",
|
|
|
|
|
log.debug("skipping TQt-Designer compilation of %s to %s",
|
|
|
|
|
file, pyfile_base)
|
|
|
|
|
return generated_files
|
|
|
|
|
|
|
|
|
|