[libmodule-build-xsutil-perl] 01/05: Imported Upstream version 0.10

gregor herrmann gregoa at debian.org
Sat May 3 14:38:23 UTC 2014


This is an automated email from the git hooks/post-receive script.

gregoa pushed a commit to branch master
in repository libmodule-build-xsutil-perl.

commit dc8267138c0a2b4617bb183f4a6a0cbb956d3e0e
Author: gregor herrmann <gregoa at debian.org>
Date:   Sat May 3 16:28:34 2014 +0200

    Imported Upstream version 0.10
---
 Build.PL                   |  2 +-
 Changes                    | 12 ++++++++
 MANIFEST                   | 12 ++++++--
 META.json                  | 14 ++++++---
 META.yml                   | 11 +++++--
 cpanfile                   |  5 ++++
 eg/Foo/Build.PL            | 17 +++++++++++
 eg/Foo/MANIFEST            |  6 ++++
 eg/Foo/MANIFEST.SKIP       | 73 ++++++++++++++++++++++++++++++++++++++++++++++
 eg/Foo/lib/Foo.pm          | 29 ++++++++++++++++++
 eg/Foo/lib/Foo.xs          | 28 ++++++++++++++++++
 eg/Foo/t/basic.t           |  9 ++++++
 eg/Foo/typemap             |  1 +
 lib/Module/Build/XSUtil.pm | 14 +++++----
 t/01_build.t               | 32 ++++++++++++++++++++
 15 files changed, 250 insertions(+), 15 deletions(-)

diff --git a/Build.PL b/Build.PL
index f94a2bb..be972ba 100644
--- a/Build.PL
+++ b/Build.PL
@@ -34,7 +34,7 @@ my %args = (
     test_files           => ((-d '.git' || $ENV{RELEASE_TESTING}) && -d 'xt') ? 't/ xt/' : 't/',
     recursive_test_files => 1,
 
-    
+
 );
 if (-d 'share') {
     $args{share_dir} = 'share';
diff --git a/Changes b/Changes
index fc5ce11..e1dfac8 100644
--- a/Changes
+++ b/Changes
@@ -1,5 +1,17 @@
 Revision history for Perl extension Module-Build-XSHelper
 
+0.10 2014-05-02T21:04:33Z
+    - Add build test
+
+0.09 2014-05-01T01:55:51Z
+    - Remove broken test
+
+0.08 2014-04-30T10:08:48Z
+    - Fixed broken test
+
+0.07 2014-04-28T15:10:06Z
+    - Fixed issue #4
+
 0.06 2014-01-12T02:14:32Z
     - Fixed typo in POD
 
diff --git a/MANIFEST b/MANIFEST
index 0e4e941..96da091 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -1,10 +1,18 @@
 Build.PL
 Changes
 LICENSE
+MANIFEST
 META.json
 README.md
 cpanfile
+eg/Foo/Build.PL
+eg/Foo/MANIFEST
+eg/Foo/MANIFEST.SKIP
+eg/Foo/lib/Foo.pm
+eg/Foo/lib/Foo.xs
+eg/Foo/t/basic.t
+eg/Foo/typemap
 lib/Module/Build/XSUtil.pm
 t/00_compile.t
-META.yml
-MANIFEST
\ No newline at end of file
+t/01_build.t
+META.yml
\ No newline at end of file
diff --git a/META.json b/META.json
index 74b4635..c3de6df 100644
--- a/META.json
+++ b/META.json
@@ -4,7 +4,7 @@
       ":"
    ],
    "dynamic_config" : 0,
-   "generated_by" : "Minilla/v0.11.0",
+   "generated_by" : "Minilla/v0.15.2",
    "license" : [
       "perl_5"
    ],
@@ -36,7 +36,8 @@
       "develop" : {
          "requires" : {
             "Test::CPAN::Meta" : "0",
-            "Test::MinimumVersion" : "0.10108",
+            "Test::MinimumVersion::Fast" : "0.04",
+            "Test::PAUSE::Permissions" : "0.04",
             "Test::Pod" : "1.41",
             "Test::Spellunker" : "v0.2.7"
          }
@@ -56,6 +57,11 @@
       },
       "test" : {
          "requires" : {
+            "Capture::Tiny" : "0",
+            "Cwd::Guard" : "0",
+            "File::Copy::Recursive" : "0",
+            "File::Spec::Functions" : "0",
+            "File::Temp" : "0",
             "Test::More" : "0.98"
          }
       }
@@ -63,7 +69,7 @@
    "provides" : {
       "Module::Build::XSUtil" : {
          "file" : "lib/Module/Build/XSUtil.pm",
-         "version" : "0.06"
+         "version" : "0.10"
       }
    },
    "release_status" : "stable",
@@ -77,7 +83,7 @@
          "web" : "https://github.com/hideo55/Module-Build-XSUtil"
       }
    },
-   "version" : "0.06",
+   "version" : "0.10",
    "x_contributors" : [
       "tokuhirom <tokuhirom at gmail.com>",
       "hideo55 <hide.o.j55 at gmail.com>"
diff --git a/META.yml b/META.yml
index c139ae8..ece351c 100644
--- a/META.yml
+++ b/META.yml
@@ -3,13 +3,18 @@ abstract: 'A Module::Build class for building XS modules'
 author:
   - ':'
 build_requires:
+  Capture::Tiny: 0
+  Cwd::Guard: 0
+  File::Copy::Recursive: 0
+  File::Spec::Functions: 0
+  File::Temp: 0
   Test::More: 0.98
 configure_requires:
   CPAN::Meta: 0
   CPAN::Meta::Prereqs: 0
   Module::Build: 0.4005
 dynamic_config: 0
-generated_by: 'Minilla/v0.11.0, CPAN::Meta::Converter version 2.120921'
+generated_by: 'Minilla/v0.15.2, CPAN::Meta::Converter version 2.120921'
 license: perl
 meta-spec:
   url: http://module-build.sourceforge.net/META-spec-v1.4.html
@@ -28,7 +33,7 @@ no_index:
 provides:
   Module::Build::XSUtil:
     file: lib/Module/Build/XSUtil.pm
-    version: 0.06
+    version: 0.10
 requires:
   Devel::CheckCompiler: 0.02
   Devel::PPPort: 3.19
@@ -43,7 +48,7 @@ resources:
   bugtracker: https://github.com/hideo55/Module-Build-XSUtil/issues
   homepage: https://github.com/hideo55/Module-Build-XSUtil
   repository: git://github.com/hideo55/Module-Build-XSUtil.git
-version: 0.06
+version: 0.10
 x_contributors:
   - 'tokuhirom <tokuhirom at gmail.com>'
   - 'hideo55 <hide.o.j55 at gmail.com>'
diff --git a/cpanfile b/cpanfile
index f863e44..baba4bf 100644
--- a/cpanfile
+++ b/cpanfile
@@ -14,5 +14,10 @@ on 'configure' => sub{
 
 on 'test' => sub {
     requires 'Test::More', '0.98';
+    requires 'File::Spec::Functions';
+    requires 'Capture::Tiny';
+    requires 'Cwd::Guard';
+    requires 'File::Temp';
+    requires 'File::Copy::Recursive';
 };
 
diff --git a/eg/Foo/Build.PL b/eg/Foo/Build.PL
new file mode 100644
index 0000000..e43edc2
--- /dev/null
+++ b/eg/Foo/Build.PL
@@ -0,0 +1,17 @@
+use strict;
+use warnings;
+use Module::Build::XSUtil;
+
+my $builder = Module::Build::XSUtil->new(
+    name                 => 'Foo',
+    module_name          => 'Foo',
+    test_files           => 't/',
+    license              => 'perl',
+    dynamic_config       => 0,
+
+    configure_requires  => { 'Module::Build::XSUtil' => 0, },
+    generate_ppport_h   => 'lib/ppport.h',
+    generate_xshelper_h => 'lib/xshelper.h',
+);
+
+$builder->create_build_script();
diff --git a/eg/Foo/MANIFEST b/eg/Foo/MANIFEST
new file mode 100644
index 0000000..df7df35
--- /dev/null
+++ b/eg/Foo/MANIFEST
@@ -0,0 +1,6 @@
+Build.PL
+lib/Foo.pm
+lib/Foo.xs
+MANIFEST			This list of files
+t/basic.t
+typemap
diff --git a/eg/Foo/MANIFEST.SKIP b/eg/Foo/MANIFEST.SKIP
new file mode 100644
index 0000000..771d889
--- /dev/null
+++ b/eg/Foo/MANIFEST.SKIP
@@ -0,0 +1,73 @@
+
+#!start included /Users/hide/perl5/perlbrew/perls/perl-5.18.1/lib/5.18.1/ExtUtils/MANIFEST.SKIP
+# Avoid version control files.
+\bRCS\b
+\bCVS\b
+\bSCCS\b
+,v$
+\B\.svn\b
+\B\.git\b
+\B\.gitignore\b
+\b_darcs\b
+\B\.cvsignore$
+
+# Avoid VMS specific MakeMaker generated files
+\bDescrip.MMS$
+\bDESCRIP.MMS$
+\bdescrip.mms$
+
+# Avoid Makemaker generated and utility files.
+\bMANIFEST\.bak
+\bMakefile$
+\bblib/
+\bMakeMaker-\d
+\bpm_to_blib\.ts$
+\bpm_to_blib$
+\bblibdirs\.ts$         # 6.18 through 6.25 generated this
+
+# Avoid Module::Build generated and utility files.
+\bBuild$
+\b_build/
+\bBuild.bat$
+\bBuild.COM$
+\bBUILD.COM$
+\bbuild.com$
+
+# Avoid temp and backup files.
+~$
+\.old$
+\#$
+\b\.#
+\.bak$
+\.tmp$
+\.#
+\.rej$
+
+# Avoid OS-specific files/dirs
+# Mac OSX metadata
+\B\.DS_Store
+# Mac OSX SMB mount metadata files
+\B\._
+
+# Avoid Devel::Cover and Devel::CoverX::Covered files.
+\bcover_db\b
+\bcovered\b
+
+# Avoid MYMETA files
+^MYMETA\.
+#!end included /Users/hide/perl5/perlbrew/perls/perl-5.18.1/lib/5.18.1/ExtUtils/MANIFEST.SKIP
+
+# Avoid configuration metadata file
+^MYMETA\.
+
+# Avoid Module::Build generated and utility files.
+\bBuild$
+\bBuild.bat$
+\b_build
+\bBuild.COM$
+\bBUILD.COM$
+\bbuild.com$
+^MANIFEST\.SKIP
+
+# Avoid archives of this distribution
+\bFoo-[\d\.\_]+
diff --git a/eg/Foo/lib/Foo.pm b/eg/Foo/lib/Foo.pm
new file mode 100644
index 0000000..31a553a
--- /dev/null
+++ b/eg/Foo/lib/Foo.pm
@@ -0,0 +1,29 @@
+package Foo;
+use strict;
+use warnings;
+use XSLoader;
+
+require Exporter;
+our @ISA = qw(Exporter);
+
+our @EXPORT_OK = qw(ok);
+
+BEGIN {
+    our $VERSION = '0.10';
+    XSLoader::load __PACKAGE__, $VERSION;
+}
+
+1;
+__END__
+
+=head1 NAME
+
+Foo - Perl extension for blah blah blah
+
+=head1 DESCRIPTION
+
+Stub documentation for Foo.
+
+=head1 AUTHOR
+
+A. U. Thor, author\@example.com
diff --git a/eg/Foo/lib/Foo.xs b/eg/Foo/lib/Foo.xs
new file mode 100644
index 0000000..97a050f
--- /dev/null
+++ b/eg/Foo/lib/Foo.xs
@@ -0,0 +1,28 @@
+#include "EXTERN.h"
+#include "perl.h"
+#include "XSUB.h"
+#include "ppport.h"
+#include "xshelper.h"
+
+MODULE = Foo PACKAGE = Foo
+
+SV *
+ok()
+CODE:
+    RETVAL = newSVpv( "ok", 0 );
+OUTPUT:
+    RETVAL
+
+const char *
+xs_version()
+CODE:
+    RETVAL = XS_VERSION;
+OUTPUT:
+    RETVAL
+
+const char *
+version()
+CODE:
+    RETVAL = VERSION;
+OUTPUT:
+    RETVAL
\ No newline at end of file
diff --git a/eg/Foo/t/basic.t b/eg/Foo/t/basic.t
new file mode 100644
index 0000000..f283989
--- /dev/null
+++ b/eg/Foo/t/basic.t
@@ -0,0 +1,9 @@
+use Test::More tests => 2;
+use strict;
+use Foo;
+
+ok 1;
+
+ok( Foo::ok() eq 'ok' );
+
+__END__
\ No newline at end of file
diff --git a/eg/Foo/typemap b/eg/Foo/typemap
new file mode 100644
index 0000000..fcf2b1b
--- /dev/null
+++ b/eg/Foo/typemap
@@ -0,0 +1 @@
+const char *	tT_PV
diff --git a/lib/Module/Build/XSUtil.pm b/lib/Module/Build/XSUtil.pm
index def429b..77f0c3b 100644
--- a/lib/Module/Build/XSUtil.pm
+++ b/lib/Module/Build/XSUtil.pm
@@ -4,9 +4,11 @@ use strict;
 use warnings;
 use Config;
 use Module::Build;
+use File::Basename;
+use File::Path;
 our @ISA = qw(Module::Build);
 
-our $VERSION = "0.06";
+our $VERSION = "0.10";
 
 __PACKAGE__->add_property( 'ppport_h_path'   => undef );
 __PACKAGE__->add_property( 'xshelper_h_path' => undef );
@@ -108,9 +110,10 @@ sub ACTION_code {
     # write xshelper.h
     if ( my $xshelper = $self->xshelper_h_path ) {
         File::Path::mkpath( File::Basename::dirname($xshelper) );
-        if ( my $fh = IO::File->new("> $xshelper") ) {
-            $fh->print( _xshelper_h() );
-            $fh->close;
+        
+        if ( open(my $fh, '>', $xshelper) ) {
+            print $fh _xshelper_h();
+            close $fh;
         }
     }
 
@@ -127,8 +130,9 @@ sub ACTION_manifest_skip {
     my $self = shift;
     $self->SUPER::ACTION_manifest_skip(@_);
     if ( -e 'MANIFEST.SKIP' ) {
-        my $fh      = IO::File->new("< MANIFEST.SKIP");
+        open(my $fh, '<', 'MANIFEST.SKIP') or die $!;
         my $content = do { local $/; <$fh> };
+        close $fh;
         my $ppport  = $self->ppport_h_path;
         if ( $ppport && $content !~ /\Q${ppport}\E/ ) {
 
diff --git a/t/01_build.t b/t/01_build.t
new file mode 100644
index 0000000..06b7b15
--- /dev/null
+++ b/t/01_build.t
@@ -0,0 +1,32 @@
+use Test::More;
+use Config;
+use File::Spec::Functions qw(catdir catfile rel2abs);
+use File::Temp qw(tempdir);
+use File::Copy::Recursive 'dircopy';
+use Cwd::Guard qw(cwd_guard);
+use Capture::Tiny qw(capture);
+ 
+my $perl = $Config{perlpath};
+my @perl = ($perl, map { "-I" . $_ } @INC);
+ 
+my $eg_dir = rel2abs(catdir(qw/eg Foo/));
+my $tmp_dir = tempdir( CLEANUP => 1 );
+ 
+dircopy($eg_dir, $tmp_dir);
+ 
+like run_cmd($tmp_dir, @perl, catfile($tmp_dir, 'Build.PL')), qr/Creating new 'Build' script for 'Foo' version/;
+run_cmd($tmp_dir, @perl, catfile($tmp_dir, 'Build'));
+like run_cmd($tmp_dir, @perl, catfile($tmp_dir, 'Build test')), qr/Result\:\s*PASS/;
+done_testing;
+ 
+sub run_cmd {
+    my ($work_dir, @cmd) = @_;
+    my $cmd = join ' ', @cmd;
+    my $guard = cwd_guard($work_dir);
+    my ($stdout, $stderr, $result) = capture{
+        system($cmd);
+    };
+    return $stdout;
+}
+ 
+__END__

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libmodule-build-xsutil-perl.git



More information about the Pkg-perl-cvs-commits mailing list