[gimp-perl] Support ExtUtils::Depends. Bug 728161



commit 74dcbb98e52ed1fc90ceb8e55e46cc17e4e7b2e7
Author: Ed J <m8r-35s8eo mailinator com>
Date:   Mon Apr 14 09:33:28 2014 +0100

    Support ExtUtils::Depends. Bug 728161

 .gitignore        |    1 +
 Gimp/Config.pm.in |    4 +---
 Gimp/Fu.pm        |   29 ++++++++++-------------------
 Gimp/Makefile.PL  |    4 +++-
 Makefile.PL       |    4 ++--
 5 files changed, 17 insertions(+), 25 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index b54000b..7ace1ee 100644
--- a/.gitignore
+++ b/.gitignore
@@ -9,6 +9,7 @@ Makefile
 Makefile.old
 Gimp.c
 Gimp/Config.pm
+Gimp/IFiles.pm
 Gimp/Lib.c
 Net/Net.c
 UI/UI.c
diff --git a/Gimp/Config.pm.in b/Gimp/Config.pm.in
index 35aa8e8..3e48bc1 100644
--- a/Gimp/Config.pm.in
+++ b/Gimp/Config.pm.in
@@ -22,7 +22,5 @@ L<Gimp>.
 
 =cut
 
-%Gimp::Config = (
-#CFG#);
-
+#CFG#
 1;
diff --git a/Gimp/Fu.pm b/Gimp/Fu.pm
index 3c36b07..0ec41cd 100644
--- a/Gimp/Fu.pm
+++ b/Gimp/Fu.pm
@@ -515,9 +515,16 @@ sub save_image($$) {
    }
 }
 
-# provide some clues ;)
-sub print_switches {
-   my($this)= _;
+sub main {
+   $old_trace = Gimp::set_trace (0);
+   return Gimp::main unless $Gimp::help;
+   my $this=this_script;
+   print __<<EOF;
+       interface-arguments are
+           -o | --output <filespec>   write image to disk
+           -i | --interact            let the user edit the values first
+       script-arguments are
+EOF
    for(@{$this->[9]}) {
       my $type=$pf2info{$_->[0]}->[0];
       my $key=mangle_key($_->[1]);
@@ -531,22 +538,6 @@ sub print_switches {
    }
 }
 
-sub main {
-   $old_trace = Gimp::set_trace (0);
-   if ($Gimp::help) {
-      my $this=this_script;
-      print __<<EOF;
-       interface-arguments are
-           -o | --output <filespec>   write image to disk
-           -i | --interact            let the user edit the values first
-       script-arguments are
-EOF
-      print_switches ($this);
-   } else {
-      Gimp::main;
-   }
-}
-
 1;
 __END__
 
diff --git a/Gimp/Makefile.PL b/Gimp/Makefile.PL
index b94e062..6f76410 100644
--- a/Gimp/Makefile.PL
+++ b/Gimp/Makefile.PL
@@ -8,7 +8,9 @@ my $pkg = new ExtUtils::Depends Gimp;
 $pkg->set_inc($cfg{GIMP_CFLAGS}.' '.&PDL::Core::Dev::PDL_INCLUDE);
 $pkg->set_libs("$cfg{GIMP_LIBS} $cfg{INTLLIBS}");
 $pkg->add_typemaps("$topdir/typemap", &PDL::Core::Dev::PDL_TYPEMAP);
-$pkg->add_pm(map { ($_ => "\$(INST_LIB)/Gimp/$_") } glob '*.pm');
+$pkg->add_pm(
+  map { ($_ => "\$(INST_LIB)/Gimp/$_") } grep { $_ ne 'IFiles.pm' } glob '*.pm'
+);
 
 WriteMakefile(
     'NAME'     => 'Gimp::Lib',
diff --git a/Makefile.PL b/Makefile.PL
index f5d274f..21e9199 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -27,13 +27,13 @@ EOF
 }
 
 my $cfg = io("Gimp/Config.pm.in")->all or die "Gimp/Config.pm.in: $!\n";
-$Data::Dumper::Terse = 1; $Data::Dumper::Indent = 0;
-$cfg =~ s/#CFG#/join "", map { "  $_ => ".Dumper($cfg{$_}).",\n" } keys %cfg/e;
+$cfg =~ s/#CFG#/Data::Dumper->Dump([\%cfg], ['*Gimp::Config'])/e;
 io("Gimp/Config.pm")->print($cfg) or die "Gimp/Config.pm: $!\n";
 
 my $pkg = new ExtUtils::Depends Gimp, Gtk2;
 $pkg->set_inc($cfg{GIMP_CFLAGS});
 $pkg->add_pm(map { ($_ => "\$(INST_LIB)/$_") } qw(Gimp.pm));
+$pkg->save_config('Gimp/IFiles.pm');
 
 WriteMakefile(
   'dist'       => {


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