Package: pkg-config
Followup-For: Bug #631275
User: [email protected]
Usertags: origin-ubuntu oneiric ubuntu-patch
Hi Tollef, Samuel,
Samuel, the current pkg-config package already provides everything needed in
order to correctly set the pkg-config search path: pkg.m4 uses
AC_PATH_TOOL(), which will look for a $host-pkg-config when cross compiling.
So you need only make $host-pkg-config available on your path, and this is
easy enough to do because /usr/share/pkg-config-crosswrapper is an
implementation of just such a wrapper, requiring you to add only a symlink.
However, there is a bug in the current implementation, in that it only sets
PKG_CONFIG_LIBDIR to a single directory where for transitional purposes we
want it to set PKG_CONFIG_PATH to include both the multiarch directory
(preferred) and the typical cross-compiler directory.
The attached patch implements this, and also sets pkg-control as Multi-Arch:
foreign, since it should be safe to assume that the native version of
pkg-config installed by default is the one we want except in the case of a
cross-build where we want to invoke it under a different name.
I am uploading this change to Ubuntu with the following changelog:
* debian/pkg-config-crosswrapper: fix to use PKG_CONFIG_PATH pointed to
both the multiarch path and the traditional cross-build path, instead of
just settting PKG_CONFIG_LIBDIR to the traditional cross-compiler path,
so that we can use this successfully in a multiarch environment.
Closes: #631275.
* debian/control: mark pkg-config Multi-Arch: allowed; it provides an
executable interface which points to architecture-dependent paths, but
those paths only need to be overridden in a cross-build environment, in
which case it's the responsibility of the cross-toolchain packages to
provide the appropriate glue.
You may want to do the same in Debian. Or, if you see any problems with
this patch, please let me know.
Thanks,
--
Steve Langasek Give me a lever long enough and a Free OS
Debian Developer to set it on, and I can move the world.
Ubuntu Developer http://www.debian.org/
[email protected] [email protected]
=== modified file 'debian/control'
--- debian/control 2011-05-15 14:37:09 +0000
+++ debian/control 2011-07-02 23:18:57 +0000
@@ -8,6 +8,7 @@
Package: pkg-config
Architecture: any
+Multi-Arch: foreign
Depends: ${shlibs:Depends}, ${misc:Depends}
Description: manage compile and link flags for libraries
pkg-config is a system for managing library compile and link flags that
=== modified file 'debian/pkg-config-crosswrapper'
--- debian/pkg-config-crosswrapper 2011-05-15 14:37:09 +0000
+++ debian/pkg-config-crosswrapper 2011-07-02 23:18:28 +0000
@@ -3,4 +3,4 @@
# Sets pkg-config search path to target arch path only.
triplet=`basename $0 | sed -e 's:-pkg-config::'`
-PKG_CONFIG_LIBDIR=/usr/${triplet}/lib/pkgconfig pkg-config $@
+PKG_CONFIG_PATH=/usr/lib/${triplet}/pkgconfig:/usr/${triplet}/lib/pkgconfig:/usr/lib/pkgconfig:/usr/share/pkgconfig
pkg-config $@
# Bazaar merge directive format 2 (Bazaar 0.90)
# revision_id: [email protected]\
# b8z5g4pynb9nnjig
# target_branch: :parent
# testament_sha1: 02e492b75279cc422e8f2b98efa72f4e1c605b04
# timestamp: 2011-07-02 16:25:41 -0700
# base_revision_id: [email protected]\
# ux12zpmh5swnf3v0
#
# Begin patch
=== modified file 'debian/changelog'
--- debian/changelog 2011-05-15 14:37:09 +0000
+++ debian/changelog 2011-07-02 23:24:55 +0000
@@ -1,3 +1,18 @@
+pkg-config (0.26-1ubuntu1) oneiric; urgency=low
+
+ * debian/pkg-config-crosswrapper: fix to use PKG_CONFIG_PATH pointed to
+ the multiarch path, the traditional cross-build path, and both of
+ /usr/lib/pkgconfig and /usr/share/pkgconfig, instead of just settting
+ PKG_CONFIG_LIBDIR to the traditional cross-compiler path, so that we can
+ use this successfully in a multiarch environment. Closes: #631275.
+ * debian/control: mark pkg-config Multi-Arch: foreign; it provides an
+ executable interface which points to architecture-dependent paths, but
+ those paths only need to be overridden in a cross-build environment, in
+ which case it's the responsibility of the cross-toolchain packages to
+ provide the appropriate glue.
+
+ -- Steve Langasek <[email protected]> Sat, 02 Jul 2011 16:24:53 -0700
+
pkg-config (0.26-1) unstable; urgency=low
* New upstream release
=== modified file 'debian/control'
--- debian/control 2011-05-15 14:37:09 +0000
+++ debian/control 2011-07-02 23:23:43 +0000
@@ -8,6 +8,7 @@
Package: pkg-config
Architecture: any
+Multi-Arch: foreign
Depends: ${shlibs:Depends}, ${misc:Depends}
Description: manage compile and link flags for libraries
pkg-config is a system for managing library compile and link flags that
=== modified file 'debian/pkg-config-crosswrapper'
--- debian/pkg-config-crosswrapper 2011-05-15 14:37:09 +0000
+++ debian/pkg-config-crosswrapper 2011-07-02 23:20:28 +0000
@@ -3,4 +3,4 @@
# Sets pkg-config search path to target arch path only.
triplet=`basename $0 | sed -e 's:-pkg-config::'`
-PKG_CONFIG_LIBDIR=/usr/${triplet}/lib/pkgconfig pkg-config $@
+PKG_CONFIG_PATH=/usr/lib/${triplet}/pkgconfig:/usr/${triplet}/lib/pkgconfig:/usr/lib/pkgconfig:/usr/share/pkgconfig
pkg-config $@
# Begin bundle
IyBCYXphYXIgcmV2aXNpb24gYnVuZGxlIHY0CiMKQlpoOTFBWSZTWes/QrgAB3lfgEAQXPf//3//
3gC////6YAwu+kUKUAAVQUgigPbAAAAJABqT1RkfqjT1AAGIAADTQNMgAADhppkYjCaYCGATTCME
xMhpkaGgGkpvVB6QANDRp6jQBo0AAaAAAEiSNFPJiaGomU3qbFTT01D9UbSP1PVGjamj1GGmUw4a
aZGIwmmAhgE0wjBMTIaZGhoAqUQCZACaaNEGSaaMlPKep5T0hoDJ6mnqeUJACfKWaE6iDWZA4mQQ
Y5OmwVPVBUdJR4Ew0shqUmKHjz3nxi15tJKpiLJbqZXWzjzOMzrSAsoKmzkvsCp4GytWd+OMtL8N
l9ZXZm75Ewkcub03TK9e01+KZHaGdtNDbYm2MuNx7hLS8ZouQ5NRRHkkdxmoo5p62VA1SDlFcoqY
Q6e4Wis1i1DJHUeXfH6r3Bg8TnLFj/l7XMsfWvXSxOzv9tZw/YuZsdq2WLX2qPRi2Sx5pg1tSrjx
Xv/NbFMFjFc3OW5+a5auYoq3s5YTmub1q5atlmlKUM9x4FAaiZfaUGXm17Y6aAcVan9jJiqDn5Hh
FO7Tuv9MvwSY25ZWpJ7n3uCsy9VVjxdVWKw9FxaHyntS8cn6puUEfE8lJ4prKKMJJe+IeJOiMzWb
j4GTiS9Lss65W+Jfd/6m8RRQyxykkaWJ5fr9e/uTrj27XV1Mp/FKtTCW1VtluqREQREREW6+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