Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 25 Dec 2016 16:46:11 +0100
From:      "Felix J. Ogrs" <fjo-lists@ogris.de>
To:        perl@FreeBSD.org
Subject:   graphics/p5-GD doesn't detect libgd > 2.0.33
Message-ID:  <5699f3bc-f5e7-9a3b-5474-fb5b1322c42f@ogris.de>

next in thread | raw e-mail | index | archive | help

[-- Attachment #1 --]
Hi,

both Build.PL and Makefile.PL of p5-GD-2.56 do not correctly parse the version of libgd as returned by gdlib-config. Excerpt from Makefile.PL line 302:

my ($minor)    = $version =~ /^2\.\d+\.(\d+)$/;
$$options     .= " GD_UNCLOSEDPOLY GD_ANIMGIF GD_FTCIRCLE VERSION_33" if defined($minor) && $minor >= 33;

The above options GD_* were introduced as of libgd 2.0.33. But, current version is 2.2.3. Thus, the check fails. I'm proposing a trivial fix:

my ($release, $major, $minor) = $version =~ /^(\d+)\.(\d+)\.(\d+)$/;
$$options                    .= " GD_UNCLOSEDPOLY GD_ANIMGIF GD_FTCIRCLE VERSION_33" if defined($minor) && ($release > 2 || ($release == 2 && $major > 0) || ($release == 2 && $major == 0 && $minor >= 33));

Patches are attached.

BR,
Felix

[-- Attachment #2 --]
--- Build.PL.orig	2016-12-13 20:22:30.348550000 +0100
+++ Build.PL	2016-12-13 20:23:01.820955000 +0100
@@ -280,8 +280,8 @@
   ($$lib_gd_path = $libdir) =~ s!/[^/]+$!!;
   $$options      = $features;
 
-  my ($minor)    = $version =~ /^2\.\d+\.(\d+)$/;
-  $$options     .= " GD_UNCLOSEDPOLY GD_ANIMGIF GD_FTCIRCLE VERSION_33" if defined($minor) && $minor >= 33;
+  my ($release, $major, $minor) = $version =~ /^(\d+)\.(\d+)\.(\d+)$/;
+  $$options                    .= " GD_UNCLOSEDPOLY GD_ANIMGIF GD_FTCIRCLE VERSION_33" if defined($minor) && ($release > 2 || ($release == 2 && $major > 0) || ($release == 2 && $major == 0 && $minor >= 33));
 
   my @correct_inc = map {s/^-I// && $_} split /\s+/,$cflags;
   check_for_stray_headers($includedir,@correct_inc);

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?5699f3bc-f5e7-9a3b-5474-fb5b1322c42f>