Codebase list libmodule-build-tiny-perl / 81f2261
Update upstream source from tag 'upstream/0.043' Update to upstream version '0.043' with Debian dir 6b01c5597fdc6efd80e6e41dd057f61303b8b3ef gregor herrmann 1 year, 19 days ago
14 changed file(s) with 200 addition(s) and 134 deletion(s). Raw diff Collapse all Expand all
00 use 5.006;
11 use lib 'lib';
22 use Module::Build::Tiny;
3 Build_PL(@ARGV);
3 Build_PL(\@ARGV, \%ENV);
00 Revision history for Module::Build::Tiny
1
2 0.043 2023-04-19 02:05:14+02:00 Europe/Amsterdam
3 - Fix manification test for perls without man paths
4
5 0.042 2023-04-18 23:32:40+02:00 Europe/Amsterdam
6 - Restore manpage generation
7 - Add include/ to include paths
8 - Compile all .c files in src/
9
10 0.041 2023-04-17 16:03:06+02:00 Europe/Amsterdam
11 - Released without changes from 0.040
12
13 0.040 2023-02-05 23:06:28+01:00 Europe/Amsterdam (TRIAL RELEASE)
14 - Manify .pod after .pm
15 - Filter out script documentation from scripts
16 - Don't manify podless modules/scripts
117
218 0.039 2014-10-12 10:38:39+02:00 Europe/Amsterdam
319 Supply basename to *.PL files as its args
0
10 This is the Perl distribution Module-Build-Tiny.
21
32 Installing Module-Build-Tiny is straightforward.
87
98 % cpanm Module::Build::Tiny
109
11 If you are installing into a system-wide directory, you may need to pass the
12 "-S" flag to cpanm, which uses sudo to install the module:
13
14 % cpanm -S Module::Build::Tiny
10 If it does not have permission to install modules to the current perl, cpanm
11 will automatically set up and install to a local::lib in your home directory.
12 See the local::lib documentation (https://metacpan.org/pod/local::lib) for
13 details on enabling it in your environment.
1514
1615 ## Installing with the CPAN shell
1716
2120
2221 ## Manual installation
2322
24 As a last resort, you can manually install it. Download the tarball, untar it,
25 then build it:
23 As a last resort, you can manually install it. If you have not already
24 downloaded the release tarball, you can find the download link on the module's
25 MetaCPAN page: https://metacpan.org/pod/Module::Build::Tiny
26
27 Untar the tarball, install configure prerequisites (see below), then build it:
2628
2729 % perl Build.PL
2830 % ./Build && ./Build test
3133
3234 % ./Build install
3335
34 If you are installing into a system-wide directory, you may need to run:
36 Or the more portable variation:
3537
36 % sudo ./Build install
38 % perl Build.PL
39 % perl Build
40 % perl Build test
41 % perl Build install
42
43 If your perl is system-managed, you can create a local::lib in your home
44 directory to install modules to. For details, see the local::lib documentation:
45 https://metacpan.org/pod/local::lib
46
47 The prerequisites of this distribution will also have to be installed manually. The
48 prerequisites are listed in one of the files: `MYMETA.yml` or `MYMETA.json` generated
49 by running the manual build process described above.
50
51 ## Configure Prerequisites
52
53 This distribution requires other modules to be installed before this
54 distribution's installer can be run. They can be found under the
55 "configure_requires" key of META.yml or the
56 "{prereqs}{configure}{requires}" key of META.json.
57
58 ## Other Prerequisites
59
60 This distribution may require additional modules to be installed after running
61 Build.PL.
62 Look for prerequisites in the following phases:
63
64 * to run ./Build, PHASE = build
65 * to use the module code itself, PHASE = runtime
66 * to run tests, PHASE = test
67
68 They can all be found in the "PHASE_requires" key of MYMETA.yml or the
69 "{prereqs}{PHASE}{requires}" key of MYMETA.json.
3770
3871 ## Documentation
3972
4073 Module-Build-Tiny documentation is available as POD.
41 You can run perldoc from a shell to read the documentation:
74 You can run `perldoc` from a shell to read the documentation:
4275
4376 % perldoc Module::Build::Tiny
77
78 For more information on installing Perl modules via CPAN, please see:
79 https://www.cpan.org/modules/INSTALL.html
291291
292292 - "Package" refers to the collection of files distributed by the Copyright
293293 Holder, and derivatives of that collection of files created through
294 textual modification.
294 textual modification.
295295 - "Standard Version" refers to such a Package if it has not been modified,
296296 or has been modified in accordance with the wishes of the Copyright
297 Holder.
297 Holder.
298298 - "Copyright Holder" is whoever is named in the copyright or copyrights for
299 the package.
299 the package.
300300 - "You" is you, if you're thinking about copying or distributing this Package.
301301 - "Reasonable copying fee" is whatever you can justify on the basis of media
302302 cost, duplication charges, time of people involved, and so on. (You will
303303 not be required to justify it to the Copyright Holder, but only to the
304 computing community at large as a market that must bear the fee.)
304 computing community at large as a market that must bear the fee.)
305305 - "Freely Available" means that no fee is charged for the item itself, though
306306 there may be fees involved in handling the item. It also means that
307307 recipients of the item may redistribute it under the same conditions they
308 received it.
308 received it.
309309
310310 1. You may make and give away verbatim copies of the source form of the
311311 Standard Version of this Package without restriction, provided that you
372372
373373 9. THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
374374 WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
375 MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
375 MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
376376
377377 The End
378378
0 # This file was automatically generated by Dist::Zilla::Plugin::Manifest v5.020.
0 # This file was automatically generated by Dist::Zilla::Plugin::Manifest v6.029.
11 Build.PL
22 Changes
33 INSTALL
99 Todo
1010 dist.ini
1111 lib/Module/Build/Tiny.pm
12 t/00-compile.t
1312 t/lib/DistGen.pm
14 t/release-pod-syntax.t
1513 t/simple.t
14 xt/author/pod-syntax.t
44 "David Golden <dagolden@cpan.org>"
55 ],
66 "dynamic_config" : 0,
7 "generated_by" : "Dist::Zilla version 5.020, CPAN::Meta::Converter version 2.142060",
7 "generated_by" : "Dist::Zilla version 6.029, CPAN::Meta::Converter version 2.150010",
88 "license" : [
99 "perl_5"
1010 ],
1111 "meta-spec" : {
1212 "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec",
13 "version" : "2"
13 "version" : 2
1414 },
1515 "name" : "Module-Build-Tiny",
1616 "prereqs" : {
4040 },
4141 "develop" : {
4242 "requires" : {
43 "Test::More" : "0",
4344 "Test::Pod" : "1.41"
4445 }
4546 },
8182 "File::Spec" : "0",
8283 "File::Temp" : "0",
8384 "IO::File" : "0",
84 "IO::Handle" : "0",
8585 "IPC::Open2" : "0",
86 "IPC::Open3" : "0",
8786 "Test::More" : "0.88",
8887 "XSLoader" : "0",
8988 "blib" : "0",
9897 "provides" : {
9998 "Module::Build::Tiny" : {
10099 "file" : "lib/Module/Build/Tiny.pm",
101 "version" : "0.039"
100 "version" : "0.043"
102101 }
103102 },
104103 "release_status" : "stable",
105104 "resources" : {
106105 "bugtracker" : {
107 "mailto" : "bug-module-build-tiny at rt.cpan.org",
108 "web" : "http://rt.cpan.org/Public/Dist/Display.html?Name=Module-Build-Tiny"
106 "web" : "https://github.com/Perl-Toolchain-Gang/module-build-tiny/issues"
109107 },
110108 "repository" : {
111109 "type" : "git",
112 "url" : "git://github.com/Leont/module-build-tiny.git",
113 "web" : "https://github.com/Leont/module-build-tiny"
110 "url" : "git://github.com/Perl-Toolchain-Gang/module-build-tiny.git",
111 "web" : "https://github.com/Perl-Toolchain-Gang/module-build-tiny"
114112 }
115113 },
116 "version" : "0.039"
114 "version" : "0.043",
115 "x_generated_by_perl" : "v5.36.0",
116 "x_serialization_backend" : "Cpanel::JSON::XS version 4.29",
117 "x_spdx_expression" : "Artistic-1.0-Perl OR GPL-1.0-or-later"
117118 }
118119
99 File::Spec: '0'
1010 File::Temp: '0'
1111 IO::File: '0'
12 IO::Handle: '0'
1312 IPC::Open2: '0'
14 IPC::Open3: '0'
1513 Test::More: '0.88'
1614 XSLoader: '0'
1715 blib: '0'
4139 conflicts:
4240 local::lib: '< 1.006008'
4341 dynamic_config: 0
44 generated_by: 'Dist::Zilla version 5.020, CPAN::Meta::Converter version 2.142060'
42 generated_by: 'Dist::Zilla version 6.029, CPAN::Meta::Converter version 2.150010'
4543 license: perl
4644 meta-spec:
4745 url: http://module-build.sourceforge.net/META-spec-v1.4.html
5048 provides:
5149 Module::Build::Tiny:
5250 file: lib/Module/Build/Tiny.pm
53 version: '0.039'
51 version: '0.043'
5452 requires:
5553 CPAN::Meta: '0'
5654 DynaLoader: '0'
7371 strict: '0'
7472 warnings: '0'
7573 resources:
76 bugtracker: http://rt.cpan.org/Public/Dist/Display.html?Name=Module-Build-Tiny
77 repository: git://github.com/Leont/module-build-tiny.git
78 version: '0.039'
74 bugtracker: https://github.com/Perl-Toolchain-Gang/module-build-tiny/issues
75 repository: git://github.com/Perl-Toolchain-Gang/module-build-tiny.git
76 version: '0.043'
77 x_generated_by_perl: v5.36.0
78 x_serialization_backend: 'YAML::Tiny version 1.73'
79 x_spdx_expression: 'Artistic-1.0-Perl OR GPL-1.0-or-later'
0
1
20 This archive contains the distribution Module-Build-Tiny,
3 version 0.039:
1 version 0.043:
42
53 A tiny replacement for Module::Build
64
108 the same terms as the Perl 5 programming language system itself.
119
1210
13 This README file was generated by Dist::Zilla::Plugin::Readme v5.020.
14
11 This README file was generated by Dist::Zilla::Plugin::Readme v6.029.
44 copyright_holder = Leon Timmermans, David Golden
55 copyright_year = 2011
66
7 ;Building
8 [@LEONT]
9 ; List explicitely for 'dzil authodeps'
10 ;authordep Dist::Zilla::Plugin::BuildSelf
11 install_tool = self
12 BuildSelf.auto_configure_requires = 1
13 AutoPrereqs.skip = File::ShareDir
14 -remove = PodCoverageTests
7 [Git::GatherDir]
8 [PruneCruft]
9 [MetaYAML]
10 [License]
11 [Manifest]
12 [Readme]
13
14 [AutoPrereqs]
15 skip = File::ShareDir
16 [MetaJSON]
17 [GitHub::Meta]
18 [Git::NextVersion]
19 [MetaProvides::Package]
20
21 [BuildSelf]
22 auto_configure_requires = 1
23
24 [PodSyntaxTests]
25
26 [InstallGuide]
27 [PodWeaver]
28 [PkgVersion]
29 [NextRelease]
30
31 [CheckChangesHasContent]
32 [Git::Check]
33 [RunExtraTests]
34 [TestRelease]
35 [ConfirmRelease]
36
37 [MinimumPerl]
38
39 [UploadToCPAN]
40
41 [Git::Commit]
42 [Git::Tag]
43 [Git::Push]
44
1545 [Prereqs / RuntimeSuggests]
1646 constant = 1.27
1747 [Prereqs / RuntimeConflicts]
1848 local::lib = <1.006008
1949 [Prereqs / TestSuggests]
2050 File::ShareDir = 1.000
51
52 [OnlyCorePrereqs]
53 :version = 0.012
54 check_dual_life_versions = 0
55 skip = ExtUtils::Config
56 skip = ExtUtils::Helpers
57 skip = ExtUtils::InstallPaths
00 package Module::Build::Tiny;
1 $Module::Build::Tiny::VERSION = '0.039';
1 $Module::Build::Tiny::VERSION = '0.043';
22 use strict;
33 use warnings;
44 use Exporter 5.57 'import';
2222 print $fh $content;
2323 }
2424 sub read_file {
25 my ($filename, $mode) = @_;
25 my ($filename) = @_;
2626 open my $fh, '<', $filename or die "Could not open $filename: $!\n";
2727 return do { local $/; <$fh> };
2828 }
6060 my $version = $options->{meta}->version;
6161 require ExtUtils::CBuilder;
6262 my $builder = ExtUtils::CBuilder->new(config => $options->{config}->values_set);
63 my $ob_file = $builder->compile(source => $c_file, defines => { VERSION => qq/"$version"/, XS_VERSION => qq/"$version"/ }, include_dirs => [ curdir, dirname($source) ]);
63 my @objects = $builder->compile(source => $c_file, defines => { VERSION => qq/"$version"/, XS_VERSION => qq/"$version"/ }, include_dirs => [ curdir, 'include', dirname($source) ]);
64
65 my $o = $options->{config}->get('_o');
66 for my $c_source (find(qr/\.c$/, 'src')) {
67 my $o_file = catfile($tempdir, basename($c_source, '.c') . $o);
68 push @objects, $builder->compile(source => $c_file, include_dirs => [ curdir, 'include', dirname($source) ])
69 }
6470
6571 require DynaLoader;
6672 my $mod2fname = defined &DynaLoader::mod2fname ? \&DynaLoader::mod2fname : sub { return $_[0][-1] };
6773
6874 mkpath($archdir, $options->{verbose}, oct '755') unless -d $archdir;
6975 my $lib_file = catfile($archdir, $mod2fname->(\@parts) . '.' . $options->{config}->get('dlext'));
70 return $builder->link(objects => $ob_file, lib_file => $lib_file, module_name => join '::', @parts);
76 return $builder->link(objects => \@objects, lib_file => $lib_file, module_name => join '::', @parts);
7177 }
7278
7379 sub find {
7783 return @ret;
7884 }
7985
86 sub contains_pod {
87 my ($file) = @_;
88 return unless -T $file;
89 return read_file($file) =~ /^\=(?:head|pod|item)/m;
90 }
91
8092 my %actions = (
8193 build => sub {
8294 my %opt = @_;
8395 for my $pl_file (find(qr/\.PL$/, 'lib')) {
84 (my $pm = $pl_file) =~ s/\.PL$//;
96 (my $pm = $pl_file) =~ s/\.PL$//;
8597 system $^X, $pl_file, $pm and die "$pl_file returned $?\n";
8698 }
87 my %modules = map { $_ => catfile('blib', $_) } find(qr/\.p(?:m|od)$/, 'lib');
99 my %modules = map { $_ => catfile('blib', $_) } find(qr/\.pm$/, 'lib');
100 my %docs = map { $_ => catfile('blib', $_) } find(qr/\.pod$/, 'lib');
88101 my %scripts = map { $_ => catfile('blib', $_) } find(qr//, 'script');
102 my %sdocs = map { $_ => delete $scripts{$_} } grep { /.pod$/ } keys %scripts;
89103 my %shared = map { $_ => catfile(qw/blib lib auto share dist/, $opt{meta}->name, abs2rel($_, 'share')) } find(qr//, 'share');
90 pm_to_blib({ %modules, %scripts, %shared }, catdir(qw/blib lib auto/));
104 pm_to_blib({ %modules, %docs, %scripts, %shared }, catdir(qw/blib lib auto/));
91105 make_executable($_) for values %scripts;
92106 mkpath(catdir(qw/blib arch/), $opt{verbose});
93107 process_xs($_, \%opt) for find(qr/.xs$/, 'lib');
94108
95109 if ($opt{install_paths}->install_destination('bindoc') && $opt{install_paths}->is_default_installable('bindoc')) {
96 manify($_, catfile('blib', 'bindoc', man1_pagename($_)), $opt{config}->get('man1ext'), \%opt) for keys %scripts;
110 my $section = $opt{config}->get('man1ext');
111 for my $input (keys %scripts, keys %sdocs) {
112 next unless contains_pod($input);
113 my $output = catfile('blib', 'bindoc', man1_pagename($input));
114 manify($input, $output, $section, \%opt);
115 }
97116 }
98117 if ($opt{install_paths}->install_destination('libdoc') && $opt{install_paths}->is_default_installable('libdoc')) {
99 manify($_, catfile('blib', 'libdoc', man3_pagename($_)), $opt{config}->get('man3ext'), \%opt) for keys %modules;
118 my $section = $opt{config}->get('man3ext');
119 for my $input (keys %modules, keys %docs) {
120 next unless contains_pod($input);
121 my $output = catfile('blib', 'libdoc', man3_pagename($input));
122 manify($input, $output, $section, \%opt);
123 }
100124 }
125 return 0;
101126 },
102127 test => sub {
103128 my %opt = @_;
110135 lib => [ map { rel2abs(catdir(qw/blib/, $_)) } qw/arch lib/ ],
111136 );
112137 my $tester = TAP::Harness::Env->create(\%test_args);
113 $tester->runtests(sort +find(qr/\.t$/, 't'))->has_errors and exit 1;
138 return $tester->runtests(sort +find(qr/\.t$/, 't'))->has_errors;
114139 },
115140 install => sub {
116141 my %opt = @_;
117142 die "Must run `./Build build` first\n" if not -d 'blib';
118143 install($opt{install_paths}->install_map, @opt{qw/verbose dry_run uninst/});
144 return 0;
119145 },
120146 clean => sub {
121147 my %opt = @_;
122148 rmtree($_, $opt{verbose}) for qw/blib temp/;
149 return 0;
123150 },
124151 realclean => sub {
125152 my %opt = @_;
126153 rmtree($_, $opt{verbose}) for qw/blib temp Build _build_params MYMETA.yml MYMETA.json/;
154 return 0;
127155 },
128156 );
129157
135163 GetOptionsFromArray($_, \%opt, qw/install_base=s install_path=s% installdirs=s destdir=s prefix=s config=s% uninst:1 verbose:1 dry_run:1 pureperl-only:1 create_packlist=i jobs=i/) for ($env, $bargv, \@ARGV);
136164 $_ = detildefy($_) for grep { defined } @opt{qw/install_base destdir prefix/}, values %{ $opt{install_path} };
137165 @opt{ 'config', 'meta' } = (ExtUtils::Config->new($opt{config}), get_meta());
138 $actions{$action}->(%opt, install_paths => ExtUtils::InstallPaths->new(%opt, dist_name => $opt{meta}->name));
166 exit $actions{$action}->(%opt, install_paths => ExtUtils::InstallPaths->new(%opt, dist_name => $opt{meta}->name));
139167 }
140168
141169 sub Build_PL {
154182 #ABSTRACT: A tiny replacement for Module::Build
155183
156184
157 # vi:et:sts=2:sw=2:ts=2
185 # vi:noet:sts=4:sw=4:ts=4
158186
159187 __END__
160188
168196
169197 =head1 VERSION
170198
171 version 0.039
199 version 0.043
172200
173201 =head1 SYNOPSIS
174202
183211 This module provides a simple, lightweight, drop-in replacement.
184212
185213 Whereas Module::Build has over 6,700 lines of code; this module has less
186 than 120, yet supports the features needed by most distributions.
214 than 200, yet supports the features needed by most distributions.
187215
188216 =head2 Supported
189217
219247
220248 =head2 Directory structure
221249
222 Your .pm and .pod files must be in F<lib/>. Any executables must be in
250 Your .pm, .xs and .pod files must be in F<lib/>. Any executables must be in
223251 F<script/>. Test files must be in F<t/>. Dist sharedirs must be in F<share/>.
224252
225253 =head1 USAGE
+0
-50
t/00-compile.t less more
0 use 5.006;
1 use strict;
2 use warnings;
3
4 # this test was generated with Dist::Zilla::Plugin::Test::Compile 2.040
5
6 use Test::More tests => 1 + ($ENV{AUTHOR_TESTING} ? 1 : 0);
7
8
9
10 my @module_files = (
11 'Module/Build/Tiny.pm'
12 );
13
14
15
16 # no fake home requested
17
18 my $inc_switch = -d 'blib' ? '-Mblib' : '-Ilib';
19
20 use File::Spec;
21 use IPC::Open3;
22 use IO::Handle;
23
24 open my $stdin, '<', File::Spec->devnull or die "can't open devnull: $!";
25
26 my @warnings;
27 for my $lib (@module_files)
28 {
29 # see L<perlfaq8/How can I capture STDERR from an external command?>
30 my $stderr = IO::Handle->new;
31
32 my $pid = open3($stdin, '>&STDERR', $stderr, $^X, $inc_switch, '-e', "require q[$lib]");
33 binmode $stderr, ':crlf' if $^O eq 'MSWin32';
34 my @_warnings = <$stderr>;
35 waitpid($pid, 0);
36 is($?, 0, "$lib loaded ok");
37
38 if (@_warnings)
39 {
40 warn @_warnings;
41 push @warnings, @_warnings;
42 }
43 }
44
45
46
47 is(scalar(@warnings), 0, 'no warnings found') if $ENV{AUTHOR_TESTING};
48
49
+0
-14
t/release-pod-syntax.t less more
0 #!perl
1
2 BEGIN {
3 unless ($ENV{RELEASE_TESTING}) {
4 require Test::More;
5 Test::More::plan(skip_all => 'these tests are for release candidate testing');
6 }
7 }
8
9 # This file was automatically generated by Dist::Zilla::Plugin::PodSyntaxTests.
10 use Test::More;
11 use Test::Pod 1.41;
12
13 all_pod_files_ok();
2222 $dist->add_file('script/simple', undent(<<' ---'));
2323 #!perl
2424 use Foo::Bar;
25 print Simple->VERSION . "\n";
25 print Foo::Bar->VERSION . "\n";
2626 ---
2727 my $has_compiler = ExtUtils::CBuilder->new->have_compiler();
28 $dist->add_file('lib/Simple.xs', undent(<<' ---')) if $has_compiler;
28 $dist->add_file('lib/Foo/Bar.xs', undent(<<' ---')) if $has_compiler;
2929 #define PERL_NO_GET_CONTEXT
3030 #include "EXTERN.h"
3131 #include "perl.h"
3232 #include "XSUB.h"
3333
34 MODULE = Simple PACKAGE = Simple
34 MODULE = Foo::Bar PACKAGE = Foo::Bar
3535
3636 const char*
3737 foo()
118118 ok( -f catfile(qw/blib lib auto share dist Foo-Bar file.txt/), 'sharedir file has been made');
119119
120120 if ($has_compiler) {
121 XSLoader::load('Simple');
122 is(Simple::foo(), "Hello World!\n", 'Can run XSub Simple::foo');
121 XSLoader::load('Foo::Bar');
122 is(Foo::Bar::foo(), "Hello World!\n", 'Can run XSub Foo::Bar::foo');
123 }
124
125 SKIP: {
126 require ExtUtils::InstallPaths;
127 skip 1, 'No manification supported' if not ExtUtils::InstallPaths->new->is_default_installable('libdoc');
128 require ExtUtils::Helpers;
129 my $file = "blib/libdoc/" . ExtUtils::Helpers::man3_pagename($pmfile, '.');
130 ok( -e $file, 'Module gets manified properly');
123131 }
124132 }
125133
0 #!perl
1 # This file was automatically generated by Dist::Zilla::Plugin::PodSyntaxTests.
2 use strict; use warnings;
3 use Test::More;
4 use Test::Pod 1.41;
5
6 all_pod_files_ok();