[PyKDE] PyQt-2.5 vs RH Rawhide's Python 2.2

Alan Eldridge alane at geeksrus.net
Sun Sep 30 12:30:39 BST 2001


I found a couple of problems building PyQt-2.5 on RH Rawhide, which has
Python-2.2.

1. The 'make install' wouldn't work. It failed because libtool decided, in
its infinite psychosis, that it needed to relink libqtglcmodule (I think
that was the name). This failed because the libqtcmodule.{la,so} files
weren't anywhere it could find them.

This is fixed by a patch to Makefile.am in the qtgl subdir. This problem
_looks_ like it should be pretty generic. Since no-one else is reporting it
to the list, I don't know.

---8<-snip---8<-snip---8<-snip---8<-snip---8<-snip---8<-snip---8<---
--- PyQt-2.5/qtgl/Makefile.am.or	Fri Aug 10 13:48:05 2001
+++ PyQt-2.5/qtgl/Makefile.am	Thu Sep 27 23:53:12 2001
@@ -191,7 +191,7 @@
 lib_LTLIBRARIES = libqtglcmodule.la
 libqtglcmodule_la_SOURCES = $(PYQTGL_SOURCES)
 libqtglcmodule_la_LDFLAGS = -release 2.5
-libqtglcmodule_la_LIBADD = -L../qt -lqtcmodule $(SIP_LDLIBDIRS) -lsip -lqt $(SIP_LDXFLAGS)
+libqtglcmodule_la_LIBADD = -L../qt -L../qt/.libs -lqtcmodule $(SIP_LDLIBDIRS) -lsip -lqt $(SIP_LDXFLAGS)
 
 install-data-hook:
 	(cd /tmp; PYTHONPATH=$(DESTDIR)$(datadir):$(DESTDIR)$(libdir) $(PYTHONINTERP) -O -c "import qtgl")
---8<-snip---8<-snip---8<-snip---8<-snip---8<-snip---8<-snip---8<---


2. The spec file needed some patching up to parameterize the python version,
so that things would be installed in the right directory. I made a few other
fixes while I had the patient open, some bowing to convention, and some
cosmetic. 

---8<-snip---8<-snip---8<-snip---8<-snip---8<-snip---8<-snip---8<---
--- PyQt.spec.or	Sun Sep 23 18:43:41 2001
+++ PyQt.spec	Sun Sep 30 06:25:29 2001
@@ -6,10 +6,14 @@
 Packager: Phil Thompson <phil at river-bank.demon.co.uk>
 Group: Development/Languages/Python
 Source: http://www.river-bank.demon.co.uk/software/%{name}-%{version}.tar.gz
+Patch0: PyQt-2.5-qtgl_LIBDIRS.patch
 URL: http://www.thekompany.com/projects/pykde/
-BuildRoot: /tmp/%{name}-%{version}-root
-Requires: sip = 2.5
-Prefix: /usr
+BuildRoot: %{_tmppath}/%{name}-%{version}-root
+Requires: sip = 2.5 
+BuildRequires: sip = 2.5 
+
+%define pyver 2.2
+BuildRequires: python = %{pyver}
 
 %description
 Python bindings for the Qt C++ class library.  Also includes a PyQt backend
@@ -24,34 +28,25 @@
 
 %prep
 %setup
+%patch0 -p1 -b .qtgl_LIBDIRS
 
 %build
-./configure --prefix=%{prefix}
+./configure --prefix=%{_prefix}
 make
 
 %install
-make DESTDIR=$RPM_BUILD_ROOT install install-sip install-doc
+mkdir -p $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}
+install -c -m 644 doc/PyQt/* $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}
+make DESTDIR=$RPM_BUILD_ROOT install install-sip # install-doc
 
 %clean
 rm -rf $RPM_BUILD_ROOT
 
 %files
-%attr(-,root,root) %{prefix}/bin/eric
-%attr(-,root,root) %{prefix}/bin/pyuic
-%attr(-,root,root) %{prefix}/doc/%{name}
-%attr(-,root,root) %{prefix}/lib/python2.2/site-packages/eric
-%attr(-,root,root) %{prefix}/lib/python2.2/site-packages/libqtcmodule-2.5.so
-%attr(-,root,root) %{prefix}/lib/python2.2/site-packages/libqtcmodule.la
-%attr(-,root,root) %{prefix}/lib/python2.2/site-packages/libqtcmodule.so
-%attr(-,root,root) %{prefix}/lib/python2.2/site-packages/qt.py
-%attr(-,root,root) %{prefix}/lib/python2.2/site-packages/qt.pyc
-%attr(-,root,root) %{prefix}/lib/python2.2/site-packages/qt.pyo
-%attr(-,root,root) %{prefix}/lib/python2.2/site-packages/libqtglcmodule-2.5.so
-%attr(-,root,root) %{prefix}/lib/python2.2/site-packages/libqtglcmodule.la
-%attr(-,root,root) %{prefix}/lib/python2.2/site-packages/libqtglcmodule.so
-%attr(-,root,root) %{prefix}/lib/python2.2/site-packages/qtgl.py
-%attr(-,root,root) %{prefix}/lib/python2.2/site-packages/qtgl.pyc
-%attr(-,root,root) %{prefix}/lib/python2.2/site-packages/qtgl.pyo
+%attr(-,root,root) %{_docdir}/*
+%docdir %attr(-,root,root) %{_docdir}
+%attr(-,root,root) %{_bindir}/*
+%attr(-,root,root) %{_libdir}/python%{pyver}/site-packages/*
 
 %files devel
-%attr(-,root,root) %{prefix}/share/sip/qt
+%attr(-,root,root) %{_prefix}/share/sip/qt
---8<-snip---8<-snip---8<-snip---8<-snip---8<-snip---8<-snip---8<---

I do not know if Phil has tested with Python-2.2 or not. I am just starting
to learn the library so I'm sure I'll find out about any crashers soon
enough.

I hope these patches prove useful to a few folks. I've sent them to Phil for
possible incorporation in 2.6; I haven't heard back yet as to their fate.

-- 
Alan Eldridge
from std_disclaimer import *




More information about the PyQt mailing list