module-build-general Mailing List for Module::Build
Status: Beta
Brought to you by:
kwilliams
You can subscribe to this list here.
| 2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(24) |
Sep
(2) |
Oct
(18) |
Nov
(36) |
Dec
(17) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2003 |
Jan
(3) |
Feb
(96) |
Mar
(82) |
Apr
(63) |
May
(90) |
Jun
(52) |
Jul
(94) |
Aug
(89) |
Sep
(75) |
Oct
(118) |
Nov
(101) |
Dec
(111) |
| 2004 |
Jan
(159) |
Feb
(155) |
Mar
(65) |
Apr
(121) |
May
(62) |
Jun
(68) |
Jul
(54) |
Aug
(45) |
Sep
(78) |
Oct
(80) |
Nov
(271) |
Dec
(205) |
| 2005 |
Jan
(128) |
Feb
(96) |
Mar
(83) |
Apr
(113) |
May
(46) |
Jun
(120) |
Jul
(146) |
Aug
(47) |
Sep
(93) |
Oct
(118) |
Nov
(116) |
Dec
(60) |
| 2006 |
Jan
(130) |
Feb
(330) |
Mar
(228) |
Apr
(203) |
May
(97) |
Jun
(15) |
Jul
(6) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
|
|
|
|
|
1
|
2
|
3
|
|
4
|
5
|
6
|
7
|
8
|
9
|
10
|
|
11
|
12
(3) |
13
|
14
(5) |
15
(1) |
16
(1) |
17
|
|
18
(3) |
19
(2) |
20
|
21
|
22
|
23
(2) |
24
|
|
25
(1) |
26
|
27
(2) |
28
(4) |
29
|
30
|
31
|
|
From: Ken W. <ke...@ma...> - 2002-08-19 09:25:34
|
On Friday, August 16, 2002, at 05:30 PM, Ken Williams wrote:
>
> On Thursday, August 15, 2002, at 08:57 PM, Autrijus Tang wrote:
>> As attached. Two things are fixed:
>>
>> - PREREQ_PM info is now written to Makefile.
>> - Friendly bootstrapping code that makes Module::Build to
>> be installed first.
>
> Both good goals.
>
Here's the patch in the form I'm applying it. It uses a new
_build/prereq file to get the valid prereq information.
-Ken
===================================================================
RCS file: /Users/ken/src/CVS-repository/modules/Module-
Build/lib/Module/Build/Compat.pm,v
retrieving revision 1.4
diff -u -r1.4 Compat.pm
--- Compat.pm 2002/08/11 10:14:09 1.4
+++ Compat.pm 2002/08/19 09:20:07
@@ -1,7 +1,7 @@
-# $Id $
package Module::Build::Compat;
use strict;
+use File::Spec;
my %makefile_to_build =
(
@@ -40,12 +40,32 @@
EOF
}
+sub fake_prereqs {
+ my $file = File::Spec->catfile('_build', 'prereqs');
+ open my $fh, "< $file" or die "Can't read $file: $!";
+ my $prereqs = eval do {local $/; <$fh>};
+ close $fh;
+
+ my @prereq;
+ foreach my $section (qw/build_requires requires recommends/) {
+ foreach (keys %{$prereqs->{$section}}) {
+ next if $_ eq 'perl';
+ push @prereq, "$_=>q[$prereqs->{$section}{$_}]";
+ }
+ }
+
+ return unless @prereq;
+ return "# PREREQ_PM => { " . join(", ", @prereq) . " }\n\n";
+}
+
+
sub write_makefile {
# Note - this doesn't yet emulate the PREREQ_PM stuff.
my ($pack, %in) = @_;
$in{makefile} ||= 'Makefile';
open MAKE, "> $in{makefile}" or die "Cannot write
$in{makefile}: $!";
+ print MAKE $pack->fake_prereqs;
print MAKE $pack->fake_makefile($in{makefile});
close MAKE;
}
@@ -59,12 +79,29 @@
Module::Build::Compat - Compatibility with ExtUtils::MakeMaker
=head1 SYNOPSIS
+
+Here's a Makefile.PL that passes all functionality through to
Module::Build
- Here's a Makefile.PL that passes all functionality through to
Module::Build
-
use Module::Build::Compat;
Module::Build::Compat->run_build_pl(args => \@ARGV);
Module::Build::Compat->write_makefile();
+
+
+Or, here's one that's more careful about sensing whether Module::Build
+is already installed:
+
+ unless (eval { require Module::Build::Compat; 1 }) {
+ # Workaround with old CPAN.pm and CPANPLUS.pm
+ require ExtUtils::MakeMaker;
+ ExtUtils::MakeMaker::WriteMakefile(
+ PREREQ_PM => { 'Module::Build::Compat' => 0 }
+ );
+ warn "Warning: prerequisite Module::Build::Compat is not found.\n";
+ exit(0);
+ }
+ Module::Build::Compat->run_build_pl(args => \@ARGV);
+ Module::Build::Compat->write_makefile();
+
=head1 DESCRIPTION
|
|
From: Ken W. <ke...@ma...> - 2002-08-19 00:11:08
|
On Sunday, August 18, 2002, at 11:13 PM, Dave Rolsky wrote: > On Sun, 18 Aug 2002, Piers Harding wrote: > >> Another question - is it possible to get the Build.PL file to >> sufficiently emulate a Makefile.PL file so that - >> (a) if someone doesn't have Module::Build they get informed of it >> and >> (b) CPAN.pm can work with it? ie. rename the Build.PL to >> Makefile.PL - >> and it just works. That might be a goal to aim for, as people who are >> not familiar/interested in module build processes use tools >> like CPAN.pm >> and ppms. > > I created a very simple Makefile a while back that could be > written by a > Makefile.PL (which also called Build.PL) that simply passed everything > through to './build'. I don't know how cross-platform > compatible it was, > but I could surely dig it up for testing. > No need to dig it up - that's now been incorporated into the main distribution (which I swear, I should get out in the next couple days) as a "pass-through" Makefile.PL. -Ken |