aboutsummaryrefslogtreecommitdiff
path: root/package/perl-gd
diff options
context:
space:
mode:
authorGravatar Francois Perrad <fperrad@gmail.com>2014-07-18 15:43:37 +0200
committerGravatar Thomas Petazzoni <thomas.petazzoni@free-electrons.com>2014-07-18 19:48:05 +0200
commit39d1f0645ea21a36eeeabd6406429ccbdc7d48b7 (patch)
treed61da4e5b274aa32fe6bb72225e7ad2f996272e8 /package/perl-gd
parent6d3962f0bd0e0f989299eae40f88ede9c5483644 (diff)
downloadbuildroot-39d1f0645ea21a36eeeabd6406429ccbdc7d48b7.tar.gz
buildroot-39d1f0645ea21a36eeeabd6406429ccbdc7d48b7.tar.bz2
perl-gd: new package
Signed-off-by: Francois Perrad <francois.perrad@gadz.org> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Diffstat (limited to 'package/perl-gd')
-rw-r--r--package/perl-gd/Config.in14
-rw-r--r--package/perl-gd/perl-gd-01-getoptions.patch40
-rw-r--r--package/perl-gd/perl-gd-02-lgd.patch25
-rw-r--r--package/perl-gd/perl-gd-03-force.patch29
-rw-r--r--package/perl-gd/perl-gd.mk22
5 files changed, 130 insertions, 0 deletions
diff --git a/package/perl-gd/Config.in b/package/perl-gd/Config.in
new file mode 100644
index 0000000000..7c85cfcb5b
--- /dev/null
+++ b/package/perl-gd/Config.in
@@ -0,0 +1,14 @@
+config BR2_PACKAGE_PERL_GD
+ bool "perl-gd"
+ depends on !BR2_PREFER_STATIC_LIB
+ select BR2_PACKAGE_ZLIB
+ select BR2_PACKAGE_LIBPNG
+ select BR2_PACKAGE_FREETYPE
+ select BR2_PACKAGE_GD
+ help
+ Interface to Gd Graphics Library
+
+ https://metacpan.org/release/GD
+
+comment "perl-gd needs a toolchain w/ dynamic library"
+ depends on BR2_PREFER_STATIC_LIB
diff --git a/package/perl-gd/perl-gd-01-getoptions.patch b/package/perl-gd/perl-gd-01-getoptions.patch
new file mode 100644
index 0000000000..7bd7f4f22d
--- /dev/null
+++ b/package/perl-gd/perl-gd-01-getoptions.patch
@@ -0,0 +1,40 @@
+fix option handling in Makefile.PL
+
+the call to GetOptions() must be unique.
+
+Signed-off-by: Francois Perrad <francois.perrad@gadz.org>
+see https://github.com/lstein/Perl-GD/pull/6
+
+Index: b/Makefile.PL
+===================================================================
+--- a/Makefile.PL
++++ b/Makefile.PL
+@@ -24,7 +24,15 @@
+ my ($options,$lib_gd_path,$lib_ft_path,$lib_png_path,$lib_jpeg_path,$lib_xpm_path,$lib_zlib_path,$force);
+
+ use Getopt::Long;
+-GetOptions("ignore_missing_gd" => \$force);
++my $result = GetOptions("options=s" => \$options,
++ "lib_gd_path=s" => \$lib_gd_path,
++ "lib_ft_path=s" => \$lib_ft_path,
++ "lib_png_path=s" => \$lib_png_path,
++ "lib_jpeg_path=s" => \$lib_jpeg_path,
++ "lib_xpm_path=s" => \$lib_xpm_path,
++ "lib_zlib_path=s" => \$lib_zlib_path,
++ "ignore_missing_gd" => \$force,
++ );
+
+ unless (try_to_autoconfigure(\$options,\$lib_gd_path,\@INC,\@LIBPATH,\@LIBS) || $force) {
+ die <<END;
+@@ -47,14 +55,6 @@
+ #############################################################################################
+ # Build options passed in to script to support reproducible builds via Makefiles
+ #############################################################################################
+-my $result = GetOptions("options=s" => \$options,
+- "lib_gd_path=s" => \$lib_gd_path,
+- "lib_ft_path=s" => \$lib_ft_path,
+- "lib_png_path=s" => \$lib_png_path,
+- "lib_jpeg_path=s" => \$lib_jpeg_path,
+- "lib_xpm_path=s" => \$lib_xpm_path,
+- "lib_zlib_path=s" => \$lib_zlib_path,
+- );
diff --git a/package/perl-gd/perl-gd-02-lgd.patch b/package/perl-gd/perl-gd-02-lgd.patch
new file mode 100644
index 0000000000..bc6cdfcc7a
--- /dev/null
+++ b/package/perl-gd/perl-gd-02-lgd.patch
@@ -0,0 +1,25 @@
+refactor -lgd in @LIBS
+
+Signed-off-by: Francois Perrad <francois.perrad@gadz.org>
+see https://github.com/lstein/Perl-GD/pull/7
+
+Index: b/Makefile.PL
+===================================================================
+--- a/Makefile.PL
++++ b/Makefile.PL
+@@ -34,9 +34,9 @@
+ END
+ }
+
++push @LIBS, "-lgd";
+ @INC = qw(-I/usr/include -I/usr/include/gd) unless @INC;
+ @LIBPATH = qw(-L/usr/lib/X11 -L/usr/X11R6/lib -L/usr/X11/lib -L/usr/lib) unless @LIBPATH;
+-@LIBS = qw(-lgd) unless @LIBS;
+
+ # support for AMD64 libraries
+ if (-d '/usr/lib64') {
+@@ -291,7 +291,6 @@
+ @$LIBPATH = map {s/^-L// && "-L$_"} split /\s+/,$ldflags;
+ @$LIBS = split /\s+/,$libs;
+
+- push @$LIBS,"-lgd";
diff --git a/package/perl-gd/perl-gd-03-force.patch b/package/perl-gd/perl-gd-03-force.patch
new file mode 100644
index 0000000000..352486521d
--- /dev/null
+++ b/package/perl-gd/perl-gd-03-force.patch
@@ -0,0 +1,29 @@
+let @INC and @LIBPATH empty when ignore_missing_gd
+
+Signed-off-by: Francois Perrad <francois.perrad@gadz.org>
+see https://github.com/lstein/Perl-GD/pull/7
+
+Index: b/Makefile.PL
+===================================================================
+--- a/Makefile.PL
++++ b/Makefile.PL
+@@ -35,13 +35,15 @@
+ }
+
+ push @LIBS, "-lgd";
+-@INC = qw(-I/usr/include -I/usr/include/gd) unless @INC;
+-@LIBPATH = qw(-L/usr/lib/X11 -L/usr/X11R6/lib -L/usr/X11/lib -L/usr/lib) unless @LIBPATH;
+-
+-# support for AMD64 libraries
+-if (-d '/usr/lib64') {
+- my @libs64 = map {my $a = $_; $a=~ s/lib$/lib64/; $a} @LIBPATH;
+- @LIBPATH = (@LIBPATH,@libs64);
++unless ($force) {
++ @INC = qw(-I/usr/include -I/usr/include/gd) unless @INC;
++ @LIBPATH = qw(-L/usr/lib/X11 -L/usr/X11R6/lib -L/usr/X11/lib -L/usr/lib) unless @LIBPATH;
++
++ # support for AMD64 libraries
++ if (-d '/usr/lib64') {
++ my @libs64 = map {my $a = $_; $a=~ s/lib$/lib64/; $a} @LIBPATH;
++ @LIBPATH = (@LIBPATH,@libs64);
++ }
diff --git a/package/perl-gd/perl-gd.mk b/package/perl-gd/perl-gd.mk
new file mode 100644
index 0000000000..8bb677881a
--- /dev/null
+++ b/package/perl-gd/perl-gd.mk
@@ -0,0 +1,22 @@
+################################################################################
+#
+# perl-gd
+#
+################################################################################
+
+PERL_GD_VERSION = 2.53
+PERL_GD_SOURCE = GD-$(PERL_GD_VERSION).tar.gz
+PERL_GD_SITE = $(BR2_CPAN_MIRROR)/authors/id/L/LD/LDS/
+PERL_GD_DEPENDENCIES = perl zlib libpng freetype gd
+PERL_GD_LICENSE = Artistic-2.0 or GPLv1+
+PERL_GD_LICENSE_FILES = LICENSE
+
+PERL_GD_CONF_OPT = \
+ -options=FT,PNG \
+ -lib_gd_path=$(STAGING_DIR)/usr \
+ -lib_ft_path=$(STAGING_DIR)/usr \
+ -lib_png_path=$(STAGING_DIR)/usr \
+ -lib_zlib_path=$(STAGING_DIR)/usr \
+ -ignore_missing_gd
+
+$(eval $(perl-package))