x86_64-w64-mingw32-pkg-config ignores PKG_CONFIG_PATH

Bug #1327242 reported by KJ Tsanaktsidis
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
pkg-config
Fix Released
Undecided
戴华豪
mingw-w64 (Ubuntu)
Invalid
Undecided
戴华豪

Bug Description

The x86_64-w64-mingw32-pkg-config program (i.e. the mingw toolchain's pkg-config) ignores the PKG_CONFIG_PATH environment variable. This program is a simple shell script wrapper, and the offending line is as follows:

PKG_CONFIG_PATH=/usr/lib/${triplet}/pkgconfig:/usr/${triplet}/lib/pkgconfig pkg-config $@

This of course discards whatever PKG_CONFIG_PATH was set in the environment. This causes the cross compilation of VLC to fail, because it expects to be alble to link to libraries it provides by setting PKG_CONFIG_PATH. The solution is to change the x86_64-w64-mingw32-pkg-config script to do something like the following

if [ -n "$PKG_CONFIG_PATH" ]; then
    EXISTING=":$PKG_CONFIG_PATH"
fi
PKG_CONFIG_PATH=/usr/lib/${triplet}/pkgconfig:/usr/${triplet}/lib/pkgconfig${EXISTING} pkg-config $@

I'd submit a patch but i'm not entirely sure where and how to do it! If anyone has a few pointers on this that'd be great.

Environment:
Ubuntu 14.04 LTS
Package: mingw-w64-tools
Package version: 3.1.0-1

Revision history for this message
Stephen Kitt (steve-sk2) wrote :

Hi,

Thanks for reporting this, it's nice to see the pkg-config wrapper is useful!

The script is actually a symlink to /usr/share/pkg-config-crosswrapper, which is provided by the pkg-config package. Fixing that would improve the situation for every user of cross-pkg-config, so I'm reassigning this bug to pkg-config.

Regards,

Stephen

Revision history for this message
Dimitri John Ledkov (xnox) wrote :

In utopic, pkg-config-wrapper no longer uses PKG_CONFIG_PATH and instead uses PKG_CONFIG_LIBDIR, thus in utopic and later PKG_CONFIG_PATH is honored.

Changed in mingw-w64 (Ubuntu):
status: New → Invalid
Changed in pkg-config (Ubuntu):
status: New → Fix Released
Revision history for this message
Stephen Kitt (steve-sk2) wrote :

Thanks Dimitri!

Revision history for this message
KJ Tsanaktsidis (kjtsanaktsidis) wrote :

Oh cool :)

Is there a better way to get this fix into my Trusty install other than just manually changing the file to use PKG_CONFIG_LIBDIR?

戴华豪 (dhh78)
affects: pkg-config (Ubuntu) → pkg-config
Changed in pkg-config:
assignee: nobody → 戴华豪 (dhh78)
Changed in mingw-w64 (Ubuntu):
assignee: nobody → 戴华豪 (dhh78)
status: Invalid → In Progress
Stephen Kitt (steve-sk2)
Changed in mingw-w64 (Ubuntu):
status: In Progress → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.