[PyQt4] use LIBDIR in addition to exec_prefix/lib for finding libpython

Rex Dieter rdieter at fedoraproject.org
Mon Jan 24 16:57:19 UTC 2011


commit 938f8df91588a1448edcb33b833579a1d12670ef
Author: Rex Dieter <rdieter at fedoraproject.org>
Date:   Mon Jan 24 10:56:17 2011 -0600

    use LIBDIR in addition to exec_prefix/lib for finding libpython

 PyQt-x11-gpl-4.8.3-python_libdir.patch |   25 +++++++++++++++++++++++++
 PyQt4.spec                             |    9 +++++++--
 2 files changed, 32 insertions(+), 2 deletions(-)
---
diff --git a/PyQt-x11-gpl-4.8.3-python_libdir.patch b/PyQt-x11-gpl-4.8.3-python_libdir.patch
new file mode 100644
index 0000000..bd2f59a
--- /dev/null
+++ b/PyQt-x11-gpl-4.8.3-python_libdir.patch
@@ -0,0 +1,25 @@
+diff -up PyQt-x11-gpl-4.8.3/configure.py.python_libdir PyQt-x11-gpl-4.8.3/configure.py
+--- PyQt-x11-gpl-4.8.3/configure.py.python_libdir	2011-01-23 04:08:20.000000000 -0600
++++ PyQt-x11-gpl-4.8.3/configure.py	2011-01-24 10:10:59.803217498 -0600
+@@ -940,13 +940,15 @@ include(%s)
+                     # We need to work out how to specify the right framework
+                     # version.
+                     link = "-framework Python"
+-                elif ("--enable-shared" in ducfg.get("CONFIG_ARGS", "") and
+-                      glob.glob("%s/lib/libpython%d.%d*" % (ducfg["exec_prefix"], py_major, py_minor))):
+-                    lib_dir_flag = quote("-L%s/lib" % ducfg["exec_prefix"])
++                elif ("--enable-shared" in ducfg.get("CONFIG_ARGS", "")):
++                    if (glob.glob("%s/lib/libpython%d.%d*" % (ducfg["exec_prefix"], py_major, py_minor))):
++                        lib_dir_flag = quote("-L%s/lib" % ducfg["exec_prefix"])
++                    elif (glob.glob("%s/libpython%d.%d*" % (ducfg["LIBDIR"], py_major, py_minor))):
++                        lib_dir_flag = quote("-L%s" % ducfg["LIBDIR"])
++                    else:
++                        sipconfig.inform("Qt Designer plugin disabled because Python library is static")
++                        opts.designer_plugin = False
+                     link = "%s -lpython%d.%d%s" % (lib_dir_flag, py_major, py_minor, abi)
+-                else:
+-                    sipconfig.inform("Qt Designer plugin disabled because Python library is static")
+-                    opts.designer_plugin = False
+ 
+                 pysh_lib = ducfg["LDLIBRARY"]
+ 
diff --git a/PyQt4.spec b/PyQt4.spec
index 3b4c813..d95dd85 100644
--- a/PyQt4.spec
+++ b/PyQt4.spec
@@ -18,8 +18,12 @@ Source0: http://www.riverbankcomputing.com/static/Downloads/PyQt4/PyQt-x11-gpl%{
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
 Patch4:  PyQt-x11-gpl-4.8.3-pyuic_shbang.patch
+
+## upstreamable patches
 # fix multilib conflict because of timestamp
-Patch5:  PyQt-x11-gpl-4.6.2-timestamp-multilib.patch
+Patch50:  PyQt-x11-gpl-4.6.2-timestamp-multilib.patch
+# use python's --libdir if available instead of assuming exec_prefix/lib
+Patch51: PyQt-x11-gpl-4.8.3-python_libdir.patch
 
 ## upstream patches
 
@@ -88,7 +92,8 @@ from any of the Qt4 classes (e.g. KDE or your own).
 %setup -q -n PyQt-x11-gpl%{?snap:-snapshot}-%{version}%{?snap:-%{snap}} 
 
 %patch4 -p1
-%patch5 -p1 -b .timestamp
+%patch50 -p1 -b .timestamp
+%patch51 -p1 -b .python_libdir
 
 ## permissions
 # mark examples non-executable


More information about the scm-commits mailing list