This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: pkg-config support
Type: enhancement Stage:
Components: Build Versions: Python 2.6
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: ClintonRoy, amaury.forgeotdarc, barry, loewis, pitrou, sol
Priority: normal Keywords: needs review, patch

Created on 2008-08-18 01:03 by ClintonRoy, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
pkgconfig.diff ClintonRoy, 2008-08-18 01:03
pkgconfig.diff ClintonRoy, 2008-08-19 00:21
pkgconfig.diff ClintonRoy, 2008-09-04 00:07
pkgconfig.diff ClintonRoy, 2009-05-24 19:57
Messages (21)
msg71305 - (view) Author: Clinton Roy (ClintonRoy) * Date: 2008-08-18 01:03
This patch adds pkg-config support to the python build, a python.pc file
is installed in the pkgconfig directory such that autoconf buildsystems
can trivially link against the python library.

Diff made against revision 65796
msg71321 - (view) Author: Amaury Forgeot d'Arc (amaury.forgeotdarc) * (Python committer) Date: 2008-08-18 11:54
I cannot discuss about the feature itself, but the patch should
certainly use some macro ($(VERSION) ?) instead of the hardcoded "2.6".
Likewise, source files should not contain version number in their names,
or they cannot be merged between branches.
msg71396 - (view) Author: Clinton Roy (ClintonRoy) * Date: 2008-08-19 00:21
Thanks for the comments Amaury, this patch uses ${VERSION} throughout so
that it can be applied across branches.

cheers,
msg72440 - (view) Author: Clinton Roy (ClintonRoy) * Date: 2008-09-04 00:07
This version sets Libs.private for static compiles.

Any chance this will make it into the 2.6/3.0 release candidates ?

cheers,
msg79101 - (view) Author: Clinton Roy (ClintonRoy) * Date: 2009-01-05 01:50
Is there anything I can do to move this forward at all?

cheers,
msg79114 - (view) Author: Amaury Forgeot d'Arc (amaury.forgeotdarc) * (Python committer) Date: 2009-01-05 09:29
The patch looks fine to me. I have however some questions to ask to
someone more used to pkgconfig:

- Do all unix-like system support pkg-config?

- Is $(LIBDIR)/pkgconfig the only choice for installing this file?

- Shouldn't this file be installed only if the pkg-config utility is
present, or if the directory $(LIBDIR)/pkgconfig already exists?
msg82743 - (view) Author: Clinton Roy (ClintonRoy) * Date: 2009-02-26 06:07
Oh, you meant for me to reply =)

- Do all unix-like system support pkg-config?

Yes. It even works on windows.

- Is $(LIBDIR)/pkgconfig the only choice for installing this file?

While pkg-config can be told to look in other directories for pc files
(via modifying the PKGCONFIGPATH env variable) it looks in
/usr/lib/pkgconfig by default, so that's where pc files should be put by
default.

- Shouldn't this file be installed only if the pkg-config utility is
present, or if the directory $(LIBDIR)/pkgconfig already exists?

Technically I suppose so, but I've not seen any package actually bother.

The patches I have made available are very similar to pkg-config
packages I've seen for many other packages.

cheers,
msg87217 - (view) Author: (sol) Date: 2009-05-05 07:51
>> - Shouldn't this file be installed only if the pkg-config utility is
>> present, or if the directory $(LIBDIR)/pkgconfig already exists?
>
> Technically I suppose so
>

That would mean that, if you first install Python and afterwards
pkg-config, pkg-config would not work for Python, right? I'm not sure if
that would be desirable.
msg87230 - (view) Author: Clinton Roy (ClintonRoy) * Date: 2009-05-05 09:05
Hi Sol,

It's just a data file I suppose, Python should not need a dependency on
pkg-config, and neither should there be a python-pkgconfig package that
just contains the python.pc file.

I think the approach to just always install the python.pc file is the
right one.
msg88072 - (view) Author: (sol) Date: 2009-05-19 07:36
I totally agree.
msg88075 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2009-05-19 07:52
Patch looks good here.
msg88266 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2009-05-24 16:09
Is there any reason in versioning Misc/python.pc, instead of versioning
it only on install?
msg88278 - (view) Author: Clinton Roy (ClintonRoy) * Date: 2009-05-24 19:57
Not that I can see, or remember. Revised patch attached. Tyop fixed as well.

Please note there seem to be some issues with svn head atm,
pyconfig.h.in and configure would seem to be out of whack with
configure.in, this patch does not include changes to those generated files.
msg88280 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2009-05-24 20:39
The patch is committed in trunk (r72898) and py3k (r72899). Thanks!
msg88517 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2009-05-29 16:48
Antoine: Don't use autoconf 2.63 to generate pyconfig.h.in and
configure. Use 2.61 instead (until it is agreed to switch to a newer
version).
msg88519 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2009-05-29 17:57
> Antoine: Don't use autoconf 2.63 to generate pyconfig.h.in and
> configure. Use 2.61 instead (until it is agreed to switch to a newer
> version).

Oops, sorry. Are there any known issues with 2.63?
msg88543 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2009-05-29 22:34
> Oops, sorry. Are there any known issues with 2.63?

Yes: it puts a carriage-return character into configure
which completely confuses subversion.

I'm puzzled how you were able to commit the generated
files; subversion should have reported an error

svn: File 'configure' has inconsistent newlines
svn: Inconsistent line ending style

See

http://mail.python.org/pipermail/python-dev/2008-November/083781.html
msg88544 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2009-05-29 22:38
> Yes: it puts a carriage-return character into configure
> which completely confuses subversion.
> 
> I'm puzzled how you were able to commit the generated
> files; subversion should have reported an error
> 
> svn: File 'configure' has inconsistent newlines
> svn: Inconsistent line ending style

I did get that message (and got puzzled by it).
I worked around it by reading the file in universal newlines mode and
saving it again.
msg88549 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2009-05-29 23:04
> I did get that message (and got puzzled by it).
> I worked around it by reading the file in universal newlines mode and
> saving it again.

I believe this has broken part of the configure script. There is an
ac_cr variable that is supposed to hold a sole carriage-return
character; it now holds a newline character instead. This will break
the test whether the system autoconf deals with carriage-return
characters correctly, which probably means that it may decide to use
awk to do file substitution when it should have been using /bin/sh,
or vice versa (I haven't fully understood the purpose of this test).
msg88550 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2009-05-29 23:16
Ouch, unfortunately it seems my distribution doesn't package autoconf
2.61. Is there any risk in installing it from scratch?
msg88554 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2009-05-29 23:50
> Ouch, unfortunately it seems my distribution doesn't package autoconf
> 2.61. Is there any risk in installing it from scratch?

I usually install it into a private location, such as ~/ac261. This is
absolutely safe.
History
Date User Action Args
2022-04-11 14:56:37adminsetgithub: 47835
2013-01-16 15:07:05barrysetnosy: + barry
2009-05-29 23:50:03loewissetmessages: + msg88554
2009-05-29 23:16:01pitrousetmessages: + msg88550
2009-05-29 23:04:07loewissetmessages: + msg88549
2009-05-29 22:38:58pitrousetmessages: + msg88544
2009-05-29 22:34:55loewissetmessages: + msg88543
2009-05-29 17:57:15pitrousetmessages: + msg88519
2009-05-29 16:48:01loewissetnosy: + loewis
messages: + msg88517
2009-05-24 20:39:52pitrousetstatus: open -> closed
resolution: fixed
messages: + msg88280
2009-05-24 19:57:24ClintonRoysetfiles: + pkgconfig.diff

messages: + msg88278
2009-05-24 16:09:53pitrousetmessages: + msg88266
2009-05-19 07:52:11pitrousetnosy: + pitrou
messages: + msg88075
2009-05-19 07:36:45solsetmessages: + msg88072
2009-05-05 09:05:57ClintonRoysetmessages: + msg87230
2009-05-05 07:51:52solsetnosy: + sol
messages: + msg87217
2009-02-26 06:08:01ClintonRoysetmessages: + msg82743
2009-01-05 09:29:44amaury.forgeotdarcsetkeywords: + needs review
messages: + msg79114
2009-01-05 01:50:31ClintonRoysetmessages: + msg79101
2008-09-04 00:07:09ClintonRoysetfiles: + pkgconfig.diff
messages: + msg72440
2008-08-19 00:21:26ClintonRoysetfiles: + pkgconfig.diff
messages: + msg71396
2008-08-18 11:54:19amaury.forgeotdarcsetnosy: + amaury.forgeotdarc
messages: + msg71321
2008-08-18 01:03:28ClintonRoycreate