[libgd-perl] 01/06: Add patch to use pkg-config instead of the removed gdlib-config.

gregor herrmann gregoa at debian.org
Sun Sep 25 15:58:49 UTC 2016


This is an automated email from the git hooks/post-receive script.

gregoa pushed a commit to branch master
in repository libgd-perl.

commit 0da69d968b3715b74223898581c2d184d626befa
Author: gregor herrmann <gregoa at debian.org>
Date:   Sun Sep 25 17:50:13 2016 +0200

    Add patch to use pkg-config instead of the removed gdlib-config.
    
    Closes: #825629
---
 debian/patches/1002_gdlib-config_pkg-config.patch | 70 +++++++++++++++++++++++
 debian/patches/series                             |  1 +
 2 files changed, 71 insertions(+)

diff --git a/debian/patches/1002_gdlib-config_pkg-config.patch b/debian/patches/1002_gdlib-config_pkg-config.patch
new file mode 100644
index 0000000..0335b9b
--- /dev/null
+++ b/debian/patches/1002_gdlib-config_pkg-config.patch
@@ -0,0 +1,70 @@
+Description: use pkg-config (via ExtUtils::PkgConfig) instead of the removed gdlib-config.
+ Additionally remove parts from try_to_autoconfigure which are not needed, at least on Debian,
+ and adjust some variable to the different output of pkg-config.
+ pkg-config doesn't return "features", so we're hardcoding it for now, taken from gdlib-config
+ as of src:libgd2 2.2.3-1.1 (rebuilt with gdlib-config re-enabled).
+ .
+ This patch might need more massaging before upstreaming it wrt non-Debian systems,
+ and inclusion of ExtUtils::PkgConfig into the distributions metadata.
+Origin: vendor
+Bug: https://rt.cpan.org/Ticket/Display.html?id=114788
+Bug-Debian: https://bugs.debian.org/825629
+Forwarded: no
+Author: gregor herrmann <gregoa at debian.org>
+Last-Update: 2016-09-25
+
+--- a/Makefile.PL
++++ b/Makefile.PL
+@@ -1,6 +1,7 @@
+ use ExtUtils::MakeMaker qw(prompt WriteMakefile);
+ use Config;
+ use strict;
++use ExtUtils::PkgConfig;
+ 
+ # if this is a dev version the version number can be a string with underscores
+ # remove them to prevent a warning and that's what perl will do it it was
+@@ -273,27 +274,23 @@
+ 
+ sub try_to_autoconfigure {
+   my ($options,$lib_gd_path,$INC,$LIBPATH,$LIBS) = @_;
+-  my $config = `gdlib-config --all`;
+-  return unless $config;
++  my %config = ExtUtils::PkgConfig->find ('gdlib');
++  return unless %config;
+   $AUTOCONFIG++;
+ 
+-  my ($version) = $config =~ /^GD library\s+(\S+)/m;
++  my ($version) = $config{modversion};
+   warn "Configuring for libgd version $version.\n";
+ 
+-  my ($cflags)     = $config =~ /^cflags:\s+(.+)/m;
+-  my ($ldflags)    = $config =~ /^ldflags:\s+(.+)/m;
+-  my ($libs)       = $config =~ /^libs:\s+(.+)/m;
+-  my ($libdir)     = $config =~ /^libdir:\s+(.+)/m;
+-  my ($features)   = $config =~ /^features:\s+(.+)/m;
+-  my ($includedir) = $config =~ /^includedir:\s+(.+)/m;
++  my ($cflags)     = $config{cflags};
++  my ($libs)       = $config{libs};
++  my ($libdir)     = ExtUtils::PkgConfig->variable('gdlib', 'libdir');
++  my ($features)   = 'GD_GIF GD_GIFANIM GD_OPENPOLYGON GD_ZLIB GD_PNG GD_FREETYPE GD_FONTCONFIG GD_JPEG GD_XPM GD_TIFF GD_WEBP';
+ 
+   @$INC          = map {s/^-I// && "-I$_"} split /\s+/,$cflags;
+-  @$LIBPATH      = map {s/^-L// && "-L$_"} split /\s+/,$ldflags;
+   @$LIBS         = split /\s+/,$libs;
+ 
+-  push @$LIBS,"-lgd";
+   push @$LIBPATH,"-L$libdir";
+-  ($$lib_gd_path = $libdir) =~ s!/[^/]+$!!;
++  $$lib_gd_path  = $libdir;
+   $$options      = $features;
+ 
+   my ($minor, $patch)    = $version =~ /^2\.(\d+)\.(\d+)$/;
+@@ -301,8 +298,6 @@
+     $$options     .= " GD_UNCLOSEDPOLY GD_ANIMGIF GD_FTCIRCLE VERSION_33";
+   }
+ 
+-  my @correct_inc = map {s/^-I// && $_} split /\s+/,$cflags;
+-  check_for_stray_headers($includedir, at correct_inc);
+   return 1;
+ }
+ 
diff --git a/debian/patches/series b/debian/patches/series
index 58cd28d..d07378f 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,3 +1,4 @@
 020150323~58eceb8.patch
 1001_fix_pod_errors.patch
 2001_disable_jpeg_test_10.patch
+1002_gdlib-config_pkg-config.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libgd-perl.git



More information about the Pkg-perl-cvs-commits mailing list