[perl-GStreamer-Interfaces] Be friendlier to CPAN testers and EU::MM



commit 1e8573a32bf4210e7c363b76bcac591cb4a89236
Author: Torsten Schönfeld <kaffeetisch gmx de>
Date:   Tue Mar 2 23:00:35 2010 +0100

    Be friendlier to CPAN testers and EU::MM
    
    Exit nicely if gstreamer-plugins-base-0.10 is not installed.  And use
    META_MERGE instead of EXTRA_META.

 Makefile.PL |   20 ++++++++++++++++----
 1 files changed, 16 insertions(+), 4 deletions(-)
---
diff --git a/Makefile.PL b/Makefile.PL
index c5aae0d..1083458 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -41,7 +41,16 @@ unless (eval "use ExtUtils::Depends '$build_reqs{'perl-ExtUtils-Depends'}';"
   exit 1; # not reached
 }
 
-my %pkgcfg = ExtUtils::PkgConfig->find("gstreamer-plugins-base-0.10 >= $build_reqs{'gstreamer-plugins-base-0.10'}");
+# If the package can't be found, warn and exit with status 0 to indicate to
+# CPAN testers that their system is not supported.
+my %pkgcfg;
+unless (eval { %pkgcfg = ExtUtils::PkgConfig->find (
+                 "gstreamer-plugins-base-0.10 >= $build_reqs{'gstreamer-plugins-base-0.10'}");
+	       1; })
+{
+	warn $@;
+	exit 0;
+}
 
 mkdir 'build', 0777;
 
@@ -53,7 +62,8 @@ $gst->set_inc($pkgcfg{cflags});
 $gst->set_libs($pkgcfg{libs} . ' -lgstinterfaces-0.10');
 $gst->add_xs(<xs/*.xs>);
 $gst->add_pm('Interfaces.pm' => '$(INST_LIBDIR)/Interfaces.pm');
-$gst->add_typemaps(map {File::Spec->catfile(cwd(), $_)} ('build/gstinterfacesperl.typemap'));
+$gst->add_typemaps(map {File::Spec->catfile(cwd(), $_)}
+                       ('build/gstinterfacesperl.typemap'));
 
 $gst->install(qw(gstinterfacesperl.h));
 $gst->save_config('build/IFiles.pm');
@@ -68,9 +78,11 @@ WriteMakefile(
   PREREQ_PM     => \%pre_reqs,
   XSPROTOARG    => '-noprototypes',
 
-  $gst->get_makefile_vars,
+  META_MERGE    => {
+    configure_requires => \%pre_reqs,
+  },
 
-  EXTRA_META    => $configure_requires,
+  $gst->get_makefile_vars,
 );
 
 sub MY::postamble {



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]