Merge branch 'master' into core-updates
[jackhill/guix/guix.git] / gnu / packages / patches / perl-gd-options-passthrough-and-fontconfig.patch
1 This patch (adapted from nixpkgs for Build.PL) configures Getopt::Long to pass
2 options so they will be available at the second GetOptions call.
3
4 Also an option to specify the search path for libfontconfig is added.
5
6 --- GD-2.56/Build.PL 2014-10-27 20:34:54.000000000 -0500
7 +++ GD-2.56/Build.PL 2015-02-22 10:08:12.569973657 -0600
8 @@ -2,14 +2,14 @@
9
10 use strict;
11 use Module::Build;
12 -use Getopt::Long;
13 +use Getopt::Long qw(:config pass_through);
14 use Config;
15
16 # =====> PATHS: CHECK AND ADJUST <=====
17 my (@INC,@LIBPATH,@LIBS);
18 my $AUTOCONFIG = 0; # global set by try_to_autoconfigure() below
19
20 -my ($options,$lib_gd_path,$lib_ft_path,$lib_png_path,$lib_jpeg_path,$lib_xpm_path,$lib_zlib_path);
21 +my ($options,$lib_gd_path,$lib_ft_path,$lib_png_path,$lib_jpeg_path,$lib_xpm_path,$lib_zlib_path,$lib_fontconfig_path);
22
23 unless (try_to_autoconfigure(\$options,\$lib_gd_path,\@INC,\@LIBPATH,\@LIBS)) {
24 die <<END;
25 @@ -38,6 +38,7 @@
26 "lib_jpeg_path=s" => \$lib_jpeg_path,
27 "lib_xpm_path=s" => \$lib_xpm_path,
28 "lib_zlib_path=s" => \$lib_zlib_path,
29 + "lib_fontconfig_path=s" => \$lib_fontconfig_path,
30 );
31 unless ($result) {
32 die <<END;
33 @@ -53,6 +54,7 @@
34 -lib_jpeg_path path path to libjpeg
35 -lib_xpm_path path path to libxpm
36 -lib_zlib_path path path to libpng
37 + -lib_fontconfig_path path path to fontconfig
38 -ignore_missing_gd Ignore missing or old libgd installations and try to compile anyway
39
40 If no options are passed on the command line. The program will
41 @@ -100,6 +102,12 @@
42 @INC = ("-I$lib_zlib_path/include", @INC);
43 @LIBPATH = ("-L$lib_zlib_path/lib", @LIBPATH);
44 }
45 +if( defined($lib_fontconfig_path) )
46 +{
47 + print "Fontconfig library used from: $lib_fontconfig_path\n";
48 + @INC = ("-I$lib_fontconfig_path/include", @INC);
49 + @LIBPATH = ("-L$lib_fontconfig_path/lib", @LIBPATH);
50 +}
51 #############################################################################################
52
53 if ($^O eq 'VMS'){