PKG_CONFIG_PATH in pkg-config-crosswrapper

Bug #1352230 reported by mrw
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
pkg-config (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

I was wondering, why my Jenkins build failed after upgrade to Ubutnu 14.04, now I see that in pkg-config-crosswrapper my variable PKG_CONFIG_PATH is brutally overwritten.

How am I supposed to set a PKG_CONFIG_PATH in a cross-compile environment?

IMHO: PKG_CONFIG_PATH must not be overwritten in pkg-config-crosswrapper.

I now manually edited /usr/share/pkg-config-crosswrapper (added ":${PKG_CONFIG_PATH}") to become:
{{{
#! /bin/sh
# pkg-config wrapper for cross-building
# Sets pkg-config search path to target arch path only.

triplet=`basename $0 | sed -e 's:-pkg-config::'`
PKG_CONFIG_PATH=/usr/lib/${triplet}/pkgconfig:/usr/${triplet}/lib/pkgconfig:${PKG_CONFIG_PATH} pkg-config $@
}}}

My jenkins build script is:

{{{ (added ":${PKG_CONFIG_PATH}")
PKG_CONFIG_PATH=${HOME}/qt-${MINGW}/lib/pkgconfig \
  CPPFLAGS="-I${WORKSPACE}/usr/include" \
  LDFLAGS="-L${WORKSPACE}/usr/lib" \
  ./configure --prefix=${WORKSPACE}/usr --host=${MINGW}
make all install
}}}

Manually changing a package-provided file is a dirty hack. So do you change your code or do I have another/better way for providing my additional path?

Tags: patch
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in pkg-config (Ubuntu):
status: New → Confirmed
Revision history for this message
Yahuxo (yahuxo) wrote :

I also stumbled over this issue. In my opinion setting PKG_CONFIG_PATH is wrong for two reasons:
* it overwrites the PKG_CONFIG_PATH from the environment
* it makes pkg-config still search the non-cross-compile default paths

So for example if I want to cross-compile for mingw-w64 and do not have a cross-compiled version of "libsndfile" but a native version, calling "x86_64-w64-mingw32-pkg-config sndfile ..." will return the info for the native library and compilation will fail at a later step.

My suggested fix would be to use PKG_CONFIG_LIBDIR instead, see attached file "pkg-config-crosswrapper.patch" and https://bugs.freedesktop.org/show_bug.cgi?id=3093

Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "pkg-config-crosswrapper.patch" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
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.