[112383] trunk/dports/perl/p5-pdl

macsforever2000 at macports.org macsforever2000 at macports.org
Mon Oct 21 12:57:24 PDT 2013


Revision: 112383
          https://trac.macports.org/changeset/112383
Author:   macsforever2000 at macports.org
Date:     2013-10-21 12:57:24 -0700 (Mon, 21 Oct 2013)
Log Message:
-----------
p5-pdl: Update to version 2.6. (#39222)

Modified Paths:
--------------
    trunk/dports/perl/p5-pdl/Portfile

Added Paths:
-----------
    trunk/dports/perl/p5-pdl/files/
    trunk/dports/perl/p5-pdl/files/fix-pdldocdb.pl

Modified: trunk/dports/perl/p5-pdl/Portfile
===================================================================
--- trunk/dports/perl/p5-pdl/Portfile	2013-10-21 19:54:54 UTC (rev 112382)
+++ trunk/dports/perl/p5-pdl/Portfile	2013-10-21 19:57:24 UTC (rev 112383)
@@ -5,8 +5,7 @@
 PortGroup           perl5 1.0
 
 perl5.branches      5.8 5.10 5.12 5.14 5.16
-perl5.setup         PDL 2.4.11
-revision            1
+perl5.setup         PDL 2.006
 maintainers         saao.ac.za:tim
 license             Artistic GPL-2
 description         Perl Data Language - scientific computing capability for perl
@@ -20,26 +19,57 @@
 
 homepage            http://pdl.perl.org/
 
-checksums           rmd160  7c877c7477930a0a874190670aedc6375746c63d \
-                    sha256  c777ed2519d73ebde0d870e94931a2d2c57865abcee27dfec53f4412a2cac662
+checksums           rmd160 d95e3fcd0b350a1863c28d331a44a902ae3b44be \
+                    sha256 78119429cbe9b23387173db9c0e8c39de18a4a8ec757c10d4156fa30979d7ec5
 
 if {${perl5.major} != ""} {
-    # proj 4.7 is needed for now. https://trac.macports.org/ticket/35292
-    depends_lib-append  port:p${perl5.major}-text-balanced \
+    depends_lib-append \
+                        port:p${perl5.major}-astro-fits-header \
                         port:p${perl5.major}-inline \
+                        port:p${perl5.major}-term-readline-gnu \
                         port:p${perl5.major}-extutils-f77 \
-                        port:p${perl5.major}-gd \
-                        port:p${perl5.major}-astro-fits-header \
                         port:netpbm \
                         port:hdf5-18 \
                         port:jpeg \
                         port:gsl \
                         port:fftw-3 \
-                        port:proj47 \
                         port:pgplot \
-                        port:p${perl5.major}-term-readline-gnu \
-                        port:plplot
+                        port:p${perl5.major}-pgplot \
+                        port:plplot \
+                        port:p${perl5.major}-convert-uu \
+                        port:p${perl5.major}-file-map \
+                        port:p${perl5.major}-module-compile
 
+                        # Might be needed:
+                        # port:p${perl5.major}-gd \
+                        # port:p${perl5.major}-opengl \
+
+                        # Needed for pdl2, but no MacPort package available
+                        # and the dependency chain is very long
+                        # port:p${perl5.major}-devel-repl \
+
+                        # proj 4.7 might not be needed anymore
+                        # https://trac.macports.org/ticket/35292
+                        # port:proj47  \
+
+    # Prereqs in Makefile.PL:
+    # 'Astro::FITS::Header' => 0,
+    # 'Convert::UU'         => 0,
+    # 'Data::Dumper'        => 2.121,       # core 2.121 in 5.6.2
+    # 'ExtUtils::MakeMaker' => 6.31,        # core 6.30 in 5.8.8
+    # 'File::Map'           => 0.47,
+    # 'File::Spec'          => 0.6,         # core 0.6 in 5.00405
+    # 'File::Temp'          => 0,           # core in 5.6.1
+    # 'Filter::Util::Call'  => 0,           # core in 5.7.4
+    # 'Filter::Simple'      => 0.88,        # core, but only 0.84
+    # 'Inline'              => 0.43,
+    # 'Module::Compile'     => 0.23,
+    # 'Pod::Parser'         => 0,           # core in 5.6.0
+    # 'Pod::Select'         => 0,           # core in 5.6.0
+    # 'Storable'            => 1.03,        # core 2.04 in 5.8.0
+    # 'Text::Balanced'      => 1.89,        # core 1.89 in 5.7.3
+
+
     # pgplot is not universal
     universal_variant   no
 
@@ -57,4 +87,22 @@
             ${worksrcpath}/Lib/Transform/Proj4/Makefile.PL \
             ${worksrcpath}/t/callext.t
     }
+
+    post-build {
+        # Create the pdldoc.db file for the help system
+        exec ${perl5.bin} -I ${worksrcpath}/blib/arch \
+            -I ${worksrcpath}/blib/lib \
+            ${worksrcpath}/Doc/scantree.pl ${worksrcpath}/blib/lib \
+            ${worksrcpath}/pdldoc.db \
+            ${worksrcpath}/blib/lib/PDL/Index.pod \
+            >/dev/null 2>/dev/null
+
+        # Rewrite the paths in the pdldoc.db file. scantree will have the
+        # ${worksrcpath}/blib/lib paths, we need ${perl5.archlib}.
+        exec ${perl5.bin} ${filespath}/fix-pdldocdb.pl \
+            ${worksrcpath}/pdldoc.db \
+            ${worksrcpath}/blib/lib/PDL/pdldoc.db \
+            "${worksrcpath}/blib/lib" \
+            "${perl5.archlib}"
+    }
 }

Added: trunk/dports/perl/p5-pdl/files/fix-pdldocdb.pl
===================================================================
--- trunk/dports/perl/p5-pdl/files/fix-pdldocdb.pl	                        (rev 0)
+++ trunk/dports/perl/p5-pdl/files/fix-pdldocdb.pl	2013-10-21 19:57:24 UTC (rev 112383)
@@ -0,0 +1,63 @@
+#!/usr/bin/env perl
+
+use strict;
+use warnings;
+
+my ( $src_file, $dst_file, $cur_path, $new_path ) = @ARGV;
+usage() unless $src_file && $dst_file && -e $src_file;
+usage() unless $cur_path && $new_path;
+
+sub usage {
+    warn "usage: $0 <input pdldoc.db> <output pdldoc.db>\n";
+    warn "          <current path> <path after install>\n";
+    warn @_;
+    exit 1;
+}
+
+my $hash = ensuredb( { File => [$src_file], Scanned => [], } );
+fix_directories($hash);
+savedb( { Outfile => $dst_file }, $hash );
+
+sub fix_directories {
+    my ($hash) = @_;
+
+    for my $key (%$hash) {
+        next unless exists $hash->{$key}->{File};
+        $hash->{$key}->{File} =~ s{^$cur_path}{$new_path};
+    }
+}
+
+# Taken from PDL::Doc with minor modifications
+sub ensuredb {
+    my ($this) = @_;
+    while ( my $fi = pop @{ $this->{File} } ) {
+        open IN, $fi
+          or die "can't open database $fi, scan docs first";
+        binmode IN;
+        my ( $plen, $txt );
+        while ( read IN, $plen, 2 ) {
+            my ($len) = unpack "S", $plen;
+            read IN, $txt, $len;
+            my ( $sym, %hash ) = split chr(0), $txt;
+            $this->{SYMS}->{$sym} = {%hash};
+        }
+        close IN;
+        push @{ $this->{Scanned} }, $fi;
+    }
+    return $this->{SYMS};
+}
+
+sub savedb {
+    my ( $this, $hash ) = @_;
+    ## my $hash = $this->ensuredb();
+
+    open OUT, ">$this->{Outfile}"
+      or die "can't write to symdb $this->{Outfile}";
+    binmode OUT;
+    while ( my ( $key, $val ) = each %$hash ) {
+        next unless scalar(%$val);
+        my $txt = "$key" . chr(0) . join( chr(0), %$val );
+        print OUT pack( "S", length($txt) ) . $txt;
+    }
+}
+
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20131021/2a24c25b/attachment.html>


More information about the macports-changes mailing list