]> git.sur5r.net Git - i3/i3/commitdiff
Migrate tooling to ExtUtils::MakeMaker (#2963)
authorKent Fredric <kentfredric+gravitar@gmail.com>
Mon, 18 Sep 2017 11:03:54 +0000 (23:03 +1200)
committerMichael Stapelberg <michael@stapelberg.de>
Tue, 19 Sep 2017 13:46:49 +0000 (15:46 +0200)
AnyEvent-I3/MANIFEST
AnyEvent-I3/MANIFEST.SKIP
AnyEvent-I3/Makefile.PL

index 34c8a8fb182c6f001a5fc09264eb88f2c7515a57..8a1669293df4fba7c13cbb35d07407b1c62fa010 100644 (file)
@@ -1,17 +1,8 @@
 Changes
-inc/Module/Install.pm
-inc/Module/Install/Base.pm
-inc/Module/Install/Can.pm
-inc/Module/Install/Fetch.pm
-inc/Module/Install/Makefile.pm
-inc/Module/Install/Metadata.pm
-inc/Module/Install/Win32.pm
-inc/Module/Install/WriteAll.pm
 lib/AnyEvent/I3.pm
 Makefile.PL
-MANIFEST
+MANIFEST                       This list of files
 MANIFEST.SKIP
-META.yml
 README
 t/00-load.t
 t/01-workspaces.t
index 01bee91f3f7e3f77956e128af1be11464d5d362d..18e9d9dffb9f2d217565e198739b0d81cb9863f9 100644 (file)
@@ -9,3 +9,5 @@ Build.bat
 \.tar\.gz$
 ^pod2htm(.*).tmp$
 ^AnyEvent-I3-
+^MYMETA.*
+^MANIFEST\.bak
index 5d2ab32e1b8f7596d2baa44ecb57defc45790014..29a442f4d3e5aeca12af39da4ce87bc045559192 100644 (file)
-use lib '.';
-use inc::Module::Install;
+use strict;
+use warnings;
 
-name     'AnyEvent-I3';
-all_from 'lib/AnyEvent/I3.pm';
-author   'Michael Stapelberg';
+use 5.006;
+use ExtUtils::MakeMaker;
 
-requires 'AnyEvent';
-requires 'AnyEvent::Handle';
-requires 'AnyEvent::Socket';
-requires 'JSON::XS';
-
-if ($^O eq 'MSWin32') {
+if ( $^O eq 'MSWin32' ) {
     die "AnyEvent::I3 cannot be used on win32 (unix sockets are missing)";
 }
 
-WriteAll;
+my %meta = (
+    name        => 'AnyEvent-I3',
+    author      => 'Michael Stapelberg, C<< <michael at i3wm.org> >>',
+    license     => ['perl'],
+    'meta-spec' => { version => 2 },
+    resources   => {
+        repository => {
+            url  => 'git://github.com/i3/i3',
+            web  => 'https://github.com/i3/i3',
+            type => 'git',
+        },
+        bugtracker => {
+            web => 'https://github.com/i3/i3/issues',
+        },
+        homepage => 'https://i3wm.org/',
+        license  => ['http://dev.perl.org/licenses'],
+    },
+);
+
+my %requirements = (
+    configure_requires => {
+        'ExtUtils::MakeMaker' => 6.36,
+    },
+    build_requires => {
+        'ExtUtils::MakeMaker' => 6.36
+    },
+    runtime_requires => {
+        'AnyEvent'         => 0,
+        'AnyEvent::Handle' => 0,
+        'AnyEvent::Socket' => 0,
+        'JSON::XS'         => 0,
+    },
+    test_requires => {
+        'Test::More' => 0.80,
+    },
+);
+
+my %merged_requirements = (
+    'ExtUtils::MakeMaker' => 0,
+    'AnyEvent'            => 0,
+    'AnyEvent::Handle'    => 0,
+    'AnyEvent::Socket'    => 0,
+    'JSON::XS'            => 0,
+    'Test::More'          => 0.80,
+);
+
+$meta{prereqs}{configure}{requires} = $requirements{configure_requires};
+$meta{prereqs}{build}{requires}     = $requirements{build_requires};
+$meta{prereqs}{runtime}{requires}   = $requirements{runtime_requires};
+$meta{prereqs}{test}{requires}      = $requirements{test_requires};
+
+my %MM_Args = (
+    AUTHOR           => 'Michael Stapelberg',
+    NAME             => 'AnyEvent::I3',
+    DISTNAME         => 'AnyEvent-I3',
+    EXE_FILES        => [],
+    MIN_PERL_VERSION => '5.006',
+    VERSION_FROM     => 'lib/AnyEvent/I3.pm',
+    ABSTRACT_FROM    => 'lib/AnyEvent/I3.pm',
+    test             => {
+        TESTS => 't/*.t',
+    },
+);
+
+sub is_eumm {
+    eval { ExtUtils::MakeMaker->VERSION( $_[0] ) };
+}
+
+is_eumm(6.30) and $MM_Args{LICENSE} = $meta{license}[0];
+is_eumm(6.47_01) or delete $MM_Args{MIN_PERL_VERSION};
+is_eumm(6.52)
+  and $MM_Args{CONFIGURE_REQUIRES} = $requirements{configure_requires};
+
+is_eumm(6.57_02) and !is_eumm(6.57_07) and $MM_Args{NO_MYMETA} = 1;
+
+if ( is_eumm(6.63_03) ) {
+    %MM_Args = (
+        %MM_Args,
+        TEST_REQUIRES  => $requirements{test_requires},
+        BUILD_REQUIRES => $requirements{build_requires},
+        PREREQ_PM      => $requirements{runtime_requires},
+    );
+}
+else {
+    $MM_Args{PREREQ_PM} = \%merged_requirements;
+}
+unless ( -f 'META.yml' ) {
+    $MM_Args{META_ADD} = \%meta;
+}
+WriteMakefile(%MM_Args);