Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 342 - use pkg-config instead of our python-config
Summary: use pkg-config instead of our python-config
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Dan Armak (RETIRED)
Depends on:
Reported: 2002-01-26 09:05 UTC by Mikael Hallendal (hallski) (RETIRED)
Modified: 2003-02-04 19:42 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Note You need to log in before you can comment on or make changes to this bug.
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:

import distutils.sysconfig, string

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:


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 
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.)