[Bug 1352230] Re: PKG_CONFIG_PATH in pkg-config-crosswrapper

yahuxo 1352230 at bugs.launchpad.net
Thu Oct 29 11:12:03 UTC 2015


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

** Bug watch added: freedesktop.org Bugzilla #3093
   https://bugs.freedesktop.org/show_bug.cgi?id=3093

** Patch added: "pkg-config-crosswrapper.patch"
   https://bugs.launchpad.net/ubuntu/+source/pkg-config/+bug/1352230/+attachment/4508318/+files/pkg-config-crosswrapper.patch

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to pkg-config in Ubuntu.
https://bugs.launchpad.net/bugs/1352230

Title:
  PKG_CONFIG_PATH in pkg-config-crosswrapper

Status in pkg-config package in Ubuntu:
  Confirmed

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?

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/pkg-config/+bug/1352230/+subscriptions



More information about the foundations-bugs mailing list