Require pkg-config 0.24 for creating pkgconfig() dependencies
authorPanu Matilainen <pmatilai@redhat.com>
Fri, 3 Dec 2010 10:44:49 +0000 (12:44 +0200)
committerPanu Matilainen <pmatilai@redhat.com>
Fri, 3 Dec 2010 10:44:49 +0000 (12:44 +0200)
- The support for --print-requires|provides was only upstreamed in
  pkg-config 0.24, prior to that it relied on distros patching their
  pkg-config. Rpm relying on non-upstream stuff is not good...
  Now that it's upstream we can make a clean break and simply not
  even try to generate the dependencies with anything older.
- The upstreamed version behaves slightly differently from what distros
  were patching with, for rpm's purposes we also want
  --print-requires-private now.

scripts/pkgconfigdeps.sh

index 00cba00..270dd74 100755 (executable)
@@ -11,6 +11,11 @@ test -x $pkgconfig || {
     exit 0
 }
 
+$pkgconfig --atleast-pkgconfig-version="0.24" || {
+    cat > /dev/null
+    exit 0
+}
+
 case $1 in
 -P|--provides)
     while read filename ; do
@@ -39,7 +44,7 @@ case $1 in
        [ $i -eq 1 ] && echo "$pkgconfig"
        DIR="`dirname ${filename}`"
        export PKG_CONFIG_PATH="$DIR:$DIR/../../share/pkgconfig"
-       $pkgconfig --print-requires "$filename" 2> /dev/null | while read n r v ; do
+       $pkgconfig --print-requires --print-requires-private "$filename" 2> /dev/null | while read n r v ; do
            [ -n "$n" ] || continue
            echo -n "pkgconfig($n) "
            [ -n "$r" ] && [ -n "$v" ] && echo -n "$r" "$v"