Subject: Re: pyGTK [was Re: which libtool to use for kde2?]
To: Nick Hudson <nick@nthcliff.demon.co.uk>
From: Love <lha@stacken.kth.se>
List: tech-pkg
Date: 11/18/2000 09:23:57
Nick Hudson <nick@nthcliff.demon.co.uk> writes:

> Love wrote:
> > 
> > Include in pkg/11338 there is change to libtool that enable to build shared
> > libs without the prefix `lib' and w/o version numbers.
> > 
> > It is needed to make things link pygtk work.
> 
> Have you tried x11/gnome-python which includes pyGTK? This package
> exists without libtool changes.

Great then you can close my pr as soon the libtool stuff is ironed out. It
exist, yes, but it doesn't work (see below) since libtool refuses to create
shared libs.
 
> As far as the libtool changes go need_lib_unknown is fine and I'm
> hesitant to change need_version.

I assume you meant need_lib_prefix=no.

need_version is used when using -avoid-version, if not set, there will be a
version set the lib. Then dlopen wont be able to find the .so files since
it's not named .so, but .so.0.0 .

need_version is also used when specifying -release, but then the
versionnumber is encoded in the name (libfoo-N.N.so).

Note that guile will have the same problem as pyhton when using modules in
guile '(use-modules ((foo))'.

This is with unchanged libtool:

: lha@nutcracker ; pkg_info -L gnome-python| grep lib.*\\.a
/usr/pkg/lib/python1.5/site-packages/lib_gtkmodule.a
/usr/pkg/lib/python1.5/site-packages/lib_gdkimlibmodule.a
/usr/pkg/lib/python1.5/site-packages/lib_gtkglmodule.a
/usr/pkg/lib/python1.5/site-packages/lib_libglademodule.a
/usr/pkg/lib/python1.5/site-packages/lib_gnomemodule.a
/usr/pkg/lib/python1.5/site-packages/lib_gnomeuimodule.a
/usr/pkg/lib/python1.5/site-packages/lib_zvtmodule.a
/usr/pkg/lib/python1.5/site-packages/lib_gtkxmhtmlmodule.a
/usr/pkg/lib/python1.5/site-packages/lib_appletmodule.a
/usr/pkg/lib/python1.5/site-packages/lib_cappletmodule.a
/usr/pkg/lib/python1.5/site-packages/lib_gladegnomemodule.a
: lha@nutcracker ; python
Python 1.5.2 (#1, Oct 26 2000, 21:10:37)  [GCC egcs-2.91.66 19990314 (egcs-1.1.2 release)] on netbsd1
Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam
>>> from gtk import *
Traceback (innermost last):
  File "<stdin>", line 1, in ?
  File "/usr/pkg/lib/python1.5/site-packages/gtk.py", line 21, in ?
    import _gtk
ImportError: No module named _gtk

After rebuilding libtool with my changes and changing PLIST now
the modules are installed as shared libs.

: lha@nutcracker ; pkg_info -L gnome-python | grep .so\$
/usr/pkg/lib/python1.5/site-packages/_gtkmodule.so
/usr/pkg/lib/python1.5/site-packages/_gdkimlibmodule.so
/usr/pkg/lib/python1.5/site-packages/_gtkglmodule.so
/usr/pkg/lib/python1.5/site-packages/_libglademodule.so
/usr/pkg/lib/python1.5/site-packages/_gnomemodule.so
/usr/pkg/lib/python1.5/site-packages/_gnomeuimodule.so
/usr/pkg/lib/python1.5/site-packages/_zvtmodule.so
/usr/pkg/lib/python1.5/site-packages/_gtkxmhtmlmodule.so
/usr/pkg/lib/python1.5/site-packages/_appletmodule.so
/usr/pkg/lib/python1.5/site-packages/_cappletmodule.so
/usr/pkg/lib/python1.5/site-packages/_gladegnomemodule.so
: lha@nutcracker ; python
Python 1.5.2 (#1, Oct 26 2000, 21:10:37)  [GCC egcs-2.91.66 19990314 (egcs-1.1.2 release)] on netbsd1
Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam
>>> from gtk import *
>>> 


Below there is the changes that I did. A depenency on the new libtool is
needed too.

Love




Index: Makefile
===================================================================
RCS file: /cvsroot/pkgsrc/x11/gnome-python/Makefile,v
retrieving revision 1.12
diff -w -u -r1.12 Makefile
--- Makefile    2000/06/05 19:52:31     1.12
+++ Makefile    2000/11/18 08:04:47
@@ -17,6 +17,8 @@
 GNU_CONFIGURE= yes
 USE_X11=       yes
 USE_GMAKE=     yes
+USE_LIBTOOL=    yes
+LTCONFIG_OVERRIDE=${WRKSRC}/ltconfig
 
 .include "../../mk/bsd.prefs.mk"
 
Index: pkg/PLIST
===================================================================
RCS file: /cvsroot/pkgsrc/x11/gnome-python/pkg/PLIST,v
retrieving revision 1.4
diff -w -u -r1.4 PLIST
--- PLIST       2000/06/05 19:52:33     1.4
+++ PLIST       2000/11/18 08:04:47
@@ -17,27 +17,27 @@
 lib/python1.5/site-packages/Gtkinter.pyc
 lib/python1.5/site-packages/Gtkinter.pyo
 lib/python1.5/site-packages/_gtkmodule.la
-lib/python1.5/site-packages/lib_gtkmodule.a
+lib/python1.5/site-packages/_gtkmodule.so
 lib/python1.5/site-packages/_gdkimlibmodule.la
-lib/python1.5/site-packages/lib_gdkimlibmodule.a
+lib/python1.5/site-packages/_gdkimlibmodule.so
 lib/python1.5/site-packages/_gtkglmodule.la
-lib/python1.5/site-packages/lib_gtkglmodule.a
+lib/python1.5/site-packages/_gtkglmodule.so
 lib/python1.5/site-packages/_libglademodule.la
-lib/python1.5/site-packages/lib_libglademodule.a
+lib/python1.5/site-packages/_libglademodule.so
 lib/python1.5/site-packages/_gnomemodule.la
-lib/python1.5/site-packages/lib_gnomemodule.a
+lib/python1.5/site-packages/_gnomemodule.so
 lib/python1.5/site-packages/_gnomeuimodule.la
-lib/python1.5/site-packages/lib_gnomeuimodule.a
+lib/python1.5/site-packages/_gnomeuimodule.so
 lib/python1.5/site-packages/_zvtmodule.la
-lib/python1.5/site-packages/lib_zvtmodule.a
+lib/python1.5/site-packages/_zvtmodule.so
 lib/python1.5/site-packages/_gtkxmhtmlmodule.la
-lib/python1.5/site-packages/lib_gtkxmhtmlmodule.a
+lib/python1.5/site-packages/_gtkxmhtmlmodule.so
 lib/python1.5/site-packages/_appletmodule.la
-lib/python1.5/site-packages/lib_appletmodule.a
+lib/python1.5/site-packages/_appletmodule.so
 lib/python1.5/site-packages/_cappletmodule.la
-lib/python1.5/site-packages/lib_cappletmodule.a
+lib/python1.5/site-packages/_cappletmodule.so
 lib/python1.5/site-packages/_gladegnomemodule.la
-lib/python1.5/site-packages/lib_gladegnomemodule.a
+lib/python1.5/site-packages/_gladegnomemodule.so
 lib/python1.5/site-packages/gettext.py
 lib/python1.5/site-packages/gettext.pyc
 lib/python1.5/site-packages/gettext.pyo