Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/dev' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
run4flat committed Apr 13, 2012
2 parents 03b7ca5 + b20c2bf commit f8f7b09
Show file tree
Hide file tree
Showing 12 changed files with 86 additions and 38 deletions.
66 changes: 45 additions & 21 deletions Build.PL
Expand Up @@ -10,40 +10,64 @@ my $inc = PDL_INCLUDE;
$inc =~ s/-I//g;
my @incs = ($inc, @{$Prima::Config::Config{incpaths}});

# At one point I had this, to handle Prima's compiler define statements, but it
# looks like they're never used and I'm not sure how I can test their
# correctness. Also, these are for ExtUtils::MakeMaker, not Module::Build, so a
# suitable translation is required:
#my %DEFINES=map { my @z = split('=', $_, 2); scalar(@z)?(@z):($_ => 1)} @{$Prima::Config::Config{cdefs}};
#$hash{CCFLAGS} .= join( ' ' , map { $Prima::Config::Config{cdefflag}.$_.'='.$DEFINES{$_}} keys %DEFINES);
# Not sure if this is necessary, but it was in PDL::PrimaImage, so I'm including
# it here in case it helps with, perhaps, OS/2.
#$hash{OBJECT}="Prima\$(OBJ_EXT)";
# Explicitly set the version here; all .pm.PL files will use this:
my $version = '0.02_01';

my $build = Module::Build->new(
module_name => 'PDL::Drawing::Prima',
dist_version_from => 'lib/PDL/Drawing/Prima.pm.PL',
dist_version => $version,
license => 'perl',
configure_requires => {
PDL => '2.4.9_014',
Prima => '1.33',
# working here - I need to check the smoke reports for the minimum
# required version:
'Module::Build' => '0',
},
build_requires => {
# working here - I need to check the smoke reports for the minimum
# required version:
'ExtUtils::ParseXS' => '0',
},
requires => {
# Due to the use of PerlIO, I need at least 5.8:
perl => '5.8.0',
PDL => '2.4.9_014',
# working here - after the initial push, I need to relax these and
# check the smoke reports for the minimum required version:
'ExtUtils::ParseXS' => '3.05',
Prima => '1.33',
'Module::Build' => '0.38',
},
needs_compiler => 1,
PL_files => {
'lib/PDL/Drawing/Prima.pm.PL'
=> ['lib/PDL/Drawing/Prima.xs', 'lib/PDL/Drawing/Prima.pm'],
'lib/PDL/Drawing/Prima/Utils.pm.PL'
=> ['lib/PDL/Drawing/Prima/Utils.xs', 'lib/PDL/Drawing/Prima/Utils.pm'],
},
include_dirs => \@incs,
# extra_linker_flags => $PDL::Config{MALLOCDBG}->{libs},

meta_merge => {
resources => {
repository
=> 'http://github.com/run4flat/PDL-Drawing-Prima',
# => {
# web => 'http://github.com/run4flat/PDL-Drawing-Prima',
# url => 'git://github.com/run4flat/PDL-Drawing-Prima.git',
# type => 'git',
# },
bugtracker
=> 'http://github.com/run4flat/PDL-Drawing-Prima/issues',
# => {
# web => 'http://github.com/run4flat/PDL-Drawing-Prima/issues',
# },
},
provides => {
'PDL::Drawing::Prima' => {
file => 'lib/PDL/Drawing/Prima.pm.PL',
version => $version,
},
'PDL::Drawing::Prima::Utils' => {
file => 'lib/PDL/Drawing/Prima/Utils.pm.PL',
version => $version,
},
},
no_index => {
file => ['README.pod'],
directory => [qw(examples t)],
},
},
);

# Find the Prima library for linking:
Expand Down
3 changes: 2 additions & 1 deletion MANIFEST
Expand Up @@ -6,9 +6,10 @@ examples/test-subclass.pl
examples/test-symbols.pl
examples/test.pl
examples/test.ps
examples/test2.pl
examples/test4.pl
examples/test_simple.pl
examples/Kuramoto.pl
examples/game-of-life.pl
lib/PDL/Drawing/Prima.pm.PL
lib/PDL/Drawing/Prima/Utils.pm.PL
MANIFEST
Expand Down
2 changes: 1 addition & 1 deletion examples/test-collate.pl
@@ -1,6 +1,6 @@
use strict;
use warnings;
use blib;
;
use PDL;
use PDL::Drawing::Prima;

Expand Down
2 changes: 1 addition & 1 deletion examples/test-poly.pl
@@ -1,6 +1,6 @@
use strict;
use warnings;
use blib;
;
use PDL;
use PDL::NiceSlice;
use Prima qw(Application);
Expand Down
2 changes: 1 addition & 1 deletion examples/test-ps.pl
@@ -1,4 +1,4 @@
use blib;
;
use strict;
use warnings;
use PDL;
Expand Down
2 changes: 1 addition & 1 deletion examples/test-subclass.pl
@@ -1,4 +1,4 @@
use blib;
;
use strict;
use warnings;
use PDL;
Expand Down
2 changes: 1 addition & 1 deletion examples/test-symbols.pl
@@ -1,4 +1,4 @@
use blib;
;
use strict;
use warnings;
use PDL;
Expand Down
2 changes: 1 addition & 1 deletion examples/test.pl
@@ -1,6 +1,6 @@
use strict;
use warnings;
use blib;
;
use PDL;
use PDL::NiceSlice;
use Prima qw(Application);
Expand Down
2 changes: 1 addition & 1 deletion examples/test4.pl
@@ -1,4 +1,4 @@
use blib;
;
use strict;
use warnings;
use PDL;
Expand Down
2 changes: 1 addition & 1 deletion examples/test_simple.pl
@@ -1,6 +1,6 @@
use strict;
use warnings;
use blib;
;
use PDL;
use Prima qw(Application);

Expand Down
20 changes: 16 additions & 4 deletions lib/PDL/Drawing/Prima.pm.PL
@@ -1,16 +1,28 @@
use strict;
use warnings;
use File::Spec;

# Invoke PDL::PP
my $base_name;
BEGIN {
$base_name = File::Spec->catfile(qw(lib PDL Drawing Prima));
# .PL scripts are sent their filename, sans the .PL part. That's almost what
# PDL::PP expects to see, so massage it into the proper form:
$base_name = $ARGV[0];
$base_name =~ s/\.pm//;

# Handle backslashes for Windows paths:
$base_name =~ s/\\/\\\\/g;
}
use PDL::PP (qw(PDL::Drawing::Prima PDL::Drawing::Prima), $base_name);

our $VERSION = 0.02;
pp_setversion($VERSION);
# Set the module version from the version stashed in the M::B object. The string
# passed to pp_setversion must include the quotes to ensure that it is processed
# as a string from the actual module:
use Module::Build;
my $build = Module::Build->current;
pp_setversion('"' . $build->dist_version . '"');

# Add the .xs file to the cleanup lists:
$build->add_to_cleanup("$base_name.xs");

use Carp qw(croak confess);

Expand Down
19 changes: 15 additions & 4 deletions lib/PDL/Drawing/Prima/Utils.pm.PL
@@ -1,17 +1,28 @@
use strict;
use warnings;
use File::Spec;

# Invoke PDL::PP
my $path;
BEGIN {
$path = File::Spec->catfile(qw(lib PDL Drawing Prima Utils));
# .PL scripts are sent their filename, sans the .PL part. That's almost what
# PDL::PP expects to see, so massage it into the proper form:
$path = $ARGV[0];
$path =~ s/\.pm//;

# Handle backslashes for Windows paths:
$path =~ s/\\/\\\\/g;
}
use PDL::PP (qw(PDL::Drawing::Prima::Utils PDL::Drawing::Prima::Utils), $path);

our $VERSION = 0.02;
pp_setversion($VERSION);
# Set the module version from the version stashed in the M::B object. The string
# passed to pp_setversion must include the quotes to ensure that it is processed
# as a string from the actual module:
use Module::Build;
my $build = Module::Build->current;
pp_setversion('"' . $build->dist_version . '"');

# Add the .xs file to the cleanup lists:
$build->add_to_cleanup("$path.xs");

pp_addpm({At=>'Top'},<<'ModuleMaterial');
Expand Down

0 comments on commit f8f7b09

Please sign in to comment.