Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 342

Summary: use pkg-config instead of our python-config
Product: Gentoo Linux Reporter: Mikael Hallendal (hallski) (RETIRED) <hallski>
Component: [OLD] DevelopmentAssignee: Dan Armak (RETIRED) <danarmak>
Status: RESOLVED FIXED    
Severity: normal    
Priority: High    
Version: unspecified   
Hardware: x86   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Mikael Hallendal (hallski) (RETIRED) gentoo-dev 2002-01-26 09:05:19 UTC
 
Comment 1 Mikael Hallendal (hallski) (RETIRED) gentoo-dev 2002-01-26 09:07:38 UTC
It looks like we are reinventing the wheel a little. We have python-config which
is our own stuff (let me know if it isn't). Currently this script only returns
the libraries to link against.

I think it would be better to drop the python-config script and use pkg-config
instead. pkg-config is becoming a standard for these kind of things and we would
then just install a .pc file and then do:

pkg-config --libs python       (-L /usr/lib/python2.2/config -lpython2.2 ...)
pkg-config --modversion python (2.2)
pkg-config --cflags            (-I/usr/include/python2.2)

--

The current python-config looks like this:

#!/usr/bin/python
import distutils.sysconfig, string
print
"-lpython2.2",string.join(string.split(distutils.sysconfig.get_config_var("MODLIBS")))

A question? Is this MODLIBS generated at installation time (of the
python-package)? If so we would exchange this scheme for a python.pc file which
would look something like:

prefix=/usr
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include

Name: Python
Description: Python language
Version: 2.2
Libs: -L/usr/lib -lpython2.2 -lreadline -lncurses -ldb-3.2 -lz
Cflags: -I${includedir}/python2.2
Comment 2 Dan Armak (RETIRED) gentoo-dev 2002-01-26 09:14:29 UTC
MODLIBS is a python thingy which returns the libs python is linked against. In other words, if you run this on a different installation you'll get a different output.We can also run python-config in e.g. pkg_postinst and integrate its output into the pkg-config definition file we create.
Comment 3 Dan Armak (RETIRED) gentoo-dev 2002-03-13 15:50:59 UTC
I don't think this's really needed. The thing that originally needed python-config, and which started 
this bug, was koffice. Its makefiles and configure script needed to be heavily patched and sed'ed to 
work with our python. 
 
However, the general KDE makefile system has since been improved and now handles our python correctly 
with the right configure parameter. This will go into the next koffice (1.2 to be released around 
July). 
 
AFAIK there's no real reason to move from python-config to pkg-config, except for standardization. 
But I don't see pkg-config being used much in Gentoo for other packages and so I'm closing this. If 
anyone thinks I'm wrong, reopen. (This is a way to test if anyone is interested in this being done, 
too - Azarah or anyone else who finds this bug later on.)