I also switched to using libtool v1.4. Nevertheless, I think that libtool in
combination with C++ is a can of worms (static constructors and
libtool don't match very well, because the order of linking might be
important).
Adapting the policy of NOT installing the *.la libraries for C++ libraries
works for me.
To build an RPM of PyQt-2.5pre1, I have to install libqtglcmodule-2.5.so
manually into $RPM_BUILD_ROOT/usr/lib/python2.1/site-packages because
libtool wants to relink asssuming that libqtcmodule is already installed.
That fails. (PyQt.spec file attached).
Gerard
On Monday 11 June 2001 23:57, Phil Thompson wrote:
> >===== Original Message From "Kaercher, Joerg" <[EMAIL PROTECTED]>
>
> =====
>
> >Thanks for your help. Linking qtcmodule solved the problem. However, it
> >still doesn't work. Now I get the following error message:
> >
> >Traceback (most recent call last):
> > File "<stdin>", line 1, in ?
> > File "b.py", line 6, in ?
> > import libbc
> >ImportError: /usr/local/lib/python2.1/site-packages/libbcmodule.so:
> >undefined symbol: __ti1b
> >
> >'b' is the name of the module and of the Qt class I want to create the
> >Python binding for. I noticed (with the help of khexedit) that the names
> > of all classes appear in the .so file with a leading __tiXX.
> >
> >Any ideas?
>
> I assume you are linking against your own library?
>
> (I think) you also have to have the right version of libtool that supports
> linking libtool libraries against other libtool libraries. I use v1.4.
>
> Phil
>
>
> _______________________________________________
> PyKDE mailing list [EMAIL PROTECTED]
> http://mats.gmd.de/mailman/listinfo/pykde
--
Gerard Vermeulen -- CRTBT -- BP 166 -- 38042 Grenoble Cedex 9 -- France
TEL: 33 (0)4 76 88 12 53 or 33 (0)4 76 88 12 61
FAX: 33 (0)4 76 87 50 60
http://www-crtbt.polycnrs-gre.fr/he3pol
# Assuming that your Python has a working re (? >= 1.5.2 ?).
# If your Python is prehistoric, then define %pyver by hand.
# Accept e.g. %pyver = 1.5.2, but chop a trailing a1, b1, a2, b2, ..
%{expand: %%define pyver %(python -c 'import re, sys; print re.search("^\d(\.\d)+", sys.version).group(0)')}
%{expand: %%define pydir %(python -c 'import sys; print sys.version[:3]')}
%define name PyQt
%define version 2.5
%define release 1mgv
%define major 5
Summary: Python bindings for Qt.
Name: %{name}
Version: %{version}
Release: %{release}
Copyright: GPL-like
Group: Development/Python
Source: http://www.river-bank.demon.co.uk/software/%{name}-%{version}pre1.tar.bz2
URL: http://www.thekompany.com/projects
BuildRoot: %{_tmppath}/%{name}-buildroot
BuildRequires: libsip%{major}-devel = %{version}, python = %{pyver}
Requires: python = %{pyver}, libsip%{major} = %{version} libtool = 1.4
%description
Python bindings for the Qt C++ class library.
%package devel
Summary: SIP specification files for Qt.
Group: Development/Languages/Python
%description devel
The SIP specification files for the Qt class library.
%prep
%setup -n %{name}-%{version}pre1
%build
%configure \
--with-qt-includes=/usr/lib/qt2/include \
--with-qt-libraries=/usr/lib/qt2/lib \
--with-qt-mocdir=/usr/lib/qt2/bin
# make sip(qt|qtgl)Version.h first, because the build chokes on my SMP machine
(cd qt; make sipqtVersion.h)
(cd qtgl; make sipqtglVersion.h)
%make
(cd doc; tar xvfz PyQt.html.tar.gz)
%install
rm -rf %{buildroot}
make SIP_PYQTGL_DIR="" DESTDIR=%{buildroot} install install-sip
# libtool again? install libqtglcmodule by hand.
(cd qtgl/.libs;
install -c libqtglcmodule-%{version}.so \
%{buildroot}%{_libdir}/python%{pydir}/site-packages)
(cd %{buildroot}%{_libdir}/python%{pydir}/site-packages;
ln -sf libqtglcmodule-%{version}.so libqtglcmodule.so)
(cd qtgl;
install -c -m 644 qtgl.py %{buildroot}%{_libdir}/python%{pydir}/site-packages
make DESTDIR=%{buildroot} install-data-hook)
# remove *.la, because C++ static constructors and libtool-1.4...
rm %{buildroot}/%{_libdir}/python*/site-packages/libqt*cmodule*.la
%clean
rm -rf %{buildroot}
%files
%defattr(-, root, root, 755)
%doc NEWS README doc/PyQt examples
%{_bindir}/*
%{_libdir}/python*/site-packages/eric
%{_libdir}/python*/site-packages/libqtcmodule*.so
%{_libdir}/python*/site-packages/libqtglcmodule*.so
%{_libdir}/python*/site-packages/qt.py*
%{_libdir}/python*/site-packages/qtgl.py*
%files devel
%defattr(-, root, root, 755)
%{_datadir}/sip/qt
%changelog
* Sat Jun 9 2001 Gerard Vermeulen <[EMAIL PROTECTED]> 2.5-1mgv
- have to install libqtglcmodule-2.5.so manually
- make sip(qt|qtgl)Version.h first, because build chokes on my SMP machine
- version 2.5pre1
* Mon May 28 2001 Gerard Vermeulen <[EMAIL PROTECTED]> 2.4-6mgv
- remove *.la, because C++ static constructors and libtool-1.4...
* Sun May 27 2001 Gerard Vermeulen <[EMAIL PROTECTED]> 2.4-5mgv
- build with libtool-1.4 exposed bug in sip.spec: CHECK paths in *.la files
* Mon Apr 23 2001 Gerard Vermeulen <[EMAIL PROTECTED]> 2.4-4mgv
- 2.4
* Thu Apr 10 2001 Gerard Vermeulen <[EMAIL PROTECTED]> 2.4-3mgv
- 2.4pre2
* Fri Apr 06 2001 Gerard Vermeulen <[EMAIL PROTECTED]> 2.4-2mgv
- merge David BAUDENS split of sip into sip, libsipMAJOR and libsipMAJOR-devel
- tweak BuildRequires and Requires
* Sun Mar 25 2001 Gerard Vermeulen <[EMAIL PROTECTED]> 2.4-1mgv
- 2.4pre1 for python-2.1
* Sun Feb 04 2001 Gerard Vermeulen <[EMAIL PROTECTED]> 2.3-2mgv
- tweak %%files
* Tue Oct 10 2000 Gerard Vermeulen <[EMAIL PROTECTED]> 2.2-1mgv
- mandrakization for 7.2
# EOF