--- pkg-config-0.29.2.orig/.gitignore
+++ pkg-config-0.29.2/.gitignore
@@ -0,0 +1 @@
+*~
--- pkg-config-0.29.2.orig/check/check-print-options
+++ pkg-config-0.29.2/check/check-print-options
@@ -35,9 +35,9 @@
 run_test --print-requires-private requires-test
 
 # --list-all, limit to a subdirectory
-RESULT="sub1   Subdirectory package 1 - Test package 1 for subdirectory
-sub2   Subdirectory package 2 - Test package 2 for subdirectory
-broken Broken package - Module with broken .pc file"
+RESULT="broken Broken package - Module with broken .pc file
+sub1   Subdirectory package 1 - Test package 1 for subdirectory
+sub2   Subdirectory package 2 - Test package 2 for subdirectory"
 PKG_CONFIG_LIBDIR="$srcdir/sub" run_test --list-all
 
 # Check handling when multiple incompatible options are set
--- pkg-config-0.29.2.orig/debian/changelog
+++ pkg-config-0.29.2/debian/changelog
@@ -0,0 +1,463 @@
+pkg-config (0.29.2-1ubuntu2) impish; urgency=medium
+
+  * No-change rebuild to build packages with zstd compression.
+
+ -- Matthias Klose <doko@ubuntu.com>  Thu, 07 Oct 2021 12:22:23 +0200
+
+pkg-config (0.29.2-1ubuntu1) groovy; urgency=low
+
+  * Merge from Debian unstable.  Remaining changes:
+    - On Ubuntu, in pkg-config-crosswrapper add /usr/lib/pkgconfig to
+    PKG_CONFIG_LIBDIR. As a lot of packages that are cross-build on
+    regular basis rely on cross-building with non-multiarched libraries.
+
+ -- Gianfranco Costamagna <locutusofborg@debian.org>  Sun, 26 Apr 2020 19:42:00 +0200
+
+pkg-config (0.29.2-1) unstable; urgency=medium
+
+  * New upstream version.  Closes: #922173
+    - Fixes pkg.m4 output to report the modules that were missing.
+      Closes: #732797
+  * Import patch from Philip Withnall <withnall@endlessm.com> to make
+    print_package_list()'s output deterministic, to avoid breaking
+    check/check-print-options.  Closes: #952181.
+
+ -- Tollef Fog Heen <tfheen@debian.org>  Tue, 21 Apr 2020 20:30:00 +0200
+
+pkg-config (0.29.1-0ubuntu4) focal; urgency=medium
+
+  * Merge with Debian; remaining changes:
+    - On Ubuntu, in pkg-config-crosswrapper add /usr/lib/pkgconfig to
+    PKG_CONFIG_LIBDIR. As a lot of packages that are cross-build on
+    regular basis rely on cross-building with non-multiarched libraries.
+    - add dpkg-dev dependency, as dpkg-architecture binary is called from
+    wrapper.
+  * New upstream version 0.29.1.
+    - Fix regression quoting variables. LP: #1523508.
+  * Fix build failure with recent glib2.0.
+  * debian/patches/test-list-all-arbitrary-order.patch: Fix wrong test
+    of pkg-config --list-all output.  Closes LP: #1823434.
+
+ -- Gianfranco Costamagna <locutusofborg@debian.org>  Fri, 07 Feb 2020 10:04:31 +0100
+
+pkg-config (0.29-6) unstable; urgency=medium
+
+  * Add missing "warning" in use in dpkg hook, and corresponding test.
+    Closes: #920553
+  * Add missing set -e to tests.
+
+ -- Tollef Fog Heen <tfheen@debian.org>  Sun, 27 Jan 2019 05:56:33 +0100
+
+pkg-config (0.29-5) unstable; urgency=medium
+
+  * Add dpkg-dev to Suggests and make pkg-config-crosswrapper error if
+    dpkg-dev is not installed.  Add corresponding autopkgtest.
+    Closes: #916772
+  * Ignore unknown architectures when setting up symlinks.  Thanks to Jim
+    Patterson for the patch.  Closes: #848706
+  * Bump debhelper compat version to 10.
+  * Add Rules-requires-root: no to control file.
+
+ -- Tollef Fog Heen <tfheen@debian.org>  Thu, 24 Jan 2019 10:01:45 +0100
+
+pkg-config (0.29-4) unstable; urgency=medium
+
+  * Update glib/m4macros/glib-gettext.m4 from newer upstream version to
+    avoid m4 redefinition/overwrite.  Closes: #822409
+  * Add Conflicts and Replaces on pkg-config-bin. This was a suggested
+    change earlier which some users have picked up, even if it never made
+    it into Debian.  Closes: #809221
+
+ -- Tollef Fog Heen <tfheen@debian.org>  Sun, 01 May 2016 08:26:59 +0200
+
+pkg-config (0.29.1-0ubuntu3) eoan; urgency=medium
+
+  * debian/patches/test-list-all-arbitrary-order.patch: Fix wrong test
+    of pkg-config --list-all output.  Closes LP: #1823434.
+
+ -- Steve Langasek <steve.langasek@ubuntu.com>  Thu, 06 Jun 2019 20:30:50 +0000
+
+pkg-config (0.29.1-0ubuntu2) artful; urgency=medium
+
+  * No-change rebuild to pick up -fPIE compiler default in static
+    libraries
+
+ -- Steve Langasek <steve.langasek@ubuntu.com>  Fri, 21 Apr 2017 20:54:08 +0000
+
+pkg-config (0.29.1-0ubuntu1) xenial; urgency=medium
+
+  * Merge with Debian; remaining changes:
+    - On Ubuntu, in pkg-config-crosswrapper add /usr/lib/pkgconfig to
+    PKG_CONFIG_LIBDIR. As a lot of packages that are cross-build on
+    regular basis rely on cross-building with non-multiarched libraries.
+    - add dpkg-dev dependency, as dpkg-architecture binary is called from
+    wrapper.
+  * New upstream version 0.29.1.
+    - Fix regression quoting variables. LP: #1523508.
+  * Fix build failure with recent glib2.0.
+
+ -- Matthias Klose <doko@ubuntu.com>  Wed, 06 Apr 2016 15:22:03 +0200
+
+pkg-config (0.29-3) unstable; urgency=medium
+
+  * Store pkg-config architecture in /usr/lib/pkg-config.multiarch and
+    pick that up in the crosswrapper.  Closes: #807289, #807946
+
+ -- Tollef Fog Heen <tfheen@debian.org>  Fri, 15 Jan 2016 21:46:07 +0100
+
+pkg-config (0.29-2ubuntu2) xenial; urgency=medium
+
+  * Fix pkg-config-crosswrapper to do something for cross builds.
+
+ -- Matthias Klose <doko@ubuntu.com>  Mon, 14 Dec 2015 19:00:25 +0100
+
+pkg-config (0.29-2ubuntu1) xenial; urgency=low
+
+  * Merge from Debian unstable.  Remaining changes:
+    - On Ubuntu, in pkg-config-crosswrapper add /usr/lib/pkgconfig to
+    PKG_CONFIG_LIBDIR. As a lot of packages that are cross-build on
+    regular basis rely on cross-building with non-multiarched libraries.
+    - add dpkg-dev dependency, as dpkg-architecture binary is called from
+    wrapper.
+
+ -- Dimitri John Ledkov <xnox@ubuntu.com>  Thu, 19 Nov 2015 14:48:58 +0000
+
+pkg-config (0.29-2) unstable; urgency=medium
+
+  * Fix typo in crosswrapper.
+  * Add set -e to postinst and prerm
+
+ -- Tollef Fog Heen <tfheen@debian.org>  Sun, 15 Nov 2015 15:38:06 +0100
+
+pkg-config (0.29-1) unstable; urgency=medium
+
+  * Drop unused build-dep on libpopt-dev.  Closes: #751897
+  * Add symlinks to pkg-config-crosswrapper using dpkg hooks. Thanks to
+    Helmut Grohne for this, both design and implementation. Closes: #759556
+  * Export LC_ALL=C in debian/rules to make the build more reproducible.
+    Closes: #792821
+  * Remove fixing of test running, it now works out of the box.
+  * Correct spelling of pkg-config in debian/copyright.
+  * Add missing quoting for arguments in crosswrapper.
+  * Make crosswrapper handle native builds correctly.
+
+ -- Tollef Fog Heen <tfheen@debian.org>  Sun, 15 Nov 2015 13:58:45 +0100
+
+pkg-config (0.28-1ubuntu1) utopic; urgency=medium
+
+  * On Ubuntu, in pkg-config-crosswrapper add /usr/lib/pkgconfig to
+    PKG_CONFIG_LIBDIR. As a lot of packages that are cross-build on
+    regular basis rely on cross-building with non-multiarched libraries.
+
+ -- Dimitri John Ledkov <xnox@ubuntu.com>  Fri, 23 May 2014 12:46:55 +0100
+
+pkg-config (0.28-1) unstable; urgency=medium
+
+  * New upstream release.  (Closes: #699476, #744031)
+    - Updated man page with fewer errors. (Closes: #661838)
+  * Fix test running with newer automake.
+  * Drop popt stuff from debian/rules, upstream no longer ships popt.
+
+ -- Tollef Fog Heen <tfheen@debian.org>  Wed, 23 Apr 2014 18:16:22 +0200
+
+pkg-config (0.26-1+autoconf) unreleased; urgency=medium
+
+  * Non-maintainer upload.
+  * Update config.{sub,guess} for new arches (with dh-autoreconf) (Closes: #742665)
+  * Add Multiarch metadata (M-A: foreign), so this package can
+    satisfy cross- build-dependencies. The cross-build environment is
+    responsible for providing the $triplet-pkg-config symlink to
+    pkg-config-crosswrapper. (Closes: #726598)
+  * Update crosswrapper script to search multiarch paths, traditional
+    cross-compilation paths, arch-independent paths, and /usr/local counterparts.
+    Thanks to Simon McVittie, Steve Langasek, Vincent Danjean, Wookey
+    (Closes: #642292, #650298, #631275)
+  * Make pkg-config itself cross-buildable. (Closes: #716918)
+
+ -- Wookey <wookey@debian.org>  Mon, 24 Mar 2014 17:58:55 +0000
+
+pkg-config (0.26-1) unstable; urgency=low
+
+  * New upstream release
+    - Updated usage message.  Closes: #389066
+    - Fixes old bug.  Closes: #475031
+    - Allows PKG_CONFIG_LIBDIR.  Closes: #398901
+    - Man page documents how to get the default search path.  
+      Closes: #576320
+  * Switch to multiarch paths.  Thanks to Steve Langasek for the patch.
+    Closes: #590992
+  * Strip out multiarch library paths.  Closes: #482884
+  * Drop a cross wrapper into /usr/share.  Thanks to Wookey for the
+    implementation.   Closes: #217902
+  * Re-add two missing lines in Changelog which were accidentially
+    removed.
+
+ -- Tollef Fog Heen <tfheen@debian.org>  Sun, 15 May 2011 14:37:09 +0200
+
+pkg-config (0.25-1.1) unstable; urgency=low
+
+  * Non-maintainer upload.
+  * pkg.m4: Apply commit 2b86e9b from upstream, to fix compatibility with
+    autoconf (>= 2.66). (Closes: #591547)
+
+ -- Tim Retout <diocles@debian.org>  Sun, 03 Oct 2010 17:13:29 +0100
+
+pkg-config (0.25-1) unstable; urgency=low
+
+  * New upstream release
+    - Stops escaping = and : in output.  Closes: #582995
+  * Build with external libpopt.
+
+ -- Tollef Fog Heen <tfheen@debian.org>  Fri, 28 May 2010 18:16:36 +0200
+
+pkg-config (0.24-1) unstable; urgency=low
+
+  * New upstream release. closes: #476947
+    - Marks PKG_CONFIG_PATH and PKG_CONFIG_LIBDIR as precious.  
+      Closes: #398901
+    - Give the ability to log, closes: #528240
+    - Adds description of Requires.Private to man page.  Closes: #341977
+    - Fixes man page formatting.  Closes: #398434
+  * Add ${misc:Depends} to control
+  * Bump debhelper version to 7, switch to dh
+  * Add homepage field to control
+  * Update Standards-Version field to 3.8.4.
+
+ -- Tollef Fog Heen <tfheen@debian.org>  Sun, 23 May 2010 23:38:20 +0200
+
+pkg-config (0.22-1) unstable; urgency=low
+
+  * New upstream release
+    - Make Requires.private a whole lot more useful by traversing the
+      whole tree, not just the top-level, for Cflags.  Closes: #390132
+    - Add support for using the system glib.
+  * Build using system glib.
+  * Add _GNU_SOURCE to the list of defines to make strsignal appear.
+    Closes: #316384
+  * Remove suggests for libgnome-dev.  Closes: #405901
+
+ -- Tollef Fog Heen <tfheen@debian.org>  Mon, 18 Jun 2007 23:38:59 +0200
+
+pkg-config (0.21-1) unstable; urgency=low
+
+  * New upstream release
+    - Adds internal pkg-config package.  (closes: #254289)
+    - Supports escaping $ rather than %.  (closes: #378570)
+    - Always adds all cflags.  (closes: #340904)
+  * Includes full NEWS file.  (closes: #334896)
+  * Remove libglib2.0-dev build-deps.  (closes: #350176)
+
+ -- Tollef Fog Heen <tfheen@debian.org>  Wed, 16 Aug 2006 21:11:21 +0200
+
+pkg-config (0.20-1) unstable; urgency=low
+
+  * New upstream release
+    - Fixes segfault with --help and gcc4 (closes: #321961)
+    - New pkg.m4 uses --short-errors and spits out a more sensible error
+      when some dependencies aren't found.  (closes: #321970)
+  * Install upstream ChangeLog (closes: #318718)
+
+ -- Tollef Fog Heen <tfheen@debian.org>  Mon, 17 Oct 2005 07:47:58 +0200
+
+pkg-config (0.19-1) unstable; urgency=low
+
+  * New upstream release
+
+ -- Tollef Fog Heen <tfheen@debian.org>  Sat, 16 Jul 2005 12:26:33 +0200
+
+pkg-config (0.18.1-1) unstable; urgency=low
+
+  * New upstream release
+    - Fix brown bag bug where pkg.m4 always set pkg_failed to
+    untried. (closes: #316181)
+
+ -- Tollef Fog Heen <tfheen@debian.org>  Wed, 29 Jun 2005 12:58:21 +0200
+
+pkgconfig (0.18-1) unstable; urgency=low
+
+  * New upstream release
+    - Fixes PKG_CONFIG_LIBDIR again. (closes: #313004)
+    - Includes documentation on the fact that the first check for
+      PKG_CHECK_MODULES must not be conditional.  (closes: #303211)
+    - Only links with public libraries now.  (closes: #229980)
+  * Remove --no-indirect-deps to configure.
+
+ -- Tollef Fog Heen <tfheen@debian.org>  Mon, 27 Jun 2005 23:07:03 +0200
+
+pkgconfig (0.17.2-1) unstable; urgency=low
+
+  * New upstream release, no Debian-related changes.
+
+ -- Tollef Fog Heen <tfheen@debian.org>  Sun, 17 Apr 2005 13:23:59 +0200
+
+pkgconfig (0.17.1-1) unstable; urgency=low
+
+  * New upstream release
+
+ -- Tollef Fog Heen <tfheen@debian.org>  Tue, 12 Apr 2005 23:12:48 +0200
+
+pkgconfig (0.17-1) unstable; urgency=low
+
+  * New upstream release
+    - evaluate second argument again (closes: #303969)
+  * pass --disable-indirect-deps to configure for now.  This'll change
+    post-sarge, but we don't want to introduce breakage now.
+  * lowercase first letter in description to shut up lintian
+  
+ -- Tollef Fog Heen <tfheen@debian.org>  Tue, 12 Apr 2005 13:21:08 +0200
+
+pkgconfig (0.16.0-1) unstable; urgency=low
+
+  * New maintainer.
+  * New upstream release
+    - Don't break off from --list-all when provides isn't met 
+      (closes: #232719)
+    - Quote PKG_CHECK_MODULES properly (closes: #274477)
+    - Minor man page fix (closes: #223245)
+    - Fixes --errors-to-stdout (closes: #202409)
+    - Include more robust pkg.m4 (closes: #221818)
+  * Add multiarch search paths to default search path
+  * Make sure /usr/local/pkgconfig is in the default search path 
+    (closes: #245717)
+  * Add /usr/local/share/pkgconfig and /usr/share/pkgconfig to default
+    search path
+
+ -- Tollef Fog Heen <tfheen@debian.org>  Fri, 18 Feb 2005 18:08:58 +0100
+
+pkgconfig (0.15.0-4) unstable; urgency=low
+
+  * New Maintainer.
+  * Moved into my package infrastructure and cleaned up:
+    - debian/copyright updated to my template to include no warranty
+      disclaimer.
+    - AUTHORS added to docs, removed from copyright
+    - NEWS added to docs.
+  * Regenerated auto* using libtool_1.5.2-2 which really contains the
+    FreeBSD support, the experimental 1.6 package doesn't.
+
+ -- Scott James Remnant <scott@netsplit.com>  Sun, 28 Mar 2004 19:04:50 +0100
+
+pkgconfig (0.15.0-3) unstable; urgency=low
+
+  * [debian/rules] Extended the 'autogen' target.
+  * [debian/control] Updated Standards-Version.
+  * Regenerated auto* using libtool 1.6-0+1.5a-1 from experimental to support
+    the Debian GNU/KFreeBSD port. (Closes: 218415)
+
+ -- J.H.M. Dassen (Ray) <jdassen@debian.org>  Fri, 31 Oct 2003 09:33:04 +0100
+
+pkgconfig (0.15.0-2) unstable; urgency=low
+
+  * [configure.in] Removed some leftover experimental code; test for the
+    actual system glib when deciding whether to use the sytem glib or the
+    local copy. This means that in a bootstrapping setting the Build-Depends
+    on glib can be ignored. (Closes: #181947)
+  * [debian/rules] Clean out autom4te.cache .
+
+ -- J.H.M. Dassen (Ray) <jdassen@debian.org>  Sun,  2 Mar 2003 11:48:32 +0100
+
+pkgconfig (0.15.0-1) unstable; urgency=low
+
+  * New maintainer.
+  * Acknowledge NMUs. (Closes: #132474, #135742, #149825, #149831, #162870,
+    #164500)
+  * New upstream release. Changes include:
+    - add PKG_CONFIG_LIBDIR for cross-compiling (David Schleef)
+      (Closes: #177709)
+  * [debian/control] Added Suggests: libgnome-dev (for gnome-config, which
+    pkg-config falls back on when no .pc file is found). (Closes: #172008)
+  * [debian/control] Updated Standards-Version; changed description.
+  * [debian/rules] Added "autogen" target to re-auto* things.
+  * [debian/copyright] Updated; fixed lintian warning.
+  * [configure.in, debian/control] On Debian, use the system glib instead of
+    the local copy. (Closes: #159895)
+  * [pkg.c] Include /usr/local/lib/pkgconfig in the default search path for
+    .pc files. (Closes: #159507)
+
+ -- J.H.M. Dassen (Ray) <jdassen@debian.org>  Sun, 16 Feb 2003 14:01:27 +0100
+
+pkgconfig (0.14.0-0.4) unstable; urgency=low
+
+  * NMU
+  * Update config.{sub,guess} in the included glib source automatically as
+    well.
+
+ -- J.H.M. Dassen (Ray) <jdassen@debian.org>  Mon, 14 Oct 2002 08:10:06 +0200
+
+pkgconfig (0.14.0-0.3) unstable; urgency=low
+
+  * NMU
+  * -0.2 still had a FTBFS on mipsel. Now use dpkg-architecture to set --build
+    argument to configure. 
+
+ -- J.H.M. Dassen (Ray) <jdassen@debian.org>  Sun, 13 Oct 2002 16:09:46 +0200
+
+pkgconfig (0.14.0-0.2) unstable; urgency=low
+
+  * NMU
+  * Updated config.{sub,guess} (20010907 -> 20020703). Should fix the FTBFS 
+    on mipsel.
+  * Automatically update config.{sub,guess} from autotools-dev in 'clean' 
+    target, if possible.
+
+ -- J.H.M. Dassen (Ray) <jdassen@debian.org>  Sun, 13 Oct 2002 16:09:46 +0200
+
+pkgconfig (0.14.0-0.1) unstable; urgency=low
+
+  * NMU, OKed by maintainer.
+  * New upstream release. (Closes: #162870)
+    Includes
+      * parse.c, pkg.c: handle other_libs other_cflags same as -l/-L/-I flags, 
+        so we pull in from dependent packages.
+    which fixes the with issues -pthread and the likes.
+  * Dropped obsoleted "dh_testversion" from debian/rules.
+  * Updated Standards-Version.
+
+ -- J.H.M. Dassen (Ray) <jdassen@debian.org>  Fri, 11 Oct 2002 19:16:30 +0200
+
+pkgconfig (0.12.0-0.1) unstable; urgency=low
+
+  * NMU
+  * New upstream release (Closes: #135742, #149825, #149831)
+
+ -- David Schleef <ds@schleef.org>  Fri, 28 Jun 2002 15:38:52 -0700
+
+pkgconfig (0.11.0-0.1) unstable; urgency=low
+
+  * New upstream release
+  * NMU
+
+ -- Takuo KITAME <kitame@northeye.org>  Sun, 10 Mar 2002 19:27:18 +0900
+
+pkgconfig (0.10.0-0.1) unstable; urgency=low
+
+  * New upstream release (closes: #132474, #133585)
+  * NMU
+
+ -- Takuo KITAME <kitame@northeye.org>  Wed,  6 Feb 2002 02:54:26 +0900
+
+pkgconfig (0.8.0-1.1) unstable; urgency=low
+
+  * NMU
+  * Also need to update glib-1.2.8/config.{guess,sub}.  Re Closes: #103344
+
+ -- LaMont Jones <lamont@debian.org>  Fri, 19 Oct 2001 08:10:36 -0600
+
+pkgconfig (0.8.0-1) unstable; urgency=low
+
+  * New upstream version (Closes: bug#106112).
+  * Updated config.sub and config.guess (Closes: bug#103344).
+
+ -- Paolo Molaro <lupus@debian.org>  Sun, 16 Sep 2001 18:34:00 +0200
+
+pkgconfig (0.7.0-1) unstable; urgency=low
+
+  * New upstream version.
+
+ -- Paolo Molaro <lupus@debian.org>  Sun, 10 Jun 2001 15:57:15 +0200
+
+pkgconfig (0.5.0-1) unstable; urgency=low
+
+  * Initial Release.
+
+ -- Paolo Molaro <lupus@debian.org>  Wed,  7 Mar 2001 17:45:15 +0100
--- pkg-config-0.29.2.orig/debian/control
+++ pkg-config-0.29.2/debian/control
@@ -0,0 +1,24 @@
+Source: pkg-config
+Section: devel
+Priority: optional
+Maintainer: Tollef Fog Heen <tfheen@debian.org>
+Build-Depends: debhelper-compat (= 10), dh-autoreconf, libglib2.0-dev
+Homepage: http://pkg-config.freedesktop.org
+Standards-Version: 3.8.4
+Rules-Requires-Root: no
+
+Package: pkg-config
+Architecture: any
+Multi-Arch: foreign
+Depends: ${shlibs:Depends}, ${misc:Depends},
+ libdpkg-perl
+Suggests: dpkg-dev
+Conflicts: pkg-config-bin
+Replaces: pkg-config-bin
+Description: manage compile and link flags for libraries
+ pkg-config is a system for managing library compile and link flags that 
+ works with automake and autoconf.
+ .
+ Increasingly libraries ship with ".pc" files that allow querying of the
+ compiler and linker flags needed to use them through the pkg-config(1)
+ program.
--- pkg-config-0.29.2.orig/debian/copyright
+++ pkg-config-0.29.2/debian/copyright
@@ -0,0 +1,19 @@
+This is the Debian package of freedesktop.org pkg-config.
+
+Copyright (C) 2001, 2002 Red Hat Inc.
+Copyright (C) 2004, 2005 Tollef Fog Heen <tfheen@err.no>
+
+License:
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+On Debian GNU/Linux systems, the complete text of the GNU General Public
+License can be found in `/usr/share/common-licenses/GPL'.
--- pkg-config-0.29.2.orig/debian/dirs
+++ pkg-config-0.29.2/debian/dirs
@@ -0,0 +1,2 @@
+usr/lib/pkgconfig
+usr/share/pkgconfig
--- pkg-config-0.29.2.orig/debian/docs
+++ pkg-config-0.29.2/debian/docs
@@ -0,0 +1,3 @@
+README
+AUTHORS
+NEWS
--- pkg-config-0.29.2.orig/debian/pkg-config-crosswrapper
+++ pkg-config-0.29.2/debian/pkg-config-crosswrapper
@@ -0,0 +1,52 @@
+#! /bin/sh
+# pkg-config wrapper for cross-building
+# Sets pkg-config search path to search multiarch and historical cross-compiling paths.
+
+# If the user has already set PKG_CONFIG_LIBDIR, believe it (even if empty): 
+# it's documented to be an override
+if [ x"${PKG_CONFIG_LIBDIR+set}" = x ]; then
+  # GNU triplet for the compiler, e.g. i486-linux-gnu for Debian i386,
+  # i686-linux-gnu for Ubuntu i386
+  basename="$(basename "$0")"
+  triplet="${basename%-pkg-config}"
+  # Normalized multiarch path if any, e.g. i386-linux-gnu for i386
+  multiarch="$(dpkg-architecture -t"${triplet}" -qDEB_HOST_MULTIARCH 2>/dev/null)"
+  if [ "$?" != 0 ]; then
+      echo "Please install dpkg-dev to use pkg-config when cross-building" >&2
+      exit 1
+  fi
+  # Native multiarch path
+  native_multiarch="$(cat /usr/lib/pkg-config.multiarch)"
+
+  # This can be used for native builds as well, in that case, just exec pkg-config "$@" directly.
+  if [ "$native_multiarch" = "$multiarch" ]; then
+     exec pkg-config "$@"
+  fi
+
+  PKG_CONFIG_LIBDIR="/usr/local/${triplet}/lib/pkgconfig"
+  # For a native build we would also want to append /usr/local/lib/pkgconfig
+  # at this point; but this is a cross-building script, so don't
+  PKG_CONFIG_LIBDIR="$PKG_CONFIG_LIBDIR:/usr/local/share/pkgconfig"
+
+  if [ -n "$multiarch" ]; then
+    PKG_CONFIG_LIBDIR="/usr/local/lib/${multiarch}/pkgconfig:$PKG_CONFIG_LIBDIR"
+    PKG_CONFIG_LIBDIR="$PKG_CONFIG_LIBDIR:/usr/lib/${multiarch}/pkgconfig"
+  fi
+
+  PKG_CONFIG_LIBDIR="$PKG_CONFIG_LIBDIR:/usr/${triplet}/lib/pkgconfig"
+  # For a native build we would also want to append /usr/lib/pkgconfig
+  # at this point; but this is a cross-building script, so don't
+  # If you want to allow use of un-multiarched -dev packages for crossing 
+  # (at the risk of finding build-arch stuff you didn't want, if not in a clean chroot)
+  # Uncomment the next line:
+  # PKG_CONFIG_LIBDIR="$PKG_CONFIG_LIBDIR:/usr/lib/pkgconfig"
+  # ... but on Ubuntu we rely cross-building with non-multiarch libraries:
+  if dpkg-vendor --derives-from Ubuntu; then
+      PKG_CONFIG_LIBDIR="$PKG_CONFIG_LIBDIR:/usr/lib/pkgconfig"
+  fi
+  PKG_CONFIG_LIBDIR="$PKG_CONFIG_LIBDIR:/usr/share/pkgconfig"
+
+  export PKG_CONFIG_LIBDIR
+fi
+
+exec pkg-config "$@"
--- pkg-config-0.29.2.orig/debian/pkg-config-dpkghook
+++ pkg-config-0.29.2/debian/pkg-config-dpkghook
@@ -0,0 +1,59 @@
+#! /usr/bin/perl
+#
+# Sets up /usr/bin/*-pkg-config symlinks to point to the cross wrapper.
+#
+# It is called from dpkg --post-invoke and from postinst with the "update"
+# argument to instate the necessary symlinks.
+#
+# It is called from prerm with the "remove" argument to remove all symlinks.
+#
+
+use strict;
+use warnings;
+
+use Dpkg::Arch qw(debarch_to_gnutriplet);
+use Dpkg::ErrorHandling qw(error warning);
+
+my $crosswrapper = "/usr/share/pkg-config-crosswrapper";
+
+my $action = $ARGV[0];
+error("parameter must be 'remove' or 'update'")
+  unless defined $action && ($action eq "remove" || $action eq "update");
+
+my $arch = `dpkg --print-architecture`;
+error('dpkg --print-architecture failed') if $? >> 8;
+my @architectures = `dpkg --print-foreign-architectures`;
+error('dpkg --print-foreign-architectures failed') if $? >> 8;
+push @architectures, $arch;
+chomp @architectures;
+
+my %gnutriplets;
+foreach my $arch (@architectures) {
+     my $triplet = debarch_to_gnutriplet($arch);
+     if (not defined($triplet)) {
+	     warning("Architecture $arch not defined in architecture tables, ignored");
+	     next;
+     }
+     $gnutriplets{$triplet} = 1;
+}
+
+my %symlinks = map { $_ => 1 } </usr/bin/*-pkg-config>;
+
+foreach my $symlink (keys %symlinks) {
+  $symlink =~ m,^/usr/bin/([^-]+-[^-]+-[^-]+)-pkg-config, or next;
+  next if exists $gnutriplets{$1} && $action eq "update";
+  next unless -l $symlink;
+  next unless readlink $symlink eq $crosswrapper;
+  unlink $symlink or
+    error("failed to remove symlink $symlink: $!");
+}
+
+if ($action eq 'update') {
+  foreach (keys %gnutriplets) {
+    my $linktarget = "/usr/bin/${_}-pkg-config";
+    next if exists $symlinks{$linktarget};
+    next if -e $linktarget;
+    symlink $crosswrapper, $linktarget or
+      error("failed to create symlink $linktarget to $crosswrapper: $!");
+  }
+}
--- pkg-config-0.29.2.orig/debian/pkg-config-hook-config
+++ pkg-config-0.29.2/debian/pkg-config-hook-config
@@ -0,0 +1 @@
+post-invoke=if { test "$DPKG_HOOK_ACTION" = add-architecture || test "$DPKG_HOOK_ACTION" = remove-architecture; } && test -x /usr/share/pkg-config-dpkghook; then /usr/share/pkg-config-dpkghook update; fi
--- pkg-config-0.29.2.orig/debian/pkg-config.install
+++ pkg-config-0.29.2/debian/pkg-config.install
@@ -0,0 +1,3 @@
+debian/pkg-config-crosswrapper usr/share
+debian/pkg-config-dpkghook usr/share
+debian/pkg-config-hook-config etc/dpkg/dpkg.cfg.d/
--- pkg-config-0.29.2.orig/debian/postinst
+++ pkg-config-0.29.2/debian/postinst
@@ -0,0 +1,9 @@
+#! /bin/sh
+
+set -e
+
+#DEBHELPER#
+
+if test "$1" = configure; then
+    /usr/share/pkg-config-dpkghook update
+fi
--- pkg-config-0.29.2.orig/debian/prerm
+++ pkg-config-0.29.2/debian/prerm
@@ -0,0 +1,9 @@
+#! /bin/sh
+
+set -e
+
+#DEBHELPER#
+
+if test "$1" = remove; then
+    /usr/share/pkg-config-dpkghook remove
+fi
--- pkg-config-0.29.2.orig/debian/rules
+++ pkg-config-0.29.2/debian/rules
@@ -0,0 +1,39 @@
+#! /usr/bin/make -f
+
+DEB_HOST_MULTIARCH     := $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
+DEB_HOST_GNU_TYPE     := $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
+DEB_BUILD_GNU_TYPE     := $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
+
+export LC_ALL=C
+
+ifneq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
+   SET_PKG_CONFIG = PKG_CONFIG=$(DEB_HOST_GNU_TYPE)-pkg-config
+   GCC = $(DEB_HOST_GNU_TYPE)-gcc
+else
+   GCC = gcc
+endif
+
+SYSTEM_LIBDIRS := $(shell for opt in '' $$($${CC-$(GCC)} -print-multi-lib | sed -n -e's/.*;@/-/p'); do \
+     $(GCC) $$opt -print-search-dirs | sed -n -e's/^libraries: =//p' \
+     | sed -e's/:/\n/g' | xargs -n1 readlink -f | grep -v 'gcc\|/[0-9.]\+$$'; \
+    done | sort -u | tr '\n' : | sed 's/:$$//')
+
+%:
+	dh $@ --with autoreconf
+
+override_dh_auto_configure:
+	$(SET_PKG_CONFIG) ./configure --prefix=/usr \
+		--build=$(DEB_BUILD_GNU_TYPE) \
+		--host=$(DEB_HOST_GNU_TYPE) \
+		--mandir=\$${prefix}/share/man \
+		--infodir=\$${prefix}/share/info --disable-shared \
+		--with-pc-path=/usr/local/lib/$(DEB_HOST_MULTIARCH)/pkgconfig:/usr/local/lib/pkgconfig:/usr/local/share/pkgconfig:/usr/lib/$(DEB_HOST_MULTIARCH)/pkgconfig:/usr/lib/pkgconfig:/usr/share/pkgconfig \
+		--with-system-library-path=$(SYSTEM_LIBDIRS)
+
+override_dh_auto_clean:
+	[ ! -f Makefile ] || $(MAKE) distclean DIST_SUBDIRS="check"
+	chmod +x debian/pkg-config-crosswrapper debian/pkg-config-dpkghook
+
+override_dh_install:
+	dh_install
+	echo $(DEB_HOST_MULTIARCH) > debian/pkg-config/usr/lib/pkg-config.multiarch
--- pkg-config-0.29.2.orig/debian/tests/control
+++ pkg-config-0.29.2/debian/tests/control
@@ -0,0 +1,2 @@
+Tests: crosswrapper foreign-arch invalid-arch
+Restrictions: needs-root, allow-stderr
--- pkg-config-0.29.2.orig/debian/tests/crosswrapper
+++ pkg-config-0.29.2/debian/tests/crosswrapper
@@ -0,0 +1,7 @@
+#! /bin/sh
+
+set -e
+
+ln -s /usr/share/pkg-config-crosswrapper $AUTOPKGTEST_TMP/i686-linux-gnu-pkg-config
+[ "$($AUTOPKGTEST_TMP/i686-linux-gnu-pkg-config --modversion pkg-config)" = "$(pkg-config --modversion pkg-config)" ]
+exit $?
--- pkg-config-0.29.2.orig/debian/tests/foreign-arch
+++ pkg-config-0.29.2/debian/tests/foreign-arch
@@ -0,0 +1,12 @@
+#! /bin/sh
+
+set -e
+
+dpkg --add-architecture i386
+
+if [ ! -x /usr/bin/i686-linux-gnu-pkg-config ]; then
+    echo "cross symlink missing"
+    echo "pkg-config symlinks found: $(find /usr/bin/ -name \*pkg-config)"
+    exit 1
+fi
+exit 0
--- pkg-config-0.29.2.orig/debian/tests/invalid-arch
+++ pkg-config-0.29.2/debian/tests/invalid-arch
@@ -0,0 +1,12 @@
+#! /bin/sh
+
+# Test that the dpkg hook does not error for invalid dpkg archictures.
+# Regression test for 920553.
+
+set -e
+
+# This is an intentionally invalid architecture.
+dpkg --add-architecture x86
+apt-get install sash
+
+exit 0
--- pkg-config-0.29.2.orig/glib/m4macros/glib-gettext.m4
+++ pkg-config-0.29.2/glib/m4macros/glib-gettext.m4
@@ -313,7 +313,7 @@
 # on various variables needed by the Makefile.in.in installed by 
 # glib-gettextize.
 dnl
-glib_DEFUN([GLIB_GNU_GETTEXT],
+AU_DEFUN([GLIB_GNU_GETTEXT],
   [AC_REQUIRE([AC_PROG_CC])dnl
    
    GLIB_LC_MESSAGES
@@ -383,7 +383,8 @@
    rm -f po/POTFILES
    sed -e "/^#/d" -e "/^\$/d" -e "s,.*,	$posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
 	< $srcdir/po/POTFILES.in > po/POTFILES
-  ])
+  ],
+  [[$0: This macro is deprecated. You should use upstream gettext instead.]])
 
 # AM_GLIB_DEFINE_LOCALEDIR(VARIABLE)
 # -------------------------------
--- pkg-config-0.29.2.orig/pkg.c
+++ pkg-config-0.29.2/pkg.c
@@ -1160,38 +1160,55 @@
   return "???";
 }
 
-static void
-max_len_foreach (gpointer key, gpointer value, gpointer data)
+static gint
+packages_sort_cb (gconstpointer a,
+                  gconstpointer b)
 {
-  int *mlen = data;
+  const Package *package_a = *((Package **) a);
+  const Package *package_b = *((Package **) b);
 
-  *mlen = MAX (*mlen, strlen (key));
-}
-
-static void
-packages_foreach (gpointer key, gpointer value, gpointer data)
-{
-  Package *pkg = value;
-  char *pad;
-
-  pad = g_strnfill (GPOINTER_TO_INT (data) - strlen (pkg->key), ' ');
-      
-  printf ("%s%s%s - %s\n",
-          pkg->key, pad, pkg->name, pkg->description);
-
-  g_free (pad);
+  return g_strcmp0 (package_a->key, package_b->key);
 }
 
 void
 print_package_list (void)
 {
-  int mlen = 0;
+  gsize mlen = 0;
+  GPtrArray *packages_array = NULL;
+  GHashTableIter iter;
+  gpointer key, value;
+  guint i;
 
   ignore_requires = TRUE;
   ignore_requires_private = TRUE;
 
-  g_hash_table_foreach (packages, max_len_foreach, &mlen);
-  g_hash_table_foreach (packages, packages_foreach, GINT_TO_POINTER (mlen + 1));
+  /* Add the packages to a pointer array and sort by pkg->key first, to give
+   * deterministic output. While doing that, work out the maximum key length
+   * so we can pad the output correctly. */
+  packages_array = g_ptr_array_sized_new (g_hash_table_size (packages));
+  g_hash_table_iter_init (&iter, packages);
+  while (g_hash_table_iter_next (&iter, &key, &value))
+    {
+      g_ptr_array_add (packages_array, value);
+      mlen = MAX (mlen, strlen (key));
+    }
+
+  g_ptr_array_sort (packages_array, packages_sort_cb);
+
+  for (i = 0; i < packages_array->len; i++)
+    {
+        Package *pkg = g_ptr_array_index (packages_array, i);
+        char *pad;
+
+        pad = g_strnfill (mlen + 1 - strlen (pkg->key), ' ');
+
+        printf ("%s%s%s - %s\n",
+                pkg->key, pad, pkg->name, pkg->description);
+
+        g_free (pad);
+    }
+
+  g_ptr_array_free (packages_array, TRUE);
 }
 
 void
