]> git.imager.perl.org - imager.git/blobdiff - FT2/Makefile.PL
freetype-config might not be available, allow pkg-config to work
[imager.git] / FT2 / Makefile.PL
index ca34198a9a0fd87fa65ff31d9e7debd05014a0dc..71a0c8b0dabe30104270403fd2037122c864550b 100644 (file)
@@ -13,8 +13,7 @@ GetOptions("incpath=s", \@incpaths,
            "verbose|v" => \$verbose);
 
 our $BUILDING_IMAGER;
-
-my $MM_ver = eval $ExtUtils::MakeMaker::VERSION;
+our %IMAGER_LIBS;
 
 my %opts = 
   (
@@ -24,6 +23,35 @@ my %opts =
    clean => { FILES => 'testout' },
   );
 
+if (eval { ExtUtils::MakeMaker->VERSION('6.46'); 1 }) {
+  $opts{LICENSE} = "perl_5";
+  $opts{AUTHOR} = 'Tony Cook <tonyc@cpan.org>';
+  $opts{ABSTRACT} = 'FreeType 2 font driver for Imager';
+  $opts{META_MERGE} =
+    {
+     'meta-spec' =>
+     {
+      version => "2",
+      url => "https://metacpan.org/pod/CPAN::Meta::Spec",
+     },
+     resources =>
+     {
+      homepage => "http://imager.perl.org/",
+      repository =>
+      {
+       type => "git",
+       url => "git://git.imager.perl.org/imager.git",
+       web => "http://git.imager.perl.org/imager.git",
+      },
+      bugtracker =>
+      {
+       web => "http://rt.cpan.org/NoAuth/Bugs.html?Dist=Imager",
+       mailto => 'bug-Imager@rt.cpan.org',
+      },
+     },
+    };
+}
+
 my @inc;
 if ($BUILDING_IMAGER) {
   push @inc, "-I..";
@@ -37,33 +65,48 @@ else {
   $opts{TYPEMAPS} = [ Imager::ExtUtils->typemap ];
 
   # Imager required configure through use
-  my @Imager_req = ( Imager => "0.78" );
-  if ($MM_ver >= 6.46) {
-    $opts{META_MERGE} =
+  my @Imager_req = ( Imager => "0.95" );
+  if (eval { ExtUtils::MakeMaker->VERSION('6.46'); 1 }) {
+    $opts{META_MERGE}{prereqs} =
       {
-       configure_requires => 
+       configure =>
+       {
+       requires =>
+       {
+        @Imager_req,
+       },
+       },
+       build =>
        {
-       @Imager_req,
+       requires =>
+       {
+        @Imager_req,
+        'Scalar::Util' => 1.00,
+        "Test::More" => "0.47",
+       }
        },
-       build_requires => 
+       runtime =>
        {
-       @Imager_req,
-       "Test::More" => "0.47",
+       requires =>
+       {
+        @Imager_req,
+        'Scalar::Util' => 1.00,
+       }
        },
-       resources =>
+       test =>
        {
-       homepage => "http://imager.perl.org/",
-       repository =>
+       requires =>
        {
-        url => "http://imager.perl.org/svn/trunk/Imager/FT2",
-        web => "http://imager.perl.org/svnweb/public/browse/trunk/Imager/FT2",
-        type => "svn",
-       },
+        "Test::More" => "0.47",
+        'Scalar::Util' => 1.00,
+       }
        },
       };
     $opts{PREREQ_PM} =
       {
        @Imager_req,
+       'Scalar::Util' => 1.00,
+       XSLoader => 0,
       };
   }
 }
@@ -82,6 +125,7 @@ my %probe =
    testcodeprologue => _ft2_test_code_prologue(),
    incpath => \@incpaths,
    libpath => \@libpaths,
+   pkg => [ "freetype2" ],
    alternatives =>
    [
     {
@@ -91,23 +135,25 @@ my %probe =
      incsuffix => "freetype",
     },
    ],
+   verbose => $verbose,
   );
 
 my $probe_res = Imager::Probe->probe(\%probe);
 if ($probe_res) {
+  $IMAGER_LIBS{FT2} = 1;
+
   push @inc, $probe_res->{INC};
   $opts{LIBS} = $probe_res->{LIBS};
   $opts{DEFINE} = $probe_res->{DEFINE};
   $opts{INC} = "@inc";
+  $opts{LDDLFLAGS} = $probe_res->{LDDLFLAGS}
+    if $probe_res->{LDDLFLAGS};
 
-  if ($MM_ver > 6.06) {
-    $opts{AUTHOR} = 'Tony Cook <tony@imager.perl.org>';
-    $opts{ABSTRACT} = 'FreeType 2 font driver for Imager';
-  }
-  
   WriteMakefile(%opts);
 }
 else {
+  $IMAGER_LIBS{FT2} = 0;
+
   if ($BUILDING_IMAGER) {
     ExtUtils::MakeMaker::WriteEmptyMakefile(%opts);
   }
@@ -150,6 +196,9 @@ sub is_exe {
   if ($^O eq 'MSWin32') {
     push @exe_suffix, qw/.bat .cmd/;
   }
+  elsif ($^O eq 'cygwin') {
+    push @exe_suffix, "";
+  }
 
   for my $dir (File::Spec->path) {
     for my $suffix (@exe_suffix) {