File: Build.PL

package info (click to toggle)
libfuture-perl 0.51-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 676 kB
  • sloc: perl: 4,625; makefile: 2
file content (87 lines) | stat: -rw-r--r-- 2,717 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
use v5.10;
use strict;
use warnings;

use Module::Build;

# This version of Future contains an important bugfix around weak references
# in sequence Futures. Unfortunately, a lot of existing CPAN code is known to
# rely on this behaviour, and will break if this module is upgraded.
#
# Abort if any of the following modules are installed at versions less than
# the first known-working version. They must be updated before Future can be
# installed.
my %FIXED = (
   'IO::Async' => '0.62',
   'IO::Async::SSL' => '0.14',
   'Net::Async::CassandraCQL' => '0.11',
   'Net::Async::FTP' => '0.08',
   'Net::Async::HTTP' => '0.34',
   'Net::Async::WebSocket' => '0.08',
);

my $printed;
foreach my $module ( sort keys %FIXED ) {
   my $needsver = $FIXED{$module};
   ( my $modfile = "$module.pm" ) =~ s{::}{/}g;

   next unless eval { require $modfile };
   next if ( my $instver = $module->VERSION ) >= $needsver;

   print STDERR "Installing this version of Future will fix a bug that the following installed\n".
                "modules rely on. You must upgrade these modules to a later version after\n".
                "Future is installed, or they will not work correctly.\n\n" unless $printed;

   print STDERR "  * $module (installed $instver; need at least $needsver)\n";
   $printed++;
}
print STDERR "\n" if $printed;

if( $printed and -t STDIN ) {
   # Attended update; might as well ask the user to confirm and exit if not
   my $reply = Module::Build->prompt(
      "Are you still sure you wish to go ahead with this upgrade?\n" .
         "[enter 'yes' to continue]: ",
      "no"
   );

   die "Aborting install due to broken dependent modules\n" unless $reply =~ m/^y/i;
}

my $build = Module::Build->new(
   module_name => 'Future',
   configure_requires => {
      'Module::Build' => "0.4004", # test_requires
   },
   requires => {
      'Carp' => '1.25', # new message format with trailing period
      'List::Util' => '1.29',
      'Test::Builder::Module' => 0,
      'Time::HiRes' => 0,

      'perl' => '5.014',
   },
   test_requires => {
      'Test2::V0' => '0.000148',
   },
   meta_merge => {
      # It's unlikely at the time of writing that any CPAN client actually
      # pays attention to this field, but it's nice to declare it on CPAN
      # anyway so people will know I want to use it; maybe one day clients
      # will follow it...
      x_breaks => { do {
         map { $_ => "< $FIXED{$_}" } keys %FIXED
      }},
   },
   auto_configure_requires => 0, # Don't add M::B
   license => 'perl',
   create_license => 1,
   create_readme  => 1,
   meta_merge => {
      resources => {
         x_IRC => "irc://irc.perl.org/#io-async",
      },
   },
);

$build->create_build_script;