From: Brandon L Black Date: Tue, 1 May 2007 16:20:49 +0000 (+0000) Subject: Module::Install, small things X-Git-Tag: 0.16~1^2~1 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=562154278e335251dad66935310f12cc5a006508;p=gitmo%2FClass-C3.git Module::Install, small things --- diff --git a/Build.PL b/Build.PL index 70672ce..a919ccc 100644 --- a/Build.PL +++ b/Build.PL @@ -1,26 +1,3 @@ -use Module::Build; - -use strict; - -my $build = Module::Build->new( - module_name => 'Class::C3', - license => 'perl', - requires => { - 'Algorithm::C3' => 0.06, - 'Scalar::Util' => 1.10, - }, - recommends => { - 'Class::C3::XS' => 0.02, - }, - build_requires => { - 'Test::More' => '0.47', - }, - create_makefile_pl => 'traditional', - recursive_test_files => 1, - add_to_cleanup => [ - 'META.yml', '*.bak', '*.gz', 'Makefile.PL', - ], -); - -$build->create_build_script; - +# Dear Distribution Packager. This use of require is intentional. +# Module::Install detects Build.PL usage and acts accordingly. +require 'Makefile.PL'; diff --git a/ChangeLog b/ChangeLog index 888c1bb..b739681 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ Revision history for Perl extension Class::C3. +0.15_06 + - Converted to Module::Install + - No deps w/ 5.9.5+ + - Cleaned up the BEGIN stuff a bit + - Added support for C::C3::XS 0.01_07 - Fixed overload fallback edge cases. 0.15_05 Thurs, Apr 19, 2007 diff --git a/DEV_README b/DEV_README new file mode 100644 index 0000000..532d886 --- /dev/null +++ b/DEV_README @@ -0,0 +1,2 @@ + +Please package this dist using Perl < 5.9.5, so that the deps show up in META.yml diff --git a/MANIFEST b/MANIFEST index da820a6..d52115f 100644 --- a/MANIFEST +++ b/MANIFEST @@ -1,5 +1,17 @@ Build.PL ChangeLog +inc/Module/AutoInstall.pm +inc/Module/Install.pm +inc/Module/Install/AutoInstall.pm +inc/Module/Install/Base.pm +inc/Module/Install/Build.pm +inc/Module/Install/Can.pm +inc/Module/Install/Fetch.pm +inc/Module/Install/Include.pm +inc/Module/Install/Makefile.pm +inc/Module/Install/Metadata.pm +inc/Module/Install/Win32.pm +inc/Module/Install/WriteAll.pm lib/Class/C3.pm lib/Class/C3/next.pm Makefile.PL @@ -19,6 +31,7 @@ t/20_reinitialize.t t/21_C3_with_overload.t t/22_uninitialize.t t/23_multi_init.t +t/24_more_overload.t t/30_next_method.t t/31_next_method_skip.t t/32_next_method_edge_cases.t diff --git a/MANIFEST.SKIP b/MANIFEST.SKIP index 795aeb0..7b2d6f9 100644 --- a/MANIFEST.SKIP +++ b/MANIFEST.SKIP @@ -15,4 +15,6 @@ cover_db ^blibdirs$ \.old$ ^#.*#$ -^\.# \ No newline at end of file +^\.# +\.gz$ +DEV_README diff --git a/Makefile.PL b/Makefile.PL new file mode 100644 index 0000000..f901b69 --- /dev/null +++ b/Makefile.PL @@ -0,0 +1,20 @@ +use inc::Module::Install; + +name 'Class-C3'; +all_from 'lib/Class/C3.pm'; + +# Class::C3 under 5.9.5+ has no deps +if($] < 5.009_005) { + build_requires 'Test::More' => '0.47'; + + feature 'XS Speedups', + ($] < 5.009_005 ? ('Class::C3::XS' => '0.02') : ()); + + # Would like to disable these if they answer yes above too ... + feature '-core', + 'Algorithm::C3' => '0.06', + 'Scalar::Util' => '1.10'; +} + +auto_install; +WriteAll; diff --git a/README b/README index 86571da..9f4cccd 100644 --- a/README +++ b/README @@ -1,4 +1,4 @@ -Class::C3 version 0.15_01 +Class::C3 version 0.15_06 =========================== INSTALLATION @@ -20,9 +20,9 @@ This module requires these other modules and libraries: Additionally, this module will optionally take advantage of these if installed: - Class::C3::XS 0.01_06 + Class::C3::XS 0.01_07 -SPECIAL NOTE FOR 0.15_05 +SPECIAL NOTE FOR 0.15_06 To try this with the new perl core c3 support, download the most recent copy perl-current: @@ -31,7 +31,7 @@ http://mirrors.develooper.com/perl/APC/perl-current-snap/ sh Configure -Dusedevel -Dprefix=/where/I/want/it -d -e && make && make test && make install -then try your C3-using software against this perl + Class::C3 0.15_05. +then try your C3-using software against this perl + Class::C3 0.15_06. COPYRIGHT AND LICENCE diff --git a/lib/Class/C3.pm b/lib/Class/C3.pm index 45babf4..c5697d2 100644 --- a/lib/Class/C3.pm +++ b/lib/Class/C3.pm @@ -4,25 +4,26 @@ package Class::C3; use strict; use warnings; -our $VERSION = '0.15_05'; +our $VERSION = '0.15_06'; our $C3_IN_CORE; our $C3_XS; BEGIN { - if($^V < 5.009005) { + if($] > 5.009_004) { + $C3_IN_CORE = 1; + } + else { eval "require Class::C3::XS"; - if(my $error = $@) { + my $error = $@; + if(!$error) { + $C3_XS = 1; + } + else { die $error if $error !~ /\blocate\b/; require Algorithm::C3; require Class::C3::next; } - else { - $C3_XS = 1; - } - } - else { - $C3_IN_CORE = 1; } } @@ -191,6 +192,8 @@ sub calculateMRO { }, $merge_cache); } +# Method overrides to support 5.9.5+ or Class::C3::XS + sub _core_calculateMRO { @{mro::get_linear_isa($_[0])} } if($C3_IN_CORE) { @@ -254,7 +257,7 @@ Class::C3 - A pragma to use the C3 method resolution order algortihm D->can('hello')->(); # can() also works correctly UNIVERSAL::can('D', 'hello'); # as does UNIVERSAL::can() -=head1 SPECIAL NOTE FOR 0.15_05 +=head1 SPECIAL NOTE FOR 0.15_06 To try this with the new perl core c3 support, download the most recent copy perl-current: @@ -263,7 +266,7 @@ http://mirrors.develooper.com/perl/APC/perl-current-snap/ sh Configure -Dusedevel -Dprefix=/where/I/want/it -d -e && make && make test && make install -then try your C3-using software against this perl + Class::C3 0.15_05. +then try your C3-using software against this perl + Class::C3 0.15_06. =head1 DESCRIPTION @@ -485,7 +488,7 @@ limitation of this module. =head1 COMPATIBILITY -If your software requires Perl 5.9.5 or higher, you do not need L, you can simple C, and not worry about C, avoid some of the above caveats, and get the best possible performance. See L for more details. +If your software requires Perl 5.9.5 or higher, you do not need L, you can simply C, and not worry about C, avoid some of the above caveats, and get the best possible performance. See L for more details. If your software is meant to work on earlier Perls, use L as documented here. L will detect Perl 5.9.5+ and take advantage of the core support when available.