summaryrefslogtreecommitdiffstats
path: root/redhat/libraries/pytdeextensions
diff options
context:
space:
mode:
authorFrançois Andriot <albator78@libertysurf.fr>2013-12-28 17:33:42 +0100
committerFrançois Andriot <albator78@libertysurf.fr>2013-12-28 17:33:42 +0100
commitf2b702ffebf729f632c9fe8dadd8fa06660832d7 (patch)
treeaa22a785a863d87a3d96d3c1a085de79fd0b138f /redhat/libraries/pytdeextensions
parent43ed3b6077952745b04a8c749726871f7cd76142 (diff)
downloadtde-packaging-f2b702ffebf729f632c9fe8dadd8fa06660832d7.tar.gz
tde-packaging-f2b702ffebf729f632c9fe8dadd8fa06660832d7.zip
RPM Packaging: update python stuff
Diffstat (limited to 'redhat/libraries/pytdeextensions')
-rw-r--r--redhat/libraries/pytdeextensions/pytdeextensions-14.0.0-fix_extra_module_dir.patch41
-rw-r--r--redhat/libraries/pytdeextensions/pytdeextensions-14.0.0-python_tqt.patch33
-rw-r--r--redhat/libraries/pytdeextensions/pytdeextensions-14.0.0-tqt.patch58
-rw-r--r--redhat/libraries/pytdeextensions/pytdeextensions-14.0.0.spec32
4 files changed, 157 insertions, 7 deletions
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 <sip.h>
+
+ #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=