From f2b702ffebf729f632c9fe8dadd8fa06660832d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Andriot?= Date: Sat, 28 Dec 2013 17:33:42 +0100 Subject: RPM Packaging: update python stuff --- ...tdeextensions-14.0.0-fix_extra_module_dir.patch | 41 +++++++++++++++ .../pytdeextensions-14.0.0-python_tqt.patch | 33 ++++++++++++ .../pytdeextensions-14.0.0-tqt.patch | 58 ++++++++++++++++++++++ .../pytdeextensions/pytdeextensions-14.0.0.spec | 32 +++++++++--- .../python-trinity-14.0.0-python_tqt.patch | 11 ++++ .../python-trinity-14.0.0-sip4_tqt.patch | 23 +++++++++ .../python-trinity/python-trinity-14.0.0.spec | 31 ++++-------- 7 files changed, 200 insertions(+), 29 deletions(-) create mode 100644 redhat/libraries/pytdeextensions/pytdeextensions-14.0.0-fix_extra_module_dir.patch create mode 100644 redhat/libraries/pytdeextensions/pytdeextensions-14.0.0-python_tqt.patch create mode 100644 redhat/libraries/pytdeextensions/pytdeextensions-14.0.0-tqt.patch create mode 100644 redhat/libraries/python-trinity/python-trinity-14.0.0-python_tqt.patch create mode 100644 redhat/libraries/python-trinity/python-trinity-14.0.0-sip4_tqt.patch (limited to 'redhat/libraries') diff --git a/redhat/libraries/pytdeextensions/pytdeextensions-14.0.0-fix_extra_module_dir.patch b/redhat/libraries/pytdeextensions/pytdeextensions-14.0.0-fix_extra_module_dir.patch new file mode 100644 index 000000000..d72fdc928 --- /dev/null +++ b/redhat/libraries/pytdeextensions/pytdeextensions-14.0.0-fix_extra_module_dir.patch @@ -0,0 +1,41 @@ +--- pykdeextensions-3.5.13.1/src/kdedistutils.py.extramodule 2012-09-08 17:33:05.000000000 +0000 ++++ pykdeextensions-3.5.13.1/src/kdedistutils.py 2012-10-02 19:19:40.185384207 +0000 +@@ -712,6 +712,8 @@ + + # Build the 'stub' code. + cppcode = self.cpptemplate % {"moduledir": self.data_dir, ++ "extramodule": os.getenv("EXTRA_MODULE_DIR"), ++ "pyqt_dir": self.pyqt_dir, + "modulename": modulename, + "factoryfunction": factoryfunction, + "python_version": python_version} +@@ -854,6 +856,8 @@ + #include + + #define MODULE_DIR "%(moduledir)s" ++#define EXTRA_MODULE_DIR "%(extramodule)s" ++#define PYQT_DIR "%(pyqt_dir)s" + #define MODULE_NAME "%(modulename)s" + #define FACTORY "%(factoryfunction)s" + #define CPP_FACTORY %(factoryfunction)s +--- pykdeextensions-14.0.0/src/kdedistutils.py.ORI 2013-04-07 17:54:28.531813437 +0200 ++++ pykdeextensions-14.0.0/src/kdedistutils.py 2013-04-07 17:56:15.510529614 +0200 +@@ -903,6 +907,18 @@ + if(!pyize->appendToSysPath (path.latin1 ())) { + return report_error ("***Failed to set sys.path\n"); + } ++ ++ // Add the extra path to the python script to the interpreter search path. ++ TQString extrapath = TQString(EXTRA_MODULE_DIR); ++ if(!pyize->appendToSysPath (extrapath.latin1 ())) { ++ return report_error ("***Failed to set extra sys.path\n"); ++ } ++ ++ // Add the PYQT path to the python script to the interpreter search path. ++ TQString pyqt_dir = TQString(PYQT_DIR); ++ if(!pyize->appendToSysPath (pyqt_dir.latin1 ())) { ++ return report_error ("***Failed to set PYQT sys.path\n"); ++ } + + // Load the Python script. + PyObject *pyModule = pyize->importModule ((char *)script.latin1 ()); diff --git a/redhat/libraries/pytdeextensions/pytdeextensions-14.0.0-python_tqt.patch b/redhat/libraries/pytdeextensions/pytdeextensions-14.0.0-python_tqt.patch new file mode 100644 index 000000000..bcd6156df --- /dev/null +++ b/redhat/libraries/pytdeextensions/pytdeextensions-14.0.0-python_tqt.patch @@ -0,0 +1,33 @@ +--- pytdeextensions/src/qtuicompiler.py.ORI 2013-12-28 17:06:51.749357267 +0100 ++++ pytdeextensions/src/qtuicompiler.py 2013-12-28 17:07:03.539275908 +0100 +@@ -17,7 +17,7 @@ + + import os + import sys +-import pyqtconfig ++from python_tqt import pyqtconfig + from distutils.spawn import * + import traceback + +--- pytdeextensions/src/kdedistutils.py.ORI2 2013-12-28 17:20:38.828670001 +0100 ++++ pytdeextensions/src/kdedistutils.py 2013-12-28 17:21:04.731492545 +0100 +@@ -930,8 +930,8 @@ + } + + // Inject a helper function +- TQString bridge = TQString("import sip\n" +- "import qt\n" ++ TQString bridge = TQString("from sip4_tqt import sip\n" ++ "from python_tqt import qt\n" + "def kcontrol_bridge_" FACTORY "(parent,name):\n" + " if parent!=0:\n" + #if SIP_VERSION >= 0x040200 +@@ -2019,7 +2019,7 @@ + self.announce("Found Qt version %s." % qtver) + try: + self.announce("Checking for a working PyQt...") +- import qt ++ from python_tqt import qt + self.announce(" ...PyQt is working") + except: + raise SystemExit, "Couldn't import Qt! Please make sure that PyQt is installed and working." diff --git a/redhat/libraries/pytdeextensions/pytdeextensions-14.0.0-tqt.patch b/redhat/libraries/pytdeextensions/pytdeextensions-14.0.0-tqt.patch new file mode 100644 index 000000000..7b004d8c5 --- /dev/null +++ b/redhat/libraries/pytdeextensions/pytdeextensions-14.0.0-tqt.patch @@ -0,0 +1,58 @@ +--- pytdeextensions/src/kdedistutils.py.ORI 2013-12-28 14:50:50.209401866 +0100 ++++ pytdeextensions/src/kdedistutils.py 2013-12-28 15:36:18.381316251 +0100 +@@ -892,7 +892,7 @@ + return NULL; + } + +-static TDECModule* return_instance( QWidget *parent, const char *name ) { ++static TDECModule* return_instance( TQWidget *parent, const char *name ) { + TDECModule* tdecmodule; + PyObject *pyTDECModuleTuple; + PyObject *pyTDECModule; +@@ -901,7 +901,7 @@ + + // Try to determine what py script we're loading. Note that "name" + // typically appears to be NULL. +- QString script(MODULE_NAME); ++ TQString script(MODULE_NAME); + + // Reload libpython, but this time tell the runtime linker to make the + // symbols global and available for later loaded libraries/module. +@@ -914,8 +914,8 @@ + } + + // Add the path to the python script to the interpreter search path. +- QString path = QString(MODULE_DIR); +- if(path == QString::null) { ++ TQString path = TQString(MODULE_DIR); ++ if(path == TQString::null) { + return report_error ("***Failed to locate script path"); + } + if(!pyize->appendToSysPath (path.latin1 ())) { +@@ -930,14 +930,14 @@ + } + + // Inject a helper function +- QString bridge = QString("import sip\n" ++ TQString bridge = TQString("import sip\n" + "import qt\n" + "def kcontrol_bridge_" FACTORY "(parent,name):\n" + " if parent!=0:\n" + #if SIP_VERSION >= 0x040200 +- " wparent = sip.wrapinstance(parent,qt.QWidget)\n" ++ " wparent = sip.wrapinstance(parent,qt.TQWidget)\n" + #else +- " wparent = sip.wrapinstance(parent,'QWidget')\n" ++ " wparent = sip.wrapinstance(parent,'TQWidget')\n" + #endif + " else:\n" + " wparent = None\n" +@@ -997,7 +997,7 @@ + + extern "C" { + // Factory function that kcontrol will call. +- TDECModule* CPP_FACTORY(QWidget *parent, const char *name) { ++ TDECModule* CPP_FACTORY(TQWidget *parent, const char *name) { + return return_instance(parent, name); + } + } diff --git a/redhat/libraries/pytdeextensions/pytdeextensions-14.0.0.spec b/redhat/libraries/pytdeextensions/pytdeextensions-14.0.0.spec index 18944cbbe..a9c083d18 100644 --- a/redhat/libraries/pytdeextensions/pytdeextensions-14.0.0.spec +++ b/redhat/libraries/pytdeextensions/pytdeextensions-14.0.0.spec @@ -41,9 +41,11 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) Source0: %{name}-%{tde_version}%{?preversion:~%{preversion}}.tar.gz - +# [pytdeextensions] Port to TQT3 +Patch1: pytdeextensions-14.0.0-tqt.patch +Patch2: pytdeextensions-14.0.0-python_tqt.patch # [pykdeextensions] Fix hardcoded path to Guidance python libraries [Bug #999] -Patch2: pykdeextensions-3.5.13.2-fix_extra_module_dir.patch +Patch3: pytdeextensions-14.0.0-fix_extra_module_dir.patch # [pykdeextensions] Fix include directory search location Patch5: pytdeextensions-14.0.0-fix_include_dir.patch @@ -56,9 +58,16 @@ BuildRequires: gettext BuildRequires: trinity-python-tqt-devel BuildRequires: trinity-python-trinity-devel BuildRequires: trinity-pytqt-tools +Requires: trinity-python-tqt +Requires: trinity-python-trinity Requires: trinity-libpythonize0 = %{version}-%{release} +# SIP +BuildRequires: trinity-sip4-tqt-devel >= 4.10.5 +Requires: trinity-sip4-tqt >= 4.10.5 + + Obsoletes: trinity-pykdeextensions < %{version}-%{release} Provides: trinity-pykdeextensions = %{version}-%{release} @@ -145,19 +154,23 @@ Requires: trinity-libpythonize0-devel = %{version}-%{release} %prep %setup -q -n %{name}-%{tde_version}%{?preversion:~%{preversion}} -%patch2 -p1 -b .extramodule +%patch1 -p1 -b .tqt3 +%patch2 -p1 -b .pythontqt +%patch3 -p1 -b .extramodule %patch5 -p1 -b .incdir # Changes library directory to 'lib64' # Also other fixes for distributions ... for f in src/*.py; do %__sed -i "${f}" \ - -e "s|%{tde_prefix}/lib/|%{tde_libdir}/|g" \ - -e "s|/usr/lib/pyshared/python\*|%{python_sitearch}|g" \ + -e "s|'pyqt-dir='.*'|'pyqt-dir=','%{python_sitearch}/python_tqt'|g" \ + -e "s|self.pyqt_dir = .*|self.pyqt_dir = \"%{python_sitearch}/python_tqt\"|g" \ -e "s|'pytde-dir=',None,|'pytde-dir=','%{python_sitearch}',|g" \ -e "s|self.pytde_dir = None|self.pytde_dir = \"%{python_sitearch}\"|g" \ - -e "s|%{tde_includedir}/kde|%{tde_tdeincludedir}|g" \ - -e 's|"/kde"|"/tde"|' + -e "s|%{tde_includedir}/tde|%{tde_tdeincludedir}|g" \ + -e 's|"/kde"|"/tde"|' \ + -e 's|"-I" + self.kde_inc_dir + "/tde"|"-I/opt/trinity/include"|' \ + -e "s|/usr/lib/pyshared/python\*|%{python_sitearch}|g" done # Do not look for 'libpython2.x.so' (from -devel) package. @@ -176,9 +189,14 @@ export PATH="%{tde_bindir}:${PATH}" %__mkdir_p build ./setup.py build_libpythonize + %install unset QTDIR QTINC QTLIB export PATH="%{tde_bindir}:${PATH}" +#export PYTHONPATH=%{python_sitearch}/python-tqt + +# Support for 'sip4-tqt' +#export PYTHONPATH=%{python_sitearch}/sip4_tqt:${PYTHONPATH} # Avoids 'error: byte-compiling is disabled.' on Mandriva/Mageia export PYTHONDONTWRITEBYTECODE= diff --git a/redhat/libraries/python-trinity/python-trinity-14.0.0-python_tqt.patch b/redhat/libraries/python-trinity/python-trinity-14.0.0-python_tqt.patch new file mode 100644 index 000000000..361a00a35 --- /dev/null +++ b/redhat/libraries/python-trinity/python-trinity-14.0.0-python_tqt.patch @@ -0,0 +1,11 @@ +--- python-trinity/configure.py.ORI2 2013-12-28 17:02:32.849146767 +0100 ++++ python-trinity/configure.py 2013-12-28 17:02:44.143068602 +0100 +@@ -37,7 +37,7 @@ + sys.exit (-1) + + try: +- import pyqtconfig ++ from python_tqt import pyqtconfig + except: + sipconfig.error ("Can't find pyqtconfig.py in sys.path - exiting") + diff --git a/redhat/libraries/python-trinity/python-trinity-14.0.0-sip4_tqt.patch b/redhat/libraries/python-trinity/python-trinity-14.0.0-sip4_tqt.patch new file mode 100644 index 000000000..e73fbdff0 --- /dev/null +++ b/redhat/libraries/python-trinity/python-trinity-14.0.0-sip4_tqt.patch @@ -0,0 +1,23 @@ +--- python-trinity/configure.py.ORI 2013-12-28 15:55:54.269299304 +0100 ++++ python-trinity/configure.py 2013-12-28 15:56:05.611221484 +0100 +@@ -30,7 +30,7 @@ + import py_compile + + try: +- import sipconfig ++ from sip4_tqt import sipconfig + except: + print ("Can't find sipconfig.py (expected in sys.path)") + print ("Have you built the correct version of sip?") +--- python-trinity/pytdeconfig.py.in.ORI 2013-12-28 15:57:53.618481027 +0100 ++++ python-trinity/pytdeconfig.py.in 2013-12-28 15:58:05.467399833 +0100 +@@ -22,7 +22,8 @@ + # modules that %Import PyKDE modules. + + +-import sipconfig, pyqtconfig ++from sip4_tqt import sipconfig ++import pyqtconfig + + + # These are installation specific values created when PyTQt was configured. diff --git a/redhat/libraries/python-trinity/python-trinity-14.0.0.spec b/redhat/libraries/python-trinity/python-trinity-14.0.0.spec index 978c6e036..0b2b65586 100644 --- a/redhat/libraries/python-trinity/python-trinity-14.0.0.spec +++ b/redhat/libraries/python-trinity/python-trinity-14.0.0.spec @@ -43,8 +43,8 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) Source0: %{name}-%{tde_version}%{?preversion:~%{preversion}}.tar.gz -#Patch0: python-trinity-14.0.0-ftbfs.patch -#Patch1: python-trinity-14.0.0-ftbfs2.patch +Patch1: python-trinity-14.0.0-sip4_tqt.patch +Patch2: python-trinity-14.0.0-python_tqt.patch BuildRequires: trinity-tqtinterface-devel >= %{tde_version} BuildRequires: trinity-arts-devel >= 1:1.5.10 @@ -55,22 +55,11 @@ BuildRequires: gettext # PYTHON support BuildRequires: python BuildRequires: trinity-python-tqt-devel +Requires: trinity-python-tqt - -# SIP support -%if 0%{?rhel} >= 4 && 0%{?rhel} <= 5 -# RHEL 4/5 comes with old version, so we brought ours ... -BuildRequires: trinity-sip-devel -%endif -%if 0%{?mgaversion} || 0%{?mdkversion} -BuildRequires: python-sip -%endif -%if 0%{?rhel} >= 6 || 0%{?fedora} -BuildRequires: sip-devel -%endif -%if 0%{?suse_version} -BuildRequires: python-sip-devel -%endif +# SIP +BuildRequires: trinity-sip4-tqt-devel >= 4.10.5 +Requires: trinity-sip4-tqt >= 4.10.5 Obsoletes: python-trinity < %{version}-%{release} Provides: python-trinity = %{version}-%{release} @@ -78,7 +67,7 @@ Provides: python-trinity = %{version}-%{release} %description Python binding module that provides wide access to the Trinity API, also known as PyTDE. Using this, you'll get (for example) classes -from kio, kjs, khtml and kprint. +from tdeio, tdejs, tdehtml and tdeprint. %package devel @@ -116,10 +105,8 @@ tips and working code you can use to learn from. %prep %setup -q -n %{name}-%{tde_version}%{?preversion:~%{preversion}} -%if 0%{?suse_version} == 1310 -#patch0 -p1 -b .ftbfs -#patch1 -p1 -b .ftbfs -%endif +%patch1 -p1 -b .sip4tqt +%patch2 -p1 -b .pythontqt %build -- cgit v1.2.3