|
|
|
@ -64,8 +64,8 @@ def setup(**arg_dict):
|
|
|
|
|
'build_html' : BuildDocbookHTML,
|
|
|
|
|
'install_html' : InstallDocbookHTML,
|
|
|
|
|
'install_lib' : InstallLibWithRoot,
|
|
|
|
|
'build_kioslave' : BuildKioslave,
|
|
|
|
|
'install_kioslave' : InstallKioslave}
|
|
|
|
|
'build_tdeioslave' : BuildKioslave,
|
|
|
|
|
'install_tdeioslave' : InstallKioslave}
|
|
|
|
|
|
|
|
|
|
for key in kdecmdclass.iterkeys():
|
|
|
|
|
cmdclass.setdefault(key,kdecmdclass[key])
|
|
|
|
@ -80,7 +80,7 @@ class KDEDistribution(Distribution):
|
|
|
|
|
self.min_kde_version = None
|
|
|
|
|
self.min_qt_version = None
|
|
|
|
|
self.kcontrol_modules = None
|
|
|
|
|
self.kioslaves = None
|
|
|
|
|
self.tdeioslaves = None
|
|
|
|
|
self.executable_links = None
|
|
|
|
|
self.docbooks = None
|
|
|
|
|
self.application_data = None
|
|
|
|
@ -108,10 +108,10 @@ def has_application_data(self):
|
|
|
|
|
return 0
|
|
|
|
|
return len(self.distribution.application_data)!=0
|
|
|
|
|
|
|
|
|
|
def has_kioslaves(self):
|
|
|
|
|
if self.distribution.kioslaves is None:
|
|
|
|
|
def has_tdeioslaves(self):
|
|
|
|
|
if self.distribution.tdeioslaves is None:
|
|
|
|
|
return 0
|
|
|
|
|
return len(self.distribution.kioslaves)!=0
|
|
|
|
|
return len(self.distribution.tdeioslaves)!=0
|
|
|
|
|
|
|
|
|
|
###########################################################################
|
|
|
|
|
# Our slightly extended build command. This also does kcontrol modules.
|
|
|
|
@ -123,14 +123,14 @@ class BuildKDE(build):
|
|
|
|
|
|
|
|
|
|
sub_commands = build.sub_commands[:]
|
|
|
|
|
sub_commands.append( ('build_kcm',has_kcms) )
|
|
|
|
|
sub_commands.append( ('build_kioslave',has_kioslaves) )
|
|
|
|
|
sub_commands.append( ('build_tdeioslave',has_tdeioslaves) )
|
|
|
|
|
sub_commands.append( ('build_html',has_docbook_html) )
|
|
|
|
|
sub_commands.append( ('build_messages',has_messages) )
|
|
|
|
|
|
|
|
|
|
def __init__(self,dist):
|
|
|
|
|
build.__init__(self,dist)
|
|
|
|
|
self.has_kcms = has_kcms
|
|
|
|
|
self.has_kioslaves = has_kioslaves
|
|
|
|
|
self.has_tdeioslaves = has_tdeioslaves
|
|
|
|
|
self.has_docbook_html = has_docbook_html
|
|
|
|
|
self.has_messages = has_messages
|
|
|
|
|
|
|
|
|
@ -173,8 +173,8 @@ class InstallKDE(install):
|
|
|
|
|
user_options.append( ('install-cmd=',None,"Command to use to install the files") )
|
|
|
|
|
user_options.append( ('install-xdg-apps=',None,"directory for XDG app files") )
|
|
|
|
|
user_options.append( ('install-kcm=',None,"directory for kcm library files") )
|
|
|
|
|
user_options.append( ('install-kioslave',None,"directory for kioslave library files") )
|
|
|
|
|
user_options.append( ('install-protocol',None,"directory for kioslave protocol files") )
|
|
|
|
|
user_options.append( ('install-tdeioslave',None,"directory for tdeioslave library files") )
|
|
|
|
|
user_options.append( ('install-protocol',None,"directory for tdeioslave protocol files") )
|
|
|
|
|
|
|
|
|
|
sub_commands = install.sub_commands[:]
|
|
|
|
|
sub_commands.insert(0, ('checkpytde',None) )
|
|
|
|
@ -183,7 +183,7 @@ class InstallKDE(install):
|
|
|
|
|
sub_commands.append( ('install_messages',has_messages) )
|
|
|
|
|
sub_commands.append( ('install_html',has_docbook_html) )
|
|
|
|
|
sub_commands.append( ('install_kcm',has_kcms) )
|
|
|
|
|
sub_commands.append( ('install_kioslave',has_kioslaves) )
|
|
|
|
|
sub_commands.append( ('install_tdeioslave',has_tdeioslaves) )
|
|
|
|
|
sub_commands.append( ('install_application_data',has_application_data) )
|
|
|
|
|
|
|
|
|
|
def initialize_options(self):
|
|
|
|
@ -193,7 +193,7 @@ class InstallKDE(install):
|
|
|
|
|
self.install_cmd = None
|
|
|
|
|
self.install_xdg_apps = None
|
|
|
|
|
self.install_kcm = None
|
|
|
|
|
self.install_kioslave = None
|
|
|
|
|
self.install_tdeioslave = None
|
|
|
|
|
self.install_protocol = None
|
|
|
|
|
self.install_application_data = None
|
|
|
|
|
install.initialize_options(self)
|
|
|
|
@ -259,15 +259,15 @@ class InstallKDE(install):
|
|
|
|
|
self.install_kcm = os.path.join(ask_kde_config('--install lib --expandvars').strip(),'trinity')
|
|
|
|
|
self.announce(" ...kcm library directory is %s" % self.install_kcm)
|
|
|
|
|
|
|
|
|
|
if self.install_kioslave is None:
|
|
|
|
|
self.announce("Detecting kioslave library directory...")
|
|
|
|
|
self.install_kioslave = os.path.join(ask_kde_config('--install lib --expandvars').strip(),'trinity')
|
|
|
|
|
self.announce(" ...kioslave library directory is %s" % self.install_kioslave)
|
|
|
|
|
if self.install_tdeioslave is None:
|
|
|
|
|
self.announce("Detecting tdeioslave library directory...")
|
|
|
|
|
self.install_tdeioslave = os.path.join(ask_kde_config('--install lib --expandvars').strip(),'trinity')
|
|
|
|
|
self.announce(" ...tdeioslave library directory is %s" % self.install_tdeioslave)
|
|
|
|
|
|
|
|
|
|
if self.install_protocol is None:
|
|
|
|
|
self.announce("Detecting kioslave protocol directory...")
|
|
|
|
|
self.announce("Detecting tdeioslave protocol directory...")
|
|
|
|
|
self.install_protocol = ask_kde_config('--install services --expandvars').strip()
|
|
|
|
|
self.announce(" ...kioslave protocol directory is %s" % self.install_protocol)
|
|
|
|
|
self.announce(" ...tdeioslave protocol directory is %s" % self.install_protocol)
|
|
|
|
|
|
|
|
|
|
install.finalize_options(self)
|
|
|
|
|
|
|
|
|
@ -1432,14 +1432,14 @@ class InstallI18NMessages(Command):
|
|
|
|
|
class BuildKioslave(Command):
|
|
|
|
|
description = "Build Kioslaves"
|
|
|
|
|
|
|
|
|
|
user_options = [('no-kioslave',None,"Don't build kioslaves"),
|
|
|
|
|
user_options = [('no-tdeioslave',None,"Don't build tdeioslaves"),
|
|
|
|
|
('build-dir=','b', "build directory (where to install from)"),
|
|
|
|
|
('python-dir=',None,'Directory containing the Python installation'),
|
|
|
|
|
('python-inc-dir=',None,'Directory containing C Header files for Python'),
|
|
|
|
|
('kde-inc-dir=',None,'Directory containing C++ header files for KDE'),
|
|
|
|
|
('kde-lib-dir=',None,'Directory containing library files for KDE'),
|
|
|
|
|
('kde-kioslave-lib-dir=',None,'Directory for KDE kioslave library files'),
|
|
|
|
|
('kde-protocol-dir=',None,'Directory for KDE kioslave protocol files'),
|
|
|
|
|
('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'),
|
|
|
|
|
('sip-dir=','/usr/lib/pyshared/python*','Directory containing the sip library files'),
|
|
|
|
@ -1449,13 +1449,13 @@ class BuildKioslave(Command):
|
|
|
|
|
('data-dir=',None,'installation directory for data (script) files')]
|
|
|
|
|
|
|
|
|
|
def initialize_options(self):
|
|
|
|
|
self.no_kioslave = 0
|
|
|
|
|
self.no_tdeioslave = 0
|
|
|
|
|
self.build_dir = None
|
|
|
|
|
self.python_inc_dir = None
|
|
|
|
|
self.python_dir = None
|
|
|
|
|
self.kde_inc_dir = None
|
|
|
|
|
self.kde_lib_dir = None
|
|
|
|
|
self.kde_kioslave_lib_dir = None
|
|
|
|
|
self.kde_tdeioslave_lib_dir = None
|
|
|
|
|
self.kde_protocol_dir = None
|
|
|
|
|
self.qt_inc_dir = None
|
|
|
|
|
self.qt_lib_dir = None
|
|
|
|
@ -1466,7 +1466,7 @@ class BuildKioslave(Command):
|
|
|
|
|
self.data_dir = None
|
|
|
|
|
|
|
|
|
|
def finalize_options(self):
|
|
|
|
|
if self.no_kioslave==0:
|
|
|
|
|
if self.no_tdeioslave==0:
|
|
|
|
|
self.set_undefined_options('install', ('build_base', 'build_dir'),('install_application_data','data_dir'))
|
|
|
|
|
|
|
|
|
|
install = self.get_finalized_command('install')
|
|
|
|
@ -1494,13 +1494,13 @@ class BuildKioslave(Command):
|
|
|
|
|
self.kde_lib_dir = "/opt/trinity/lib/"
|
|
|
|
|
self.announce("Using %s for KDE library files" % self.kde_lib_dir)
|
|
|
|
|
|
|
|
|
|
# KDE kioslave lib dir
|
|
|
|
|
#if self.kde_kioslave_lib_dir is None:
|
|
|
|
|
# self.kde_kioslave_lib_dir = os.path.join(self.kde_lib_dir,"trinity")
|
|
|
|
|
self.kde_kioslave_lib_dir = "/opt/trinity/lib/trinity/"
|
|
|
|
|
if FindFileInPaths('kio_*.so',[self.kde_kioslave_lib_dir]) is None:
|
|
|
|
|
raise SystemExit, "Failed to find KDE Kioslave library files in: %s" % self.kde_kioslave_lib_dir
|
|
|
|
|
self.announce("Using %s for KDE Kioslave library files" % self.kde_kioslave_lib_dir)
|
|
|
|
|
# KDE tdeioslave lib dir
|
|
|
|
|
#if self.kde_tdeioslave_lib_dir is None:
|
|
|
|
|
# self.kde_tdeioslave_lib_dir = os.path.join(self.kde_lib_dir,"trinity")
|
|
|
|
|
self.kde_tdeioslave_lib_dir = "/opt/trinity/lib/trinity/"
|
|
|
|
|
if FindFileInPaths('kio_*.so',[self.kde_tdeioslave_lib_dir]) is None:
|
|
|
|
|
raise SystemExit, "Failed to find KDE Kioslave library files in: %s" % self.kde_tdeioslave_lib_dir
|
|
|
|
|
self.announce("Using %s for KDE Kioslave library files" % self.kde_tdeioslave_lib_dir)
|
|
|
|
|
|
|
|
|
|
# Qt inc dir
|
|
|
|
|
if self.qt_inc_dir is None:
|
|
|
|
@ -1618,17 +1618,17 @@ class BuildKioslave(Command):
|
|
|
|
|
self.python_sub_dirs.append(base)
|
|
|
|
|
|
|
|
|
|
def get_command_name(self):
|
|
|
|
|
return 'build_kioslave'
|
|
|
|
|
return 'build_tdeioslave'
|
|
|
|
|
|
|
|
|
|
def run(self):
|
|
|
|
|
if self.no_kioslave:
|
|
|
|
|
if self.no_tdeioslave:
|
|
|
|
|
self.announce("Skipping KIO Slaves")
|
|
|
|
|
return
|
|
|
|
|
|
|
|
|
|
if not os.path.isdir(self.build_dir):
|
|
|
|
|
os.mkdir(self.build_dir)
|
|
|
|
|
|
|
|
|
|
for moduletuple in self.distribution.kioslaves:
|
|
|
|
|
for moduletuple in self.distribution.tdeioslaves:
|
|
|
|
|
self.announce("Building KIO Slave from protocol file %s." % moduletuple[0])
|
|
|
|
|
|
|
|
|
|
protocolfilename = moduletuple[0]
|
|
|
|
@ -1646,7 +1646,7 @@ class BuildKioslave(Command):
|
|
|
|
|
pass
|
|
|
|
|
fhandle.close()
|
|
|
|
|
except IOError:
|
|
|
|
|
raise SystemExit, "Failed to find kioslave protocol file: %s" % moduletuple[0]
|
|
|
|
|
raise SystemExit, "Failed to find tdeioslave protocol file: %s" % moduletuple[0]
|
|
|
|
|
|
|
|
|
|
# Sanity check.
|
|
|
|
|
if libraryname is None:
|
|
|
|
@ -1745,7 +1745,7 @@ class BuildKioslave(Command):
|
|
|
|
|
cmdlist.append("-export-dynamic")
|
|
|
|
|
# object
|
|
|
|
|
cmdlist.append(outputfile)
|
|
|
|
|
cmdlist.append("-rpath"); cmdlist.append(self.kde_kioslave_lib_dir)
|
|
|
|
|
cmdlist.append("-rpath"); cmdlist.append(self.kde_tdeioslave_lib_dir)
|
|
|
|
|
cmdlist.append("-o"); cmdlist.append(os.path.join(self.build_dir,stub_la_name))
|
|
|
|
|
# Link libs
|
|
|
|
|
linklist = []
|
|
|
|
@ -1805,7 +1805,7 @@ PyObject* call_function(PyObject *callable, PyObject *args) {
|
|
|
|
|
PyObject *result, *pArgs;
|
|
|
|
|
|
|
|
|
|
if (callable == NULL) {
|
|
|
|
|
printf(MODULE_NAME " kioslave error: callable == NULL in call_function\n");
|
|
|
|
|
printf(MODULE_NAME " tdeioslave error: callable == NULL in call_function\n");
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -1852,7 +1852,7 @@ extern "C" {
|
|
|
|
|
Py_XDECREF(pName);
|
|
|
|
|
|
|
|
|
|
if(pModule == NULL) {
|
|
|
|
|
printf(MODULE_NAME " kioslave error: pModule == NULL\n");
|
|
|
|
|
printf(MODULE_NAME " tdeioslave error: pModule == NULL\n");
|
|
|
|
|
return 1;
|
|
|
|
|
} else {
|
|
|
|
|
PyObject *pClass, *pMethod, *pArgs, *pArg1, *pArg2, *pInstance;
|
|
|
|
@ -1864,7 +1864,7 @@ extern "C" {
|
|
|
|
|
pClass = PyDict_GetItemString(pDict, FACTORY);
|
|
|
|
|
|
|
|
|
|
if(pClass == NULL) {
|
|
|
|
|
printf(MODULE_NAME " kioslave error: pClass == NULL\n");
|
|
|
|
|
printf(MODULE_NAME " tdeioslave error: pClass == NULL\n");
|
|
|
|
|
return 1;
|
|
|
|
|
} else {
|
|
|
|
|
pArgs = PyTuple_New(2);
|
|
|
|
@ -1895,9 +1895,9 @@ class InstallKioslave(Command):
|
|
|
|
|
description = "Install Kioslave files"
|
|
|
|
|
|
|
|
|
|
user_options = [
|
|
|
|
|
('install-dir=', 'd', "base directory for installing kioslave module files"),
|
|
|
|
|
('install-dir=', 'd', "base directory for installing tdeioslave module files"),
|
|
|
|
|
('install-cmd=', None, "Command to use to install the files"),
|
|
|
|
|
('install-protocol-dir=',None,"directory for kioslave protocol files"),
|
|
|
|
|
('install-protocol-dir=',None,"directory for tdeioslave protocol files"),
|
|
|
|
|
('build-dir=','b', "build directory (where to install from)"),
|
|
|
|
|
('root=', None, "install everything relative to this alternate root directory"),
|
|
|
|
|
('force', 'f', "force installation (overwrite existing files)"),
|
|
|
|
@ -1922,7 +1922,7 @@ class InstallKioslave(Command):
|
|
|
|
|
|
|
|
|
|
self.set_undefined_options('install',
|
|
|
|
|
('build_base', 'build_dir'),
|
|
|
|
|
('install_kioslave', 'install_dir'),
|
|
|
|
|
('install_tdeioslave', 'install_dir'),
|
|
|
|
|
('root', 'root'),
|
|
|
|
|
('force', 'force'),
|
|
|
|
|
('skip_build', 'skip_build'),
|
|
|
|
@ -1937,15 +1937,15 @@ class InstallKioslave(Command):
|
|
|
|
|
self.install_protocol_dir = change_root(self.root,self.install_protocol_dir)
|
|
|
|
|
|
|
|
|
|
def get_command_name(self):
|
|
|
|
|
return 'install_kioslave'
|
|
|
|
|
return 'install_tdeioslave'
|
|
|
|
|
|
|
|
|
|
def run(self):
|
|
|
|
|
if not self.skip_build:
|
|
|
|
|
self.run_command('build_kioslave')
|
|
|
|
|
self.run_command('build_tdeioslave')
|
|
|
|
|
|
|
|
|
|
self.announce("Installing Kioslave files...")
|
|
|
|
|
|
|
|
|
|
for moduletuple in self.distribution.kioslaves:
|
|
|
|
|
for moduletuple in self.distribution.tdeioslaves:
|
|
|
|
|
self.announce("Building Kioslave module from protocol file %s." % moduletuple[0])
|
|
|
|
|
|
|
|
|
|
protocolfilename = moduletuple[0]
|
|
|
|
@ -1963,7 +1963,7 @@ class InstallKioslave(Command):
|
|
|
|
|
pass
|
|
|
|
|
fhandle.close()
|
|
|
|
|
except IOError:
|
|
|
|
|
raise SystemExit, "Failed to find kioslave protocol file: %s" % moduletuple[0]
|
|
|
|
|
raise SystemExit, "Failed to find tdeioslave protocol file: %s" % moduletuple[0]
|
|
|
|
|
|
|
|
|
|
if libraryname is None:
|
|
|
|
|
raise SystemExit, "Failed to find library name (Was there a exec entry in the protocol file?)"
|
|
|
|
@ -2045,7 +2045,7 @@ class CheckPyTDE(Command):
|
|
|
|
|
self.announce("Checking for a working PyTDE...")
|
|
|
|
|
|
|
|
|
|
# Try to import modules one by one.
|
|
|
|
|
for k_module in ('dcop', 'tdecore', 'tdeui', 'kio', 'kfile', 'tdeparts', 'tdehtml', 'tdespell'):
|
|
|
|
|
for k_module in ('dcop', 'tdecore', 'tdeui', 'kio', 'tdefile', 'tdeparts', 'tdehtml', 'tdespell'):
|
|
|
|
|
self.announce(k_module)
|
|
|
|
|
try:
|
|
|
|
|
exec('import ' + k_module)
|
|
|
|
|