Imported Upstream version 2.0200 upstream/2.0200
authorDongHun Kwak <dh0128.kwak@samsung.com>
Sun, 24 Jul 2022 23:44:27 +0000 (08:44 +0900)
committerDongHun Kwak <dh0128.kwak@samsung.com>
Sun, 24 Jul 2022 23:44:27 +0000 (08:44 +0900)
52 files changed:
Changes
LibXML.pm
LibXML.pod
MANIFEST
META.json
META.yml
Makefile.PL
docs/libxml.dbk
inc/Devel/CheckLib.pm [deleted file]
lib/XML/LibXML/Attr.pod
lib/XML/LibXML/AttributeHash.pm
lib/XML/LibXML/Boolean.pm
lib/XML/LibXML/CDATASection.pod
lib/XML/LibXML/Comment.pod
lib/XML/LibXML/Common.pm
lib/XML/LibXML/Common.pod
lib/XML/LibXML/DOM.pod
lib/XML/LibXML/Devel.pm
lib/XML/LibXML/Document.pod
lib/XML/LibXML/DocumentFragment.pod
lib/XML/LibXML/Dtd.pod
lib/XML/LibXML/Element.pod
lib/XML/LibXML/ErrNo.pm
lib/XML/LibXML/ErrNo.pod
lib/XML/LibXML/Error.pm
lib/XML/LibXML/Error.pod
lib/XML/LibXML/InputCallback.pod
lib/XML/LibXML/Literal.pm
lib/XML/LibXML/Namespace.pod
lib/XML/LibXML/Node.pod
lib/XML/LibXML/NodeList.pm
lib/XML/LibXML/Number.pm
lib/XML/LibXML/PI.pod
lib/XML/LibXML/Parser.pod
lib/XML/LibXML/Pattern.pod
lib/XML/LibXML/Reader.pm
lib/XML/LibXML/Reader.pod
lib/XML/LibXML/RegExp.pod
lib/XML/LibXML/RelaxNG.pod
lib/XML/LibXML/SAX.pm
lib/XML/LibXML/SAX.pod
lib/XML/LibXML/SAX/Builder.pm
lib/XML/LibXML/SAX/Builder.pod
lib/XML/LibXML/SAX/Generator.pm
lib/XML/LibXML/SAX/Parser.pm
lib/XML/LibXML/Schema.pod
lib/XML/LibXML/Text.pod
lib/XML/LibXML/XPathContext.pm
lib/XML/LibXML/XPathContext.pod
lib/XML/LibXML/XPathExpression.pod
t/00-report-prereqs.t [new file with mode: 0644]
t/pod-files-presence.t

diff --git a/Changes b/Changes
index 1692766e4aa17bd5776bcb13fa65129a25d70d31..a221d8c18b2fd2f6bc1ba3341f8eed4ed40350a6 100644 (file)
--- a/Changes
+++ b/Changes
@@ -1,5 +1,10 @@
 Revision history for Perl extension XML::LibXML
 
+2.0200  2019-03-23
+    - Convert to use Alien::Libxml2 .
+        - https://github.com/shlomif/perl-XML-LibXML/pull/30
+        - Thanks to @genio and @plicease .
+
 2.0134  2019-02-10
     - Fix overzealous POD escaping in the docs' synposes
         - https://github.com/shlomif/perl-XML-LibXML/issues/26
index 700ad9b2be6787210f5ba16dc10fcc86b7b7b807..e430db3ab3e8c3b43585a70d4cd997a7373e3dc0 100644 (file)
--- a/LibXML.pm
+++ b/LibXML.pm
@@ -29,7 +29,7 @@ use XML::LibXML::XPathContext;
 use IO::Handle; # for FH reads called as methods
 
 BEGIN {
-$VERSION = "2.0134"; # VERSION TEMPLATE: DO NOT CHANGE
+$VERSION = "2.0200"; # VERSION TEMPLATE: DO NOT CHANGE
 $ABI_VERSION = 2;
 require Exporter;
 require DynaLoader;
index f757b364911df129663cfd567d09cdc38b24533e..3b5cf5018a924df9ffcd8434d293e3b4b57f5b4a 100644 (file)
@@ -505,7 +505,7 @@ Petr Pajas
 
 =head1 VERSION
 
-2.0134
+2.0200
 
 =head1 COPYRIGHT
 
index 86f2c0ab245e20cd70c572feb7e199b6b2b3d3ec..386a969e130ca831847ce0ed2e85e981324edb23 100644 (file)
--- a/MANIFEST
+++ b/MANIFEST
@@ -62,7 +62,6 @@ example/xmlns/badguy.xml
 example/xmlns/goodguy.xml
 example/xpath.pl
 example/yahoo-finance-html-with-errors.html
-inc/Devel/CheckLib.pm
 lib/XML/LibXML/Attr.pod
 lib/XML/LibXML/AttributeHash.pm
 lib/XML/LibXML/Boolean.pm
@@ -116,6 +115,7 @@ scripts/prints-to-comments.pl
 scripts/tag-release.pl
 scripts/total-build-and-test.bash
 scripts/update-HACKING-file.bash
+t/00-report-prereqs.t
 t/01basic.t
 t/02parse.t
 t/03doc.t
index aef3db53453b88413226849f8e128c2e7543cce7..f9689f6ad352edd049ebbe1c3e4bac25ce14f29c 100644 (file)
--- a/META.json
+++ b/META.json
@@ -1,9 +1,9 @@
 {
    "abstract" : "Interface to Gnome libxml2 xml parsing and DOM library",
    "author" : [
-      "Petr Pajas"
+      "Petr Pajas <PAJAS@cpan.org>"
    ],
-   "dynamic_config" : 1,
+   "dynamic_config" : 0,
    "generated_by" : "ExtUtils::MakeMaker version 7.34, CPAN::Meta::Converter version 2.150010",
    "keywords" : [
       "dom",
    "no_index" : {
       "directory" : [
          "t",
-         "inc"
+         "inc",
+         "xt"
       ]
    },
    "prereqs" : {
       "build" : {
          "requires" : {
+            "Alien::Libxml2" : "0",
+            "Config" : "0",
             "ExtUtils::MakeMaker" : "0"
          }
       },
       "configure" : {
          "requires" : {
+            "Alien::Libxml2" : "0",
+            "Config" : "0",
             "ExtUtils::MakeMaker" : "0"
          }
       },
       "runtime" : {
          "requires" : {
-            "Test::More" : "0",
+            "Alien::Libxml2" : "0",
+            "Carp" : "0",
+            "DynaLoader" : "0",
+            "Encode" : "0",
+            "Exporter" : "5.57",
+            "IO::Handle" : "0",
+            "Scalar::Util" : "0",
+            "Tie::Hash" : "0",
             "XML::NamespaceSupport" : "1.07",
             "XML::SAX" : "0.11",
             "XML::SAX::Base" : "0",
+            "XML::SAX::DocumentLocator" : "0",
             "XML::SAX::Exception" : "0",
             "base" : "0",
+            "constant" : "0",
+            "overload" : "0",
             "parent" : "0",
-            "perl" : "5.008",
             "strict" : "0",
             "vars" : "0",
             "warnings" : "0"
          }
+      },
+      "test" : {
+         "requires" : {
+            "Errno" : "0",
+            "IO::File" : "0",
+            "IO::Handle" : "0",
+            "POSIX" : "0",
+            "Scalar::Util" : "0",
+            "Test::More" : "0",
+            "locale" : "0",
+            "utf8" : "0"
+         }
       }
    },
    "release_status" : "stable",
    "resources" : {
-      "homepage" : "https://github.com/shlomif/perl-XML-LibXML",
       "repository" : {
-         "url" : "https://github.com/shlomif/perl-XML-LibXML"
+         "type" : "git",
+         "url" : "https://github.com/shlomif/perl-XML-LibXML.git",
+         "web" : "https://github.com/shlomif/perl-XML-LibXML"
       }
    },
-   "version" : "2.0134",
+   "version" : "2.0200",
    "x_serialization_backend" : "JSON::PP version 2.97001"
 }
index 26ab4cb832e30020eef30a0e10c84b2e7e848e66..dbc47ad25ea9fdbda8166bebe0f8d9498ba7786a 100644 (file)
--- a/META.yml
+++ b/META.yml
@@ -1,12 +1,24 @@
 ---
 abstract: 'Interface to Gnome libxml2 xml parsing and DOM library'
 author:
-  - 'Petr Pajas'
+  - 'Petr Pajas <PAJAS@cpan.org>'
 build_requires:
+  Alien::Libxml2: '0'
+  Config: '0'
+  Errno: '0'
   ExtUtils::MakeMaker: '0'
+  IO::File: '0'
+  IO::Handle: '0'
+  POSIX: '0'
+  Scalar::Util: '0'
+  Test::More: '0'
+  locale: '0'
+  utf8: '0'
 configure_requires:
+  Alien::Libxml2: '0'
+  Config: '0'
   ExtUtils::MakeMaker: '0'
-dynamic_config: 1
+dynamic_config: 0
 generated_by: 'ExtUtils::MakeMaker version 7.34, CPAN::Meta::Converter version 2.150010'
 keywords:
   - dom
@@ -33,20 +45,29 @@ no_index:
   directory:
     - t
     - inc
+    - xt
 requires:
-  Test::More: '0'
+  Alien::Libxml2: '0'
+  Carp: '0'
+  DynaLoader: '0'
+  Encode: '0'
+  Exporter: '5.57'
+  IO::Handle: '0'
+  Scalar::Util: '0'
+  Tie::Hash: '0'
   XML::NamespaceSupport: '1.07'
   XML::SAX: '0.11'
   XML::SAX::Base: '0'
+  XML::SAX::DocumentLocator: '0'
   XML::SAX::Exception: '0'
   base: '0'
+  constant: '0'
+  overload: '0'
   parent: '0'
-  perl: '5.008'
   strict: '0'
   vars: '0'
   warnings: '0'
 resources:
-  homepage: https://github.com/shlomif/perl-XML-LibXML
-  repository: https://github.com/shlomif/perl-XML-LibXML
-version: '2.0134'
+  repository: https://github.com/shlomif/perl-XML-LibXML.git
+version: '2.0200'
 x_serialization_backend: 'CPAN::Meta::YAML version 0.018'
index 5e49473dc636b071dac24b8b4c3c10ea1c1e7d98..3055a0c34987d5111d0c293f315ed3bab143cca7 100644 (file)
@@ -17,795 +17,149 @@ use warnings;
 
 require 5.008;
 
-use vars qw/$DEVNULL $is_Win32 $extralibdir $skipsaxinstall/;
-
+use Alien::Libxml2;
 use ExtUtils::MakeMaker;
 use Config;
-use Symbol;
-use File::Spec;
-
-$|=0;
-my %config;
 
-# -------------------------------------------------------------------------- #
-# -------------------------------------------------------------------------- #
-# common information go to the top, so they are easier to find
-# -------------------------------------------------------------------------- #
-my %INFOS = (
-    'NAME'  => 'XML::LibXML',
-    'VERSION_FROM' => 'LibXML.pm', # finds $VERSION
-    'AUTHOR'    => 'Petr Pajas',
-    'ABSTRACT'  => 'Interface to Gnome libxml2 xml parsing and DOM library',
-    'LICENSE' => 'perl',
-    (($ExtUtils::MakeMaker::VERSION >= 6.48)
-        ? (MIN_PERL_VERSION => '5.008',)
-        : ()
-    ),
-    'PREREQ_PM' => {
-        'base' => 0,
-        #'Hash::FieldHash' => '0.09',
-        'parent' => 0,
-        'strict' => 0,
-        'Test::More' => 0,
-        'vars' => 0,
-        'warnings' => 0,
-        'XML::NamespaceSupport' => '1.07',
-        'XML::SAX' => '0.11',
-        'XML::SAX::Base' => '0',
-        'XML::SAX::Exception' => '0',
-    },
-    'OBJECT'    => '$(O_FILES)', # add the DOM extensions to libxml2
-    ($ExtUtils::MakeMaker::VERSION >= 6.54)
-    ?
-    (
-        META_MERGE =>
-        {
-            resources =>
-            {
-                repository => 'https://github.com/shlomif/perl-XML-LibXML',
-                homepage => 'https://github.com/shlomif/perl-XML-LibXML',
-            },
-            keywords =>
-            [
-                "dom",
-                "html",
-                "libxml",
-                "object oriented",
-                "oop",
-                "parse",
-                "parser",
-                "parsing",
-                "pullparser",
-                "sax",
-                "sgml",
-                "xml",
-                "xpath",
-                "XPath",
-                "xs",
-            ],
-        },
-    )
-    : (),
+my %BuildReqs = (
+  "Alien::Libxml2" => 0,
+  "Config" => 0,
+  "ExtUtils::MakeMaker" => 0,
+);
+my %ConfigReqs = (
+  "Alien::Libxml2" => 0,
+  "Config" => 0,
+  "ExtUtils::MakeMaker" => 0,
+);
+my %DevReqs = (
+  'Test::CPAN::Changes' => 0,
+  'Test::Kwalitee' => 0,
+  'Test::Pod' => 0,
+  'Test::TrailingSpace' => 0,
+);
+my %TestReqs = (
+  "Errno" => 0,
+  "IO::File" => 0,
+  "IO::Handle" => 0,
+  "POSIX" => 0,
+  "Scalar::Util" => 0,
+  "Test::More" => 0,
+  "locale" => 0,
+  "utf8" => 0,
+);
+my %prereqs = (
+  "Alien::Libxml2" => 0,
+  "Carp" => 0,
+  "DynaLoader" => 0,
+  "Encode" => 0, # actually used in one module. requires Perl 5.8+
+  "Exporter" => "5.57",
+  'IO::Handle' => 0,
+  'Scalar::Util' => 0,
+  'Tie::Hash' => 0,
+  'XML::NamespaceSupport' => '1.07',
+  'XML::SAX' => '0.11',
+  'XML::SAX::Base' => '0',
+  'XML::SAX::DocumentLocator' => '0',
+  'XML::SAX::Exception' => '0',
+  "base" => 0,
+  "constant" => 0,
+  "overload" => 0,
+  "parent" => 0,
+  "strict" => 0,
+  "vars" => 0,
+  "warnings" => 0,
 );
-# -------------------------------------------------------------------------- #
-# -------------------------------------------------------------------------- #
-
-use lib qw(inc);
-use Devel::CheckLib;
-
-# Prompt the user here for any paths and other configuration
-
-
-# -------------------------------------------------------------------------- #
-# libxml2 valid versions
-
-# -------------------------------------------------------------------------- #
-
-# -------------------------------------------------------------------------- #
-# read extra configurations from the commandline
-my %params;
-@params{qw(FORCE DEBUG DEFINE EXTRALIBDIR GDOME INC LIBS SKIP_SAX_INSTALL XMLPREFIX NO_THREADS LDFLAGS)}=();
-
-@ARGV = grep {
-  my ($key, $val) = split(/=/, $_, 2);
-  if (exists $params{$key}) {
-    $config{$key} = $val; 0
-  } else { 1 }
-} @ARGV;
-
-$extralibdir = $config{EXTRALIBDIR};
-delete $config{EXTRALIBDIR};
-
-# -------------------------------------------------------------------------- #
-
-# -------------------------------------------------------------------------- #
-# force unsupported version
-my $FORCE = delete $config{FORCE};
-
-# switch Debugging messages on
-my $DEBUG = delete $config{DEBUG};
-
-if ( $config{DEBUG} and $is_Win32 ) {
-    warn "win32 compile\n";
-}
-# -------------------------------------------------------------------------- #
-
-# -------------------------------------------------------------------------- #
-# enable perls UTF8 support if available
-if ( $] >= 5.006 ) {
-    warn "enable native perl UTF8\n";
-    $config{DEFINE} .= " -DHAVE_UTF8";
-}
-if ( $] < 5.008 or $config{NO_THREADS} ) {
-  warn "disabling XML::LibXML support for Perl threads\n";
-  $config{DEFINE} .= " -DNO_XML_LIBXML_THREADS";
-}
-delete $config{NO_THREADS};
-# -------------------------------------------------------------------------- #
-
-# -------------------------------------------------------------------------- #
-# get the libxml2 configuration
-#
-# For each release we already know which libxml2 versions work with the given
-# module. All we need is to keep track of bad versions.
-# If a user wants to build XML::LibXML with a newer version, there will be
-# a warning, that errors are possible.
-#
-# We keep track of the valid versions by keeping a blacklist of intervals
-# of working and not working versions where Ma.Mi.Pt <= X.Y.Z is of the same
-# state.
-#
-# NOTE: All versions, the tests pass will be marked as working.
-#
-
-$skipsaxinstall = $ENV{SKIP_SAX_INSTALL} || $config{SKIP_SAX_INSTALL};
-delete $config{SKIP_SAX_INSTALL};
-
-unless ( $is_Win32 ) { # cannot get config in W32
-    my @blacklist = (
-                     # format X,Y,Z,is_ok, X,Y,Z is version,
-                     # is_ok applies also to *preceding* versions
-                     [2,4,22,0],
-                     [2,4,25,0], # broken XPath
-                     [2,4,28,0], # unsupported, may work fine with earlier XML::LibXML versions
-                     [2,4,29,0], # broken
-                     [2,4,30,0], # broken
-                     [2,5,0,0], # unsupported
-                     [2,5,1,0], # all pre 2.5.4 version have broken attr output
-                     [2,5,5,0], # tests pass, but known as broken
-                     [2,5,11,0], # will partially work
-                     [2,6,0,0], # unsupported
-                     [2,6,4,0], # schema error
-                     [2,6,5,0], # broken xincludes
-                     [2,6,15,0],
-                   # [2,6,16,1], # first version to pass all tests
-                     [2,6,18,1], # up to 2.6.18 all ok
-                     [2,6,19,0], # broken c14n
-                     [2,6,20,0], # broken schemas
-                     [2,6,24,1], # all tests pass
-                     [2,6,25,0], # broken XPath
-                     [2,6,32,1], # tested, works ok
-                     [2,7,1,0], # broken release, broken utf-16
-                     [2,7,6,1], # tested, ok
-                     [2,7,8,1], # tested, ok
-                     [2,9,3,1], # schema regression
-                     [2,9,4,0], # schema regression
-                     [2,9,9,1],
-                    );
-    my $xml2cfg = "xml2-config";
-    my $libprefix = $ENV{XMLPREFIX} || $config{XMLPREFIX};
-
-    delete $config{XMLPREFIX}; # delete if exists, otherwise MakeMaker gets confused
-
-    if ( defined $libprefix ) {
-        $xml2cfg = $libprefix . '/bin/' . $xml2cfg;
-    }
-
-    # if a user defined INC and LIBS on the command line we must not
-    # override them
-    if ( not defined $config{LIBS} and not defined $config{INC} ) {
-        print "running xml2-config...";
-        eval {
-            try_libconfig( $xml2cfg, \%config, \@blacklist );
-        };
-
-        if ( $@ ) {
-            if ( $@ =~ /^VERSION|^FORCED/ ) {
-                my $libxml2_version;
-                print STDERR "The installed version of libxml2 $@ is not compatible with XML::LibXML (and probably buggy)!\n\n".
-                    "You may continue at your own risk using 'perl Makefile.PL FORCE=1', but:\n\n".
-                    "  - don't expect XML::LibXML to build or work correctly!\n".
-                    "  - don't report errors!\n".
-                    "  - don't send patches!\n\n".
-                    "Check the README file for more information on versions\n".
-                    "that are tested with XML::LibXML\n\n";
-                if ($@ =~ /^VERSION (\S+)/) {
-                    $libxml2_version = $1;
-                }
-                # 0 recommended by http://cpantest.grango.org (Notes for CPAN Authors)
-                exit 0 if !$FORCE and $libxml2_version ne "2.9.4";
-            }
-            if ( $@ =~ /^UNTESTED (\S*)/ ) {
-                warn "Note: libxml2 $1 was not tested with this XML::LibXML version.\n"
-#                 warn <<"UNTESTED";
-# WARNING!
-# The installed version of libxml2 was not tested with this version of XML::LibXML.
-
-#     XML::LibXML may fail building or some tests may not pass.
-#     Expect strange errors and unstable scripts.
-
-#     Check the README file for more informations
-# END OF WARNING
-# UNTESTED
-            }
-
-            if ( not defined $config{LIBS} and not defined $config{INC} ) {
-                warn "didn't manage to get libxml2 config, guessing\n";
-                $config{LIBS} = '-L/usr/local/lib -L/usr/lib -lxml2 -lm';
-                $config{INC} = '-I/usr/local/include -I/usr/include';
-                print <<"OPT";
-options:
-  LIBS='$config{LIBS}'
-  INC='$config{INC}'
-If this is wrong, Re-run as:
-  \$ $^X Makefile.PL LIBS='-L/path/to/lib' INC='-I/path/to/include'
-
-OPT
-            }
-        }
-    }
-}
-
-# -------------------------------------------------------------------------- #
-
-# -------------------------------------------------------------------------- #
-# GDOME Support
-#
-# GDOME Support has to get explicitly activated by setting GDOME=1 as a config param.
-#
-unless ( $is_Win32 ) { # cannot get config in W32
-    if ( $config{GDOME} ) {
-        my $ver;
-        my $state = undef; # there are three possible states:
-                           # 1     : works
-                           # 0     : works not
-                           # undef : not yet tested
-        my @blacklist = (
-                         [0,7,2,0],
-                         [0,7,3,1],
-                        );
-        print <<"GDOME";
-
-GDOME Support (experimental):
-   XML::LibXML can parse into XML::GDOME DOMs if libgdome is installed.
-   This feature is optional and is not required for using XML::LibXML.
-
-GDOME
-
-        print "running gdome-config...";
-
-        eval {
-            test_libconfig( "gdome-config", \%config, @blacklist );
-            print "NOTE: You will need to install XML::GDOME to use this feature\n";
-        };
-
-        if ( $@ ) {
-            if ( $@ =~ /^VERSION/ ) {
-                warn "The installed libgdome version is not supported\n";
-            }
-            elsif ( $@ =~ /^UNTESTED/ ) {
-                warn "The installed libgdome version was not yet tested with XML::LibXML.\n";
-                print "NOTE: You will need to install XML::GDOME to use this feature\n";
-            }
-        }
-    }
-}
-# -------------------------------------------------------------------------- #
-
-
-my $config_LIBS_alternatives;
-# -------------------------------------------------------------------------- #
-# fix the ld flags
-# -------------------------------------------------------------------------- #
-if (!defined $config{LIBS} || $config{LIBS} !~ /\-l(?:lib)?xml2\b/) {
-    # in this case we are not able to run xml2-config. therefore we need to
-    # expand the libz as well.
-    if ($is_Win32) {
-        if( $ENV{ACTIVEPERL_MINGW} ) {
-            $config{LIBS} .= ' -llibxml2.lib -lzlib.lib';
-        }
-        else {
-            my $l = $config{LIBS};
 
-            if (!defined($l)) {
-                $l = '';
-            }
+my %xsbuild = (
+  DEFINE  => '-DHAVE_UTF8',
+  OBJECT  => '$(O_FILES)',
+  CCFLAGS => Alien::Libxml2->cflags . " $Config{ccflags}",
+  LIBS    => [ Alien::Libxml2->libs ],
+);
 
-            # Put several options.
-            $config_LIBS_alternatives = [
-                map { "$l $_" }
-                q/ -llibxml2/,
-                q/ -lxml2 -lzlib/,
-                q/ -llibxml2 -lzlib -llibgettextlib.dll/
-            ];
-            $config{LIBS} = $config_LIBS_alternatives->[-1];
-            $config{INC} .= " -I$Config{incpath}";
-        }
-    }
-    else {
-        $config{LIBS} .= ' -lxml2 -lz -lm';
-    }
-}
-elsif ($config{LIBS} !~ /\-lz\b/ and !($is_Win32 && $config{LIBS} !~ /\-lzlib\b/)) {
-    # note if libxml2 has not -lz within its cflags, we should not use
-    # it! We should trust libxml2 and assume libz is not available on the
-    # current system (this is ofcourse not true with win32 systems.
-    # $config{LIBS} .= $is_Win32 ? ' -lzlib' :' -lz';
-    if ( $config{DEBUG} ) {
-        warn "zlib was not configured\n";
-        warn "set zlib\n" if $is_Win32;
-    }
-  if ($is_Win32) {
-    if( $ENV{ACTIVEPERL_MINGW} ) {
-      $config{LIBS} .= ' -lzlib.lib';
-    } else {
-      $config{LIBS} .= ' -lzlib';
-    }
-  } else {
-    $config{LIBS} .= ' -lz';
+my %WriteMakefileArgs = (
+  "NAME" => "XML::LibXML",
+  "DISTNAME" => "XML-LibXML",
+  "LICENSE" => "perl_5",
+  "ABSTRACT" => "Interface to Gnome libxml2 xml parsing and DOM library",
+  "AUTHOR" => "Petr Pajas <PAJAS\@cpan.org>",
+  "VERSION_FROM" => "LibXML.pm",
+  'META_MERGE' => {
+    'dynamic_config' => 0,
+    'meta-spec' => {version => 2},
+    'no_index' => {directory => ['xt']},
+    'resources' => {
+      repository => {
+        type => 'git',
+        url  => 'https://github.com/shlomif/perl-XML-LibXML.git',
+        web  => 'https://github.com/shlomif/perl-XML-LibXML',
+      },
+    },
+    'keywords' => [
+      "dom",
+      "html",
+      "libxml",
+      "object oriented",
+      "oop",
+      "parse",
+      "parser",
+      "parsing",
+      "pullparser",
+      "sax",
+      "sgml",
+      "xml",
+      "xpath",
+      "XPath",
+      "xs",
+    ],
+  },
+  "BUILD_REQUIRES" => \%BuildReqs,
+  "CONFIGURE_REQUIRES" => \%ConfigReqs,
+  "TEST_REQUIRES" => \%TestReqs,
+  "PREREQ_PM" => \%prereqs,
+  "test" => {
+    "TESTS" => "t/*.t"
   }
-}
-
-# -------------------------------------------------------------------------- #
-# MacOS X Compiler switches have to go here
-#
-# if we run on MacOSX, we should check if 10.2 is running and if so,
-# if the Build Target is set correctly. Otherwise we have to set it by
-# hand
-
-my $ldflags = delete $config{LDFLAGS};
-if ($ldflags) {
-    $config{dynamic_lib} = { OTHERLDFLAGS => " $ldflags " };
-}
-
-my $incpath = $config{INC} || "";
-$incpath =~ s#(\A|\s)\s*-I#$1#g;
-
-sub _libxml_check_lib_with_config_LIBs
-{
-    my ($lib_name, $conf_LIBS) = @_;
-
-    return
-    check_lib(
-        debug => $DEBUG,
-        LIBS => $conf_LIBS,
-        # fill in what you prompted the user for here
-        lib => [$lib_name],
-        incpath => [split(/\s/,$incpath)],
-        header =>
-        [
-            'libxml/c14n.h',
-            'libxml/catalog.h',
-            'libxml/entities.h',
-            'libxml/globals.h',
-            'libxml/HTMLparser.h',
-            'libxml/HTMLtree.h',
-            'libxml/parser.h',
-            'libxml/parserInternals.h',
-            'libxml/pattern.h',
-            'libxml/relaxng.h',
-            'libxml/tree.h',
-            'libxml/uri.h',
-            'libxml/valid.h',
-            'libxml/xinclude.h',
-            'libxml/xmlerror.h',
-            'libxml/xmlIO.h',
-            'libxml/xmlmemory.h',
-            'libxml/xmlreader.h',
-            'libxml/xmlregexp.h',
-            'libxml/xmlschemas.h',
-            'libxml/xmlversion.h',
-            'libxml/xpath.h',
-            'libxml/xpathInternals.h',
-        ],
-    );
-}
-
-sub _libxml_check_lib {
-    my ($libname) = @_;
-
-    if (defined($config_LIBS_alternatives)) {
-        foreach my $conf_LIBS (@$config_LIBS_alternatives) {
-            if (_libxml_check_lib_with_config_LIBs($libname, $conf_LIBS)) {
-                $config{LIBS} = $conf_LIBS;
-                return 1;
-            }
-        }
-    }
-    else {
-        return _libxml_check_lib_with_config_LIBs($libname, $config{LIBS});
-    }
-}
+);
 
-print "Checking for ability to link against xml2...";
-if ( _libxml_check_lib('xml2') ) {
-    print "yes\n";
+%WriteMakefileArgs = (
+    %WriteMakefileArgs,
+    %xsbuild,
+);
+unless ( eval { ExtUtils::MakeMaker->VERSION('6.63_03') } ) {
+    my %fallback = (%prereqs, %TestReqs, %BuildReqs);
+    delete $WriteMakefileArgs{TEST_REQUIRES};
+    delete $WriteMakefileArgs{BUILD_REQUIRES};
+    $WriteMakefileArgs{PREREQ_PM} = \%fallback;
 }
-else {
-    print "no\n";
-    print "Checking for ability to link against libxml2...";
-    if ( _libxml_check_lib('libxml2')) {
-        print "yes\n";
-    }
-    else {
-        print STDERR <<"DEATH";
-libxml2, zlib, and/or the Math library (-lm) have not been found.
-Try setting LIBS and INC values on the command line
-Or get libxml2 from
-  http://xmlsoft.org/
-If you install via RPMs, make sure you also install the -devel
-RPMs, as this is where the headers (.h files) are.
 
-Also, you may try to run perl Makefile.PL with the DEBUG=1 parameter
-to see the exact reason why the detection of libxml2 installation
-failed or why Makefile.PL was not able to compile a test program.
-DEATH
-        exit 0; # 0 recommended by http://cpantest.grango.org (Notes for CPAN Authors)
-    }
-}
+delete $WriteMakefileArgs{CONFIGURE_REQUIRES}
+  unless eval { ExtUtils::MakeMaker->VERSION('6.52') };
 
-# -------------------------------------------------------------------------- #
-# _NOW_ write the Makefile
+delete $WriteMakefileArgs{META_MERGE}
+  unless eval { ExtUtils::MakeMaker->VERSION('6.46') };
 
-WriteMakefile(
-              %INFOS,
-              %config,
-);
-# -------------------------------------------------------------------------- #
+delete $WriteMakefileArgs{LICENSE}
+  unless eval { ExtUtils::MakeMaker->VERSION('6.31') };
 
+WriteMakefile(%WriteMakefileArgs);
 
-# -------------------------------------------------------------------------- #
 # helper functions to build the Makefile
 sub MY::manifypods {
-    package MY;
-    my $str = shift->SUPER::manifypods(@_);
-#    warn $str;
-#    $str =~ s/^manifypods : pure_all (.*)$/manifypods : pure_all docs $1/m;
-    $str .= <<"EOF";
-
+  package MY;
+  my $str = shift->SUPER::manifypods(@_);
+#   warn $str;
+#   $str =~ s/^manifypods : pure_all (.*)$/manifypods : pure_all docs $1/m;
+  $str .= <<"EOF";
 docs-fast :
 \t\@$^X -pi~ -e 's{<edition>[0-9.]*</edition>}{<edition>'"\$(VERSION)"'</edition>}' docs/libxml.dbk
 \t\@$^X -Iblib/arch -Iblib/lib example/xmllibxmldocs.pl docs/libxml.dbk lib/XML/LibXML/
-
 docs : pure_all
 \t\@$^X -pi~ -e 's{<edition>[0-9.]*</edition>}{<edition>'"\$(VERSION)"'</edition>}' docs/libxml.dbk
 \t\@$^X -Iblib/arch -Iblib/lib example/xmllibxmldocs.pl docs/libxml.dbk lib/XML/LibXML/
 \t\@$^X -pi.old -e 's/a/a/' Makefile.PL
 \t\@echo "==> YOU MUST NOW RE-RUN $^X Makefile.PL <=="
 \t\@false
-
 EOF
-    return $str;
-}
-
-sub MY::install {
-   package MY;
-   my $script = shift->SUPER::install(@_);
-   unless ( $::skipsaxinstall ) {
-     $script =~ s/install :: (.*)$/install :: $1 install_sax_driver/m;
-     $script .= <<"INSTALL";
-
-install_sax_driver :
-\t-\@\$(PERL) -I\$(INSTALLSITELIB) -I\$(INSTALLSITEARCH) -MXML::SAX -e "XML::SAX->add_parser(q(XML::LibXML::SAX::Parser))->save_parsers()"
-\t-\@\$(PERL) -I\$(INSTALLSITELIB) -I\$(INSTALLSITEARCH) -MXML::SAX -e "XML::SAX->add_parser(q(XML::LibXML::SAX))->save_parsers()"
-
-INSTALL
-   } else {
-     warn "Note: 'make install' will skip XML::LibXML::SAX registration with XML::SAX!\n";
-   }
-   return $script;
-}
-
-sub MY::test {
-   package MY;
-   my $script = shift->SUPER::test(@_);
-   if ( $::extralibdir ) {
-      $script =~ s/(\$\(TEST_VERBOSE\),)/$1 \'$::extralibdir\',/m;
-   }
-   return $script;
-}
-
-# echo perl -pi~ -e '$$_=q($(version))."\n" if /#\ VERSION TEMPLATE/ ' $(TO_INST_PM)
-sub MY::postamble {
-    my $mpl_args = join " ", map qq["$_"], @ARGV;
-
-    my $CC =
-    (
-        exists($ENV{CC})
-            ? "CC = $ENV{CC}"
-            : ''
-    );
-
-  my $ret = "$CC\n" . <<'MAKE_FRAG';
-
-# emacs flymake-mode
-check-syntax :
-       test -n "$(CHK_SOURCES)" && \
-       $(CCCMD) $(CCCDLFLAGS) "-I$(PERL_INC)" $(PASTHRU_DEFINE) $(DEFINE) -o /dev/null -S $(CHK_SOURCES)
-
-# used to update version numbers in all modules
-version:
-       @version=`grep '\# VERSION TEMPLATE' $(VERSION_FROM)`; \
-       echo "New version line: $$version"; \
-       perl -pi~ -e '$$_=q('"$$version"')."\n" if /#\ VERSION TEMPLATE/ ' $(TO_INST_PM);
-
-runtest: pure_all
-       $(ABSPERLRUN) -MFile::Spec -MTest::Run::CmdLine::Iface -e \
-        "local @INC = @INC;    unshift @INC, map { File::Spec->rel2abs(\$$_) } ('$(INST_LIB)', '$(INST_ARCHLIB)'); Test::Run::CmdLine::Iface->new({test_files => [glob(q{t/*.t})]})->run();"
-
-distruntest: distdir
-       cd $(DISTVNAME) && $(ABSPERLRUN) Makefile.PL {#mpl_args#}
-       cd $(DISTVNAME) && $(MAKE) $(PASTHRU)
-       cd $(DISTVNAME) && $(MAKE) runtest $(PASTHRU)
-
-MAKE_FRAG
-
-    $ret =~ s/{#mpl_args#}/$mpl_args/;
-
-    return $ret;
-}
-
-
-# -------------------------------------------------------------------------- #
-
-# -------------------------------------------------------------------------- #
-# Functions
-#  - these should really be in MakeMaker... But &shrug;
-# -------------------------------------------------------------------------- #
-
-use Config;
-use Cwd;
-use Symbol;
-use File::Spec;
-
-
-BEGIN {
-    $is_Win32 = ($^O =~ /Win32/);
-    if ($is_Win32) {
-        $DEVNULL = 'DEVNULL';
-    }
-    else {
-        $DEVNULL = eval { File::Spec->devnull };
-        if ($@) { $DEVNULL = '/dev/null' }
-    }
-}
-
-sub rm_f {
-    my @files = @_;
-    my @realfiles;
-    foreach (@files) {
-        push @realfiles, glob($_);
-    }
-    if (@realfiles) {
-        chmod(0777, @realfiles);
-        unlink(@realfiles);
-    }
-}
-
-sub rm_fr {
-    my @files = @_;
-    my @realfiles;
-    foreach (@files) {
-        push @realfiles, glob($_);
-    }
-    foreach my $file (@realfiles) {
-        if (-d $file) {
-            # warn("$file is a directory\n");
-            rm_fr("$file/*");
-            rm_fr("$file/.exists");
-            rmdir($file) || die "Couldn't remove $file: $!";
-        }
-        else {
-            # warn("removing $file\n");
-            chmod(0777, $file);
-            unlink($file);
-        }
-    }
-}
-
-sub xsystem {
-    my $command_aref = shift;
-    if ($DEBUG) {
-        print "@$command_aref\n";
-        if ((system { $command_aref->[0] } @$command_aref) != 0) {
-            die "system call to '@$command_aref' failed";
-        }
-        return 1;
-    }
-    open(OLDOUT, ">&STDOUT");
-    open(OLDERR, ">&STDERR");
-    open(STDOUT, ">$DEVNULL");
-    open(STDERR, ">$DEVNULL");
-    my $retval = (system { $command_aref->[0] } @$command_aref);
-    open(STDOUT, ">&OLDOUT");
-    open(STDERR, ">&OLDERR");
-    if ($retval != 0) {
-        die "system call to '@$command_aref' failed";
-    }
-    return 1;
-}
-
-sub backtick {
-    my $command = shift;
-    if ($DEBUG) {
-        print $command, "\n";
-        my $results = `$command`;
-        chomp $results;
-        if ($? != 0) {
-            die "backticks call to '$command' failed";
-        }
-        return $results;
-    }
-    open(OLDOUT, ">&STDOUT");
-    open(OLDERR, ">&STDERR");
-    open(STDOUT, ">$DEVNULL");
-    open(STDERR, ">$DEVNULL");
-    my $results = `$command`;
-    my $retval = $?;
-    open(STDOUT, ">&OLDOUT");
-    open(STDERR, ">&OLDERR");
-    if ($retval != 0) {
-        die "backticks call to '$command' failed";
-    }
-    chomp $results;
-    return $results;
-}
-
-sub try_link0 {
-    my ($src, $opt) = @_;
-    # local $config{LIBS};
-    # $config{LIBS} .= $opt;
-    unless (mkdir(".testlink", 0777)) {
-        rm_fr(".testlink");
-        mkdir(".testlink", 0777) || die "Cannot create .testlink dir: $!";
-    }
-    chdir(".testlink");
-    {
-        open(my $cfile, '>', 'Conftest.xs')
-            or die "Cannot write to file Conftest.xs: $!";
-        print {$cfile} <<"EOT";
-#ifdef __cplusplus
-extern "C" {
-#endif
-#include <EXTERN.h>
-#include <perl.h>
-#include <XSUB.h>
-#ifdef __cplusplus
+  return $str;
 }
-#endif
-
-EOT
-        print {$cfile} $src;
-        print {$cfile} <<"EOT";
-
-MODULE = Conftest          PACKAGE = Conftest
-
-PROTOTYPES: DISABLE
-
-EOT
-        close($cfile);
-    }
-    {
-        open(my $cfile, '>', 'Conftest.pm')
-            or die "Cannot write to file Conftest.pm: $!";
-        print {$cfile} <<'EOT';
-package Conftest;
-$VERSION = 1.0;
-require DynaLoader;
-@ISA = ('DynaLoader');
-bootstrap Conftest $VERSION;
-1;
-EOT
-        close($cfile);
-    }
-    {
-        open (my $cfile, '>', 'Makefile.PL')
-            or die "Cannot write to file Makefile.PL: $!";
-        print {$cfile} <<'EOT';
-use ExtUtils::MakeMaker;
-my %config;
-while($_ = shift @ARGV) {
-    my ($k, $v) = split /=/, $_, 2;
-    warn("$k = $v\n");
-    $config{$k} = $v;
-}
-WriteMakefile(NAME => "Conftest", VERSION_FROM => "Conftest.pm", %config);
-EOT
-        close($cfile);
-    }
-    {
-        open(my $cfile, ">test.pl")
-            or die "Cannot write to file test.pl: $!";
-        print {$cfile} <<"EOT";
-use Test; BEGIN { plan tests => 1; } END { ok(\$loaded) }
-use Conftest; \$loaded++;
-EOT
-        close($cfile);
-    }
-    my $quote = $is_Win32 ? '"' : "'";
-    xsystem([$^X, 'Makefile.PL',
-        (map { "$_=$config{$_}" } keys %config),
-        ]
-    );
-
-    my $def_opt = defined($opt) ? $opt : '';
-    # I am not sure if OTHERLDFLAGS is really required - at least the
-    # libraries to include do not belong here!
-    # I would assume a user to set OTHERLDFLAGS in the %config if they are
-    # really required. if done so, we don't have to pass them here ...
-    xsystem([$Config{make}, 'test', "OTHERLDFLAGS=${def_opt}"]);
-} # end try_link0
-
-sub try_link {
-    my $start_dir = cwd();
-    my $result = eval {
-        try_link0(@_);
-    };
-    warn $@ if $@;
-    chdir($start_dir);
-    rm_fr(".testlink");
-    return $result;
-}
-
-# -------------------------------------------------------------------------- #
-# try_libconfig class a generic config file and requests --version, --libs and
-# --cflags
-sub try_libconfig {
-    my $cfgscript = shift;
-    my $config = shift;
-    my $bl = shift;
-
-    my $state = undef; # there are three possible states:
-                       # 1     : works
-                       # 0     : works not
-                       # undef : not yet tested
-
-    my $ver = backtick("$cfgscript --version");
-    if ( defined $ver ) {
-        my ( $major, $minor, $point) = $ver =~ /([0-9]+).([0-9]+)\.([0-9]+)/g;
-        foreach my $i ( @$bl ) {
-            $state = $i->[3];
-            last if $major <  $i->[0];
-            next if $major >  $i->[0];
-            last if $minor <  $i->[1];
-            next if $minor >  $i->[1];
-            last if $point <= $i->[2];
-            $state = undef;
-        }
-
-        $config->{LIBS} = backtick("$cfgscript --libs");
-        $config->{INC}  = backtick("$cfgscript --cflags");
-
-        if ( defined $state and $state == 0 ) {
-            print "failed\n";
-            if ($FORCE) {
-                die "FORCED $ver\n";
-            }
-            else {
-              die "VERSION $ver\n";
-            }
-        }
-
-        unless ( defined $state ) {
-            print "untested\n";
-            die "UNTESTED $ver\n";
-        }
-
-        print "ok ($ver)\n";
-    }
-    else {
-        print "failed\n";
-        die "FAILED\n"; # strange error
-    }
-}
-# -------------------------------------------------------------------------- #
index efc5d1625aee45bccfc1f04c3ae31ae84b730b15..3a4d37169b12aab7cfa0fee047568c73dc17cad1 100644 (file)
@@ -22,7 +22,7 @@
         </authorgroup>
 
 
-        <edition>2.0134</edition>
+        <edition>2.0200</edition>
         <copyright>
             <year>2001-2007</year>
             <holder>AxKit.com Ltd</holder>
diff --git a/inc/Devel/CheckLib.pm b/inc/Devel/CheckLib.pm
deleted file mode 100644 (file)
index 77ecb6a..0000000
+++ /dev/null
@@ -1,493 +0,0 @@
-# $Id: CheckLib.pm,v 1.25 2008/10/27 12:16:23 drhyde Exp $
-
-package #
-Devel::CheckLib;
-
-use 5.00405; #postfix foreach
-use strict;
-use warnings;
-
-use vars qw($VERSION @ISA @EXPORT);
-$VERSION = '1.01';
-use Config qw(%Config);
-use Text::ParseWords 'quotewords';
-
-use File::Spec;
-use File::Temp;
-
-require Exporter;
-@ISA = qw(Exporter);
-@EXPORT = qw(assert_lib check_lib_or_exit check_lib);
-
-# localising prevents the warningness leaking out of this module
-local $^W = 1;    # use warnings is a 5.6-ism
-
-_findcc(); # bomb out early if there's no compiler
-
-=head1 NAME
-
-Devel::CheckLib - check that a library is available
-
-=head1 DESCRIPTION
-
-Devel::CheckLib is a perl module that checks whether a particular C
-library and its headers are available.
-
-=head1 SYNOPSIS
-
-    use Devel::CheckLib;
-
-    check_lib_or_exit( lib => 'jpeg', header => 'jpeglib.h' );
-    check_lib_or_exit( lib => [ 'iconv', 'jpeg' ] );
-
-    # or prompt for path to library and then do this:
-    check_lib_or_exit( lib => 'jpeg', libpath => $additional_path );
-
-=head1 USING IT IN Makefile.PL or Build.PL
-
-If you want to use this from Makefile.PL or Build.PL, do
-not simply copy the module into your distribution as this may cause
-problems when PAUSE and search.cpan.org index the distro.  Instead, use
-the use-devel-checklib script.
-
-=head1 HOW IT WORKS
-
-You pass named parameters to a function, describing to it how to build
-and link to the libraries.
-
-It works by trying to compile some code - which defaults to this:
-
-    int main(void) { return 0; }
-
-and linking it to the specified libraries.  If something pops out the end
-which looks executable, it gets executed, and if main() returns 0 we know
-that it worked.  That tiny program is
-built once for each library that you specify, and (without linking) once
-for each header file.
-
-If you want to check for the presence of particular functions in a
-library, or even that those functions return particular results, then
-you can pass your own function body for main() thus:
-
-    check_lib_or_exit(
-        function => 'foo();if(libversion() > 5) return 0; else return 1;'
-        incpath  => ...
-        libpath  => ...
-        lib      => ...
-        header   => ...
-    );
-
-In that case, it will fail to build if either foo() or libversion() don't
-exist, and main() will return the wrong value if libversion()'s return
-value isn't what you want.
-
-=head1 FUNCTIONS
-
-All of these take the same named parameters and are exported by default.
-To avoid exporting them, C<use Devel::CheckLib ()>.
-
-=head2 assert_lib
-
-This takes several named parameters, all of which are optional, and dies
-with an error message if any of the libraries listed can
-not be found.  B<Note>: dying in a Makefile.PL or Build.PL may provoke
-a 'FAIL' report from CPAN Testers' automated smoke testers.  Use
-C<check_lib_or_exit> instead.
-
-The named parameters are:
-
-=over
-
-=item lib
-
-Must be either a string with the name of a single
-library or a reference to an array of strings of library names.  Depending
-on the compiler found, library names will be fed to the compiler either as
-C<-l> arguments or as C<.lib> file names.  (E.g. C<-ljpeg> or C<jpeg.lib>)
-
-=item libpath
-
-a string or an array of strings
-representing additional paths to search for libraries.
-
-=item LIBS
-
-a C<ExtUtils::MakeMaker>-style space-seperated list of
-libraries (each preceded by '-l') and directories (preceded by '-L').
-
-This can also be supplied on the command-line.
-
-=item debug
-
-If true - emit information during processing that can be used for
-debugging.
-
-=back
-
-And libraries are no use without header files, so ...
-
-=over
-
-=item header
-
-Must be either a string with the name of a single
-header file or a reference to an array of strings of header file names.
-
-=item incpath
-
-a string or an array of strings
-representing additional paths to search for headers.
-
-=item INC
-
-a C<ExtUtils::MakeMaker>-style space-seperated list of
-incpaths, each preceded by '-I'.
-
-This can also be supplied on the command-line.
-
-=back
-
-=head2 check_lib_or_exit
-
-This behaves exactly the same as C<assert_lib()> except that instead of
-dieing, it warns (with exactly the same error message) and exits.
-This is intended for use in Makefile.PL / Build.PL
-when you might want to prompt the user for various paths and
-things before checking that what they've told you is sane.
-
-If any library or header is missing, it exits with an exit value of 0 to avoid
-causing a CPAN Testers 'FAIL' report.  CPAN Testers should ignore this
-result -- which is what you want if an external library dependency is not
-available.
-
-=head2 check_lib
-
-This behaves exactly the same as C<assert_lib()> except that it is silent,
-returning false instead of dieing, or true otherwise.
-
-=cut
-
-sub check_lib_or_exit {
-    eval 'assert_lib(@_)';
-    if($@) {
-        warn $@;
-        exit;
-    }
-}
-
-sub check_lib {
-    eval 'assert_lib(@_)';
-    return $@ ? 0 : 1;
-}
-
-sub assert_lib {
-    my %args = @_;
-    my (@libs, @libpaths, @headers, @incpaths);
-
-    # FIXME: these four just SCREAM "refactor" at me
-    @libs = (ref($args{lib}) ? @{$args{lib}} : $args{lib})
-        if $args{lib};
-    @libpaths = (ref($args{libpath}) ? @{$args{libpath}} : $args{libpath})
-        if $args{libpath};
-    @headers = (ref($args{header}) ? @{$args{header}} : $args{header})
-        if $args{header};
-    @incpaths = (ref($args{incpath}) ? @{$args{incpath}} : $args{incpath})
-        if $args{incpath};
-
-    # work-a-like for Makefile.PL's LIBS and INC arguments
-    # if given as command-line argument, append to %args
-    for my $arg (@ARGV) {
-        for my $mm_attr_key (qw(LIBS INC)) {
-            if (my ($mm_attr_value) = $arg =~ /\A $mm_attr_key = (.*)/x) {
-            # it is tempting to put some \s* into the expression, but the
-            # MM command-line parser only accepts LIBS etc. followed by =,
-            # so we should not be any more lenient with whitespace than that
-                $args{$mm_attr_key} .= " $mm_attr_value";
-            }
-        }
-    }
-
-    # using special form of split to trim whitespace
-    if(defined($args{LIBS})) {
-        foreach my $arg (split(' ', $args{LIBS})) {
-            die("LIBS argument badly-formed: $arg\n") unless($arg =~ /^-[lLR]/);
-            push @{$arg =~ /^-l/ ? \@libs : \@libpaths}, substr($arg, 2);
-        }
-    }
-    if(defined($args{INC})) {
-        foreach my $arg (split(' ', $args{INC})) {
-            die("INC argument badly-formed: $arg\n") unless($arg =~ /^-I/);
-            push @incpaths, substr($arg, 2);
-        }
-    }
-
-    my ($cc, $ld) = _findcc();
-    my @missing;
-    my @wrongresult;
-    my @use_headers;
-
-    # first figure out which headers we can't find ...
-    for my $header (@headers) {
-        push @use_headers, $header;
-        my($ch, $cfile) = File::Temp::tempfile(
-            'assertlibXXXXXXXX', SUFFIX => '.c'
-        );
-        my $ofile = $cfile;
-        $ofile =~ s/\.c$/$Config{_o}/;
-        print $ch qq{#include <$_>\n} for @use_headers;
-        print $ch qq{int main(void) { return 0; }\n};
-        close($ch);
-        my $exefile = File::Temp::mktemp( 'assertlibXXXXXXXX' ) . $Config{_exe};
-        my @sys_cmd;
-        # FIXME: re-factor - almost identical code later when linking
-        if ( $Config{cc} eq 'cl' ) {                 # Microsoft compiler
-            require Win32;
-            @sys_cmd = (
-                @$cc,
-                $cfile,
-                "/Fe$exefile",
-                (map { '/I'.Win32::GetShortPathName($_) } @incpaths),
-               "/link",
-               @$ld
-            );
-        } elsif($Config{cc} =~ /bcc32(\.exe)?/) {    # Borland
-            @sys_cmd = (
-                @$cc,
-                @$ld,
-                (map { "-I$_" } @incpaths),
-                "-o$exefile",
-                $cfile
-            );
-        } else { # Unix-ish: gcc, Sun, AIX (gcc, cc), ...
-            @sys_cmd = (
-                @$cc,
-                @$ld,
-                $cfile,
-                (map { "-I$_" } @incpaths),
-                "-o", "$exefile"
-            );
-        }
-        warn "# @sys_cmd\n" if $args{debug};
-        my $rv = $args{debug} ? system(@sys_cmd) : _quiet_system(@sys_cmd);
-        push @missing, $header if $rv != 0 || ! -x $exefile;
-        _cleanup_exe($exefile);
-        unlink $ofile if -e $ofile;
-        unlink $cfile;
-    }
-
-    # now do each library in turn with headers
-    my($ch, $cfile) = File::Temp::tempfile(
-        'assertlibXXXXXXXX', SUFFIX => '.c'
-    );
-    my $ofile = $cfile;
-    $ofile =~ s/\.c$/$Config{_o}/;
-    print $ch qq{#include <$_>\n} foreach (@headers);
-    print $ch "int main(void) { ".($args{function} || 'return 0;')." }\n";
-    close($ch);
-    for my $lib ( @libs ) {
-        my $exefile = File::Temp::mktemp( 'assertlibXXXXXXXX' ) . $Config{_exe};
-        my @sys_cmd;
-        if ( $Config{cc} eq 'cl' ) {                 # Microsoft compiler
-            require Win32;
-            my @libpath = map {
-                q{/libpath:} . Win32::GetShortPathName($_)
-            } @libpaths;
-            # this is horribly sensitive to the order of arguments
-            @sys_cmd = (
-                @$cc,
-                $cfile,
-                "${lib}.lib",
-                "/Fe$exefile",
-                (map { '/I'.Win32::GetShortPathName($_) } @incpaths),
-                "/link",
-                @$ld,
-                (map {'/libpath:'.Win32::GetShortPathName($_)} @libpaths),
-            );
-        } elsif($Config{cc} eq 'CC/DECC') {          # VMS
-        } elsif($Config{cc} =~ /bcc32(\.exe)?/) {    # Borland
-            @sys_cmd = (
-                @$cc,
-                @$ld,
-                "-o$exefile",
-                (map { "-I$_" } @incpaths),
-                (map { "-L$_" } @libpaths),
-                "-l$lib",
-                $cfile);
-        } else {                                     # Unix-ish
-                                                     # gcc, Sun, AIX (gcc, cc)
-            @sys_cmd = (
-                @$cc,
-                @$ld,
-                $cfile,
-                "-o", "$exefile",
-                (map { "-I$_" } @incpaths),
-                (map { "-L$_" } @libpaths),
-                "-l$lib",
-            );
-        }
-        warn "# @sys_cmd\n" if $args{debug};
-        my $rv = $args{debug} ? system(@sys_cmd) : _quiet_system(@sys_cmd);
-        push @missing, $lib if $rv != 0 || ! -x $exefile;
-        my $absexefile = File::Spec->rel2abs($exefile);
-        $absexefile = '"'.$absexefile.'"' if $absexefile =~ m/\s/;
-        push @wrongresult, $lib if $rv == 0 && -x $exefile && system($absexefile) != 0;
-        unlink $ofile if -e $ofile;
-        _cleanup_exe($exefile);
-    }
-    unlink $cfile;
-
-    my $miss_string = join( q{, }, map { qq{'$_'} } @missing );
-    die("Can't link/include C library $miss_string, aborting.\n") if @missing;
-    my $wrong_string = join( q{, }, map { qq{'$_'} } @wrongresult);
-    die("wrong result: $wrong_string\n") if @wrongresult;
-}
-
-sub _cleanup_exe {
-    my ($exefile) = @_;
-    my $ofile = $exefile;
-    $ofile =~ s/$Config{_exe}$/$Config{_o}/;
-    unlink $exefile if -f $exefile;
-    unlink $ofile if -f $ofile;
-    unlink "$exefile\.manifest" if -f "$exefile\.manifest";
-    if ( $Config{cc} eq 'cl' ) {
-        # MSVC also creates foo.ilk and foo.pdb
-        my $ilkfile = $exefile;
-        $ilkfile =~ s/$Config{_exe}$/.ilk/;
-        my $pdbfile = $exefile;
-        $pdbfile =~ s/$Config{_exe}$/.pdb/;
-        unlink $ilkfile if -f $ilkfile;
-        unlink $pdbfile if -f $pdbfile;
-    }
-    return
-}
-
-# return ($cc, $ld)
-# where $cc is an array ref of compiler name, compiler flags
-# where $ld is an array ref of linker flags
-sub _findcc {
-    # Need to use $keep=1 to work with MSWin32 backslashes and quotes
-    my $Config_ccflags =  $Config{ccflags};  # use copy so ASPerl will compile
-    my @Config_ldflags = ();
-    for my $config_val ( @Config{qw(ldflags perllibs)} ){
-        push @Config_ldflags, $config_val if ( $config_val =~ /\S/ );
-    }
-    my @ccflags = grep { length } quotewords('\s+', 1, $Config_ccflags||'');
-    my @ldflags = grep { length } quotewords('\s+', 1, @Config_ldflags);
-    my @paths = split(/$Config{path_sep}/, $ENV{PATH});
-    my @cc = split(/\s+/, $Config{cc});
-    return ( [ @cc, @ccflags ], \@ldflags ) if -x $cc[0];
-    foreach my $path (@paths) {
-        my $compiler = File::Spec->catfile($path, $cc[0]) . $Config{_exe};
-        return ([ $compiler, @cc[1 .. $#cc], @ccflags ], \@ldflags)
-            if -x $compiler;
-    }
-    die("Couldn't find your C compiler\n");
-}
-
-# code substantially borrowed from IPC::Run3
-sub _quiet_system {
-    my (@cmd) = @_;
-
-    # save handles
-    local *STDOUT_SAVE;
-    local *STDERR_SAVE;
-    open STDOUT_SAVE, ">&STDOUT" or die "CheckLib: $! saving STDOUT";
-    open STDERR_SAVE, ">&STDERR" or die "CheckLib: $! saving STDERR";
-
-    # redirect to nowhere
-    local *DEV_NULL;
-    open DEV_NULL, ">" . File::Spec->devnull
-        or die "CheckLib: $! opening handle to null device";
-    open STDOUT, ">&" . fileno DEV_NULL
-        or die "CheckLib: $! redirecting STDOUT to null handle";
-    open STDERR, ">&" . fileno DEV_NULL
-        or die "CheckLib: $! redirecting STDERR to null handle";
-
-    # run system command
-    my $rv = system(@cmd);
-
-    # restore handles
-    open STDOUT, ">&" . fileno STDOUT_SAVE
-        or die "CheckLib: $! restoring STDOUT handle";
-    open STDERR, ">&" . fileno STDERR_SAVE
-        or die "CheckLib: $! restoring STDERR handle";
-
-    return $rv;
-}
-
-=head1 PLATFORMS SUPPORTED
-
-You must have a C compiler installed.  We check for C<$Config{cc}>,
-both literally as it is in Config.pm and also in the $PATH.
-
-It has been tested with varying degrees on rigourousness on:
-
-=over
-
-=item gcc (on Linux, *BSD, Mac OS X, Solaris, Cygwin)
-
-=item Sun's compiler tools on Solaris
-
-=item IBM's tools on AIX
-
-=item SGI's tools on Irix 6.5
-
-=item Microsoft's tools on Windows
-
-=item MinGW on Windows (with Strawberry Perl)
-
-=item Borland's tools on Windows
-
-=item QNX
-
-=back
-
-=head1 WARNINGS, BUGS and FEEDBACK
-
-This is a very early release intended primarily for feedback from
-people who have discussed it.  The interface may change and it has
-not been adequately tested.
-
-Feedback is most welcome, including constructive criticism.
-Bug reports should be made using L<http://rt.cpan.org/> or by email.
-
-When submitting a bug report, please include the output from running:
-
-    perl -V
-    perl -MDevel::CheckLib -e0
-
-=head1 SEE ALSO
-
-L<Devel::CheckOS>
-
-L<Probe::Perl>
-
-=head1 AUTHORS
-
-David Cantrell E<lt>david@cantrell.org.ukE<gt>
-
-David Golden E<lt>dagolden@cpan.orgE<gt>
-
-Yasuhiro Matsumoto E<lt>mattn@cpan.orgE<gt>
-
-Thanks to the cpan-testers-discuss mailing list for prompting us to write it
-in the first place;
-
-to Chris Williams for help with Borland support;
-
-to Tony Cook for help with Microsoft compiler command-line options
-
-=head1 COPYRIGHT and LICENCE
-
-Copyright 2007 David Cantrell. Portions copyright 2007 David Golden.
-
-This module is free-as-in-speech software, and may be used, distributed,
-and modified under the same conditions as perl itself.
-
-=head1 CONSPIRACY
-
-This module is also free-as-in-mason software.
-
-=cut
-
-1;
index de5b0a43c6d0424683e38d632318e3781544b3e7..72c686379ddcc096fde7937006c3d93f6fe4a78e 100644 (file)
@@ -121,7 +121,7 @@ Petr Pajas
 
 =head1 VERSION
 
-2.0134
+2.0200
 
 =head1 COPYRIGHT
 
index b880fcb89b19529648fa2d53db25773270a42f1c..bcf737033d6721561b915a3c65956d44fd0d4d00 100644 (file)
@@ -7,7 +7,7 @@ use Tie::Hash;
 our @ISA = qw/Tie::Hash/;
 
 use vars qw($VERSION);
-$VERSION = "2.0134"; # VERSION TEMPLATE: DO NOT CHANGE
+$VERSION = "2.0200"; # VERSION TEMPLATE: DO NOT CHANGE
 
 BEGIN
 {
index 420a4070a02012d684819b1e24bc4555779b821f..a2755e8b2aff5db539570b2651f108107522c673 100644 (file)
@@ -16,7 +16,7 @@ use warnings;
 
 use vars qw ($VERSION);
 
-$VERSION = "2.0134"; # VERSION TEMPLATE: DO NOT CHANGE
+$VERSION = "2.0200"; # VERSION TEMPLATE: DO NOT CHANGE
 
 use overload
         '""' => \&value,
index 710936ee186c2516b37ce37fa23990e0ffaf0996..899f18d5c827689fc62b1c9180b744dafa7823c7 100644 (file)
@@ -45,7 +45,7 @@ Petr Pajas
 
 =head1 VERSION
 
-2.0134
+2.0200
 
 =head1 COPYRIGHT
 
index f6c933c232c25a25f7a9701062e800fad3b76162..e4af0b4e665ec129420167b3ffa24885882ffc9d 100644 (file)
@@ -46,7 +46,7 @@ Petr Pajas
 
 =head1 VERSION
 
-2.0134
+2.0200
 
 =head1 COPYRIGHT
 
index e8d7e4f06d76896d5bf40ceb5f884c9de5e440fe..ec984ec64a38add77cf62f187fcf3da36b4061cc 100644 (file)
@@ -24,7 +24,7 @@ use vars qw( @ISA $VERSION @EXPORT @EXPORT_OK %EXPORT_TAGS);
 
 @ISA = qw(Exporter);
 
-$VERSION = "2.0134"; # VERSION TEMPLATE: DO NOT CHANGE
+$VERSION = "2.0200"; # VERSION TEMPLATE: DO NOT CHANGE
 
 use XML::LibXML qw(:libxml);
 
index 5519cfd9697b095e8d6ddf36718b364a143d6d37..04053daafdef16ec52a22ca0c479361e96634896 100644 (file)
@@ -116,7 +116,7 @@ Petr Pajas
 
 =head1 VERSION
 
-2.0134
+2.0200
 
 =head1 COPYRIGHT
 
index bb0afaed64ef7a0b3ac89c0150dfa085f6274af8..12a5817e91e269fb91d8dbbef9b773ec8aae51d6 100644 (file)
@@ -129,7 +129,7 @@ Petr Pajas
 
 =head1 VERSION
 
-2.0134
+2.0200
 
 =head1 COPYRIGHT
 
index d4dfe61679888d81802a2f2a973b8a636010c67c..c53a1fd6a8aee8626e0df2e855c47a5946054101 100644 (file)
@@ -12,7 +12,7 @@ use warnings;
 use XML::LibXML;
 
 use vars qw ($VERSION);
-$VERSION = "2.0134"; # VERSION TEMPLATE: DO NOT CHANGE
+$VERSION = "2.0200"; # VERSION TEMPLATE: DO NOT CHANGE
 
 use 5.008_000;
 
index 2a33360e981bd4e0667fd93258a1ad0db5741db1..3661a9b96db422752153fe1b9b6515c064c297f8 100644 (file)
@@ -683,7 +683,7 @@ Petr Pajas
 
 =head1 VERSION
 
-2.0134
+2.0200
 
 =head1 COPYRIGHT
 
index b86d754a71f352cdb781cd12141bd7f8c1c28d4d..107b80b08eca1299c47df39eaf2313493f68dab9 100644 (file)
@@ -27,7 +27,7 @@ Petr Pajas
 
 =head1 VERSION
 
-2.0134
+2.0200
 
 =head1 COPYRIGHT
 
index 8cbf46a6d4e157e51b0b1657f69e26d12d6afc30..ecfb4fa0711eb58e76c623c555725e0ea90654e4 100644 (file)
@@ -89,7 +89,7 @@ Petr Pajas
 
 =head1 VERSION
 
-2.0134
+2.0200
 
 =head1 COPYRIGHT
 
index b8912b70c20a9b55a295f8c80ea0512df27af165..7104f04d7ab2d412b55fe7be300f2226e35c1254 100644 (file)
@@ -382,7 +382,7 @@ Petr Pajas
 
 =head1 VERSION
 
-2.0134
+2.0200
 
 =head1 COPYRIGHT
 
index 12563b615b3decad30b4622502f131da88280e34..6f33f76694dc77f6b66d47bd14ce91e439063f29 100644 (file)
@@ -14,7 +14,7 @@ use strict;
 use warnings;
 use vars qw($VERSION);
 
-$VERSION = "2.0134"; # VERSION TEMPLATE: DO NOT CHANGE
+$VERSION = "2.0200"; # VERSION TEMPLATE: DO NOT CHANGE
 
 use constant ERR_OK                               => 0;
 use constant ERR_INTERNAL_ERROR                   => 1;
index d0a326395060be5015fd52143f1e62108ef3dd64..05cf717bf9907f0090c0a6203dec15b29a70a1cc 100644 (file)
@@ -17,7 +17,7 @@ Petr Pajas
 
 =head1 VERSION
 
-2.0134
+2.0200
 
 =head1 COPYRIGHT
 
index 18704fdff5587f9153076aaf3d603d19e8651237..69b9e1fed9a12de2d9f6acf215933e651f78be1a 100644 (file)
@@ -29,7 +29,7 @@ use overload
   fallback => 1;
 
 $WARNINGS = 0; # 0: suppress, 1: report via warn, 2: report via die
-$VERSION = "2.0134"; # VERSION TEMPLATE: DO NOT CHANGE
+$VERSION = "2.0200"; # VERSION TEMPLATE: DO NOT CHANGE
 
 use constant XML_ERR_NONE            => 0;
 use constant XML_ERR_WARNING         => 1; # A simple warning
index 132910e89a3c13b0a55804f85c4cdf5c210dcaae..db6e1ee65e3967f9f0fda75963ce8ac273d190a7 100644 (file)
@@ -244,7 +244,7 @@ Petr Pajas
 
 =head1 VERSION
 
-2.0134
+2.0200
 
 =head1 COPYRIGHT
 
index 6e2d9374add23665e4031bab117820b3e4d70a16..751faaecc2e0b81af502d862e91c1b09d5f67b2b 100644 (file)
@@ -280,7 +280,7 @@ Petr Pajas
 
 =head1 VERSION
 
-2.0134
+2.0200
 
 =head1 COPYRIGHT
 
index 655035400818b26f6248c2b099a0a6bb9ff9a876..8097b7f5c5271c28cdb06d05c19d8dcf6239ff16 100644 (file)
@@ -16,7 +16,7 @@ use strict;
 use warnings;
 
 use vars qw ($VERSION);
-$VERSION = "2.0134"; # VERSION TEMPLATE: DO NOT CHANGE
+$VERSION = "2.0200"; # VERSION TEMPLATE: DO NOT CHANGE
 
 use overload
                '""' => \&value,
index f89518a6142684ac8c21a3229370ce070c165ed9..68cc2a16d02002e8e8395d919244f29cc771b083 100644 (file)
@@ -141,7 +141,7 @@ Petr Pajas
 
 =head1 VERSION
 
-2.0134
+2.0200
 
 =head1 COPYRIGHT
 
index cb039887de92028cc4809f081388bfd5dd7264a0..7d68a6df8cf2f1124480fbb5fa79efbd993639e3 100644 (file)
@@ -763,7 +763,7 @@ Petr Pajas
 
 =head1 VERSION
 
-2.0134
+2.0200
 
 =head1 COPYRIGHT
 
index 6d0845b8865da949209d332687bf67ca9476654a..dc9b9ecfc693c1fc44a1dab005a0cba4efb88210 100644 (file)
@@ -17,7 +17,7 @@ use XML::LibXML::Literal;
 use XML::LibXML::Number;
 
 use vars qw($VERSION);
-$VERSION = "2.0134"; # VERSION TEMPLATE: DO NOT CHANGE
+$VERSION = "2.0200"; # VERSION TEMPLATE: DO NOT CHANGE
 
 use overload
         '""' => \&to_literal,
index 1a278213900033c60d8dd2461d19fb39d63a9516..478b9773fc4a5a01638d4f443804586476b5dcc2 100644 (file)
@@ -14,7 +14,7 @@ use strict;
 use warnings;
 
 use vars qw ($VERSION);
-$VERSION = "2.0134"; # VERSION TEMPLATE: DO NOT CHANGE
+$VERSION = "2.0200"; # VERSION TEMPLATE: DO NOT CHANGE
 
 use overload
         '""' => \&value,
index 644d2dc621c18bdddb9cc2b065ac40a333e5feba..40c562075b1ded71b5df238e3313570c85f22c0e 100644 (file)
@@ -74,7 +74,7 @@ Petr Pajas
 
 =head1 VERSION
 
-2.0134
+2.0200
 
 =head1 COPYRIGHT
 
index 9f9478fa82bfb98ac402e5a7e892917a4921de8f..94181d103ec9da391d343adbc8fc9cc763a32443 100644 (file)
@@ -984,7 +984,7 @@ Petr Pajas
 
 =head1 VERSION
 
-2.0134
+2.0200
 
 =head1 COPYRIGHT
 
index 95309ab2f78b7da1eb71d8e28b4648b8d1e03eb6..d338d58090c38b4ebe6c8c48e317119514231152 100644 (file)
@@ -94,7 +94,7 @@ Petr Pajas
 
 =head1 VERSION
 
-2.0134
+2.0200
 
 =head1 COPYRIGHT
 
index fa0ad06d5861964d59fa552b60f8059c84d2de2c..f698535e487dfd1062acbd272cdb6ccf0e168602 100644 (file)
@@ -14,7 +14,7 @@ use strict;
 use warnings;
 
 use vars qw ($VERSION);
-$VERSION = "2.0134"; # VERSION TEMPLATE: DO NOT CHANGE
+$VERSION = "2.0200"; # VERSION TEMPLATE: DO NOT CHANGE
 
 use 5.008_000;
 
index 268396adbf274e1af650db014c6e68c9958c28cb..bfcba53ab8e48dcaf86b891331e31891a61f0106 100644 (file)
@@ -657,7 +657,7 @@ Petr Pajas
 
 =head1 VERSION
 
-2.0134
+2.0200
 
 =head1 COPYRIGHT
 
index 41eec28a600a4979e70c9dc87ab5ae39fb5c1d5d..56f0a6c30edf798c25fca65ec84ed8e14779f925 100644 (file)
@@ -58,7 +58,7 @@ Petr Pajas
 
 =head1 VERSION
 
-2.0134
+2.0200
 
 =head1 COPYRIGHT
 
index c7165b58a03239fc933cc829e8cb963391dc2767..6afc826e38c66f034e973a80c625349bd3f71861 100644 (file)
@@ -70,7 +70,7 @@ Petr Pajas
 
 =head1 VERSION
 
-2.0134
+2.0200
 
 =head1 COPYRIGHT
 
index bd4f26f5d90a16b67c0490876d00dae23d285d3b..19a0bb2ce59839ae11fd51335b705076a90e7160 100644 (file)
@@ -14,7 +14,7 @@ use warnings;
 
 use vars qw($VERSION @ISA);
 
-$VERSION = "2.0134"; # VERSION TEMPLATE: DO NOT CHANGE
+$VERSION = "2.0200"; # VERSION TEMPLATE: DO NOT CHANGE
 
 use XML::LibXML;
 use XML::SAX::Base;
index f9903473c875fcc85f192652457bfde9483980a2..5f7d2a8b8617fcc3849226d4b30480bf7c4ca2a1 100644 (file)
@@ -47,7 +47,7 @@ Petr Pajas
 
 =head1 VERSION
 
-2.0134
+2.0200
 
 =head1 COPYRIGHT
 
index 0c168f6c36514f6aaacf5271481cc99325f278bc..2ca4a99c04d2dadd94cfc2e554403dbf8f9db043 100644 (file)
@@ -21,7 +21,7 @@ sub CLONE_SKIP {
   return $XML::LibXML::__threads_shared ? 0 : 1;
 }
 
-$VERSION = "2.0134"; # VERSION TEMPLATE: DO NOT CHANGE
+$VERSION = "2.0200"; # VERSION TEMPLATE: DO NOT CHANGE
 
 sub new {
     my $class = shift;
index 6972671afa283828a2431a8134e20eb9c48a9ace..3192334ddc09d749b6e87c311db549c0d98e6a63 100644 (file)
@@ -38,7 +38,7 @@ Petr Pajas
 
 =head1 VERSION
 
-2.0134
+2.0200
 
 =head1 COPYRIGHT
 
index c8ee22b91df39fc3f9d192fe7315f4e6243b6a5e..cb91b20257e7794681b162d6180c85421593b63e 100644 (file)
@@ -15,7 +15,7 @@ use warnings;
 use XML::LibXML;
 use vars qw ($VERSION);
 
-$VERSION = "2.0134"; # VERSION TEMPLATE: DO NOT CHANGE
+$VERSION = "2.0200"; # VERSION TEMPLATE: DO NOT CHANGE
 
 sub CLONE_SKIP {
   return $XML::LibXML::__threads_shared ? 0 : 1;
index 1f9ed4972f3c548e7c35380a21232da21b9e1b30..65973487e4d89c652026011ce023fc123be4182d 100644 (file)
@@ -18,7 +18,7 @@ use XML::LibXML::Common qw(:libxml);
 use XML::SAX::Base;
 use XML::SAX::DocumentLocator;
 
-$VERSION = "2.0134"; # VERSION TEMPLATE: DO NOT CHANGE
+$VERSION = "2.0200"; # VERSION TEMPLATE: DO NOT CHANGE
 @ISA = ('XML::SAX::Base');
 
 sub CLONE_SKIP {
index dca03c2c0fc03db8c0de02c9915ad32a2b617ad9..3c34531e91235c0ffe3555afd333d2d50933ba4e 100644 (file)
@@ -66,7 +66,7 @@ Petr Pajas
 
 =head1 VERSION
 
-2.0134
+2.0200
 
 =head1 COPYRIGHT
 
index a70a4ed1836569182b0470b1805ca4481fb647dd..a5ff61535b0adb6d7ccfd04ab9fdaf99e2d4f7d7 100644 (file)
@@ -170,7 +170,7 @@ Petr Pajas
 
 =head1 VERSION
 
-2.0134
+2.0200
 
 =head1 COPYRIGHT
 
index 48a960e0331a8ac904f2659886b0c7b1e9d78913..8be146082f66cb084479440b3481a848b96ac6a4 100644 (file)
@@ -17,7 +17,7 @@ use Carp;
 use XML::LibXML;
 use XML::LibXML::NodeList;
 
-$VERSION = "2.0134"; # VERSION TEMPLATE: DO NOT CHANGE
+$VERSION = "2.0200"; # VERSION TEMPLATE: DO NOT CHANGE
 
 # should LibXML XPath data types be used for simple objects
 # when passing parameters to extension functions (default: no)
index deb5107a62768928f609e6091d217949dea07fd9..4110543fbe09845ea112c1f4d2c1f50420a00ef9 100644 (file)
@@ -362,7 +362,7 @@ Petr Pajas
 
 =head1 VERSION
 
-2.0134
+2.0200
 
 =head1 COPYRIGHT
 
index 2291d4effe85694fe64c0d2e39ad64559768824c..9ba8bd15dbd96851dbc213593e22cc1e563c4d2d 100644 (file)
@@ -52,7 +52,7 @@ Petr Pajas
 
 =head1 VERSION
 
-2.0134
+2.0200
 
 =head1 COPYRIGHT
 
diff --git a/t/00-report-prereqs.t b/t/00-report-prereqs.t
new file mode 100644 (file)
index 0000000..c72183a
--- /dev/null
@@ -0,0 +1,193 @@
+#!perl
+
+use strict;
+use warnings;
+
+# This test was generated by Dist::Zilla::Plugin::Test::ReportPrereqs 0.027
+
+use Test::More tests => 1;
+
+use ExtUtils::MakeMaker;
+use File::Spec;
+
+# from $version::LAX
+my $lax_version_re =
+    qr/(?: undef | (?: (?:[0-9]+) (?: \. | (?:\.[0-9]+) (?:_[0-9]+)? )?
+            |
+            (?:\.[0-9]+) (?:_[0-9]+)?
+        ) | (?:
+            v (?:[0-9]+) (?: (?:\.[0-9]+)+ (?:_[0-9]+)? )?
+            |
+            (?:[0-9]+)? (?:\.[0-9]+){2,} (?:_[0-9]+)?
+        )
+    )/x;
+
+# hide optional CPAN::Meta modules from prereq scanner
+# and check if they are available
+my $cpan_meta = "CPAN::Meta";
+my $cpan_meta_pre = "CPAN::Meta::Prereqs";
+my $HAS_CPAN_META = eval "require $cpan_meta; $cpan_meta->VERSION('2.120900')" && eval "require $cpan_meta_pre"; ## no critic
+
+# Verify requirements?
+my $DO_VERIFY_PREREQS = 1;
+
+sub _max {
+    my $max = shift;
+    $max = ( $_ > $max ) ? $_ : $max for @_;
+    return $max;
+}
+
+sub _merge_prereqs {
+    my ($collector, $prereqs) = @_;
+
+    # CPAN::Meta::Prereqs object
+    if (ref $collector eq $cpan_meta_pre) {
+        return $collector->with_merged_prereqs(
+            CPAN::Meta::Prereqs->new( $prereqs )
+        );
+    }
+
+    # Raw hashrefs
+    for my $phase ( keys %$prereqs ) {
+        for my $type ( keys %{ $prereqs->{$phase} } ) {
+            for my $module ( keys %{ $prereqs->{$phase}{$type} } ) {
+                $collector->{$phase}{$type}{$module} = $prereqs->{$phase}{$type}{$module};
+            }
+        }
+    }
+
+    return $collector;
+}
+
+my @include = qw(
+
+);
+
+my @exclude = qw(
+
+);
+
+# Add static prereqs to the included modules list
+my $static_prereqs = do './t/00-report-prereqs.dd';
+
+# Merge all prereqs (either with ::Prereqs or a hashref)
+my $full_prereqs = _merge_prereqs(
+    ( $HAS_CPAN_META ? $cpan_meta_pre->new : {} ),
+    $static_prereqs
+);
+
+# Add dynamic prereqs to the included modules list (if we can)
+my ($source) = grep { -f } 'MYMETA.json', 'MYMETA.yml';
+my $cpan_meta_error;
+if ( $source && $HAS_CPAN_META
+    && (my $meta = eval { CPAN::Meta->load_file($source) } )
+) {
+    $full_prereqs = _merge_prereqs($full_prereqs, $meta->prereqs);
+}
+else {
+    $cpan_meta_error = $@;    # capture error from CPAN::Meta->load_file($source)
+    $source = 'static metadata';
+}
+
+my @full_reports;
+my @dep_errors;
+my $req_hash = $HAS_CPAN_META ? $full_prereqs->as_string_hash : $full_prereqs;
+
+# Add static includes into a fake section
+for my $mod (@include) {
+    $req_hash->{other}{modules}{$mod} = 0;
+}
+
+for my $phase ( qw(configure build test runtime develop other) ) {
+    next unless $req_hash->{$phase};
+    next if ($phase eq 'develop' and not $ENV{AUTHOR_TESTING});
+
+    for my $type ( qw(requires recommends suggests conflicts modules) ) {
+        next unless $req_hash->{$phase}{$type};
+
+        my $title = ucfirst($phase).' '.ucfirst($type);
+        my @reports = [qw/Module Want Have/];
+
+        for my $mod ( sort keys %{ $req_hash->{$phase}{$type} } ) {
+            next if $mod eq 'perl';
+            next if grep { $_ eq $mod } @exclude;
+
+            my $file = $mod;
+            $file =~ s{::}{/}g;
+            $file .= ".pm";
+            my ($prefix) = grep { -e File::Spec->catfile($_, $file) } @INC;
+
+            my $want = $req_hash->{$phase}{$type}{$mod};
+            $want = "undef" unless defined $want;
+            $want = "any" if !$want && $want == 0;
+
+            my $req_string = $want eq 'any' ? 'any version required' : "version '$want' required";
+
+            if ($prefix) {
+                my $have = MM->parse_version( File::Spec->catfile($prefix, $file) );
+                $have = "undef" unless defined $have;
+                push @reports, [$mod, $want, $have];
+
+                if ( $DO_VERIFY_PREREQS && $HAS_CPAN_META && $type eq 'requires' ) {
+                    if ( $have !~ /\A$lax_version_re\z/ ) {
+                        push @dep_errors, "$mod version '$have' cannot be parsed ($req_string)";
+                    }
+                    elsif ( ! $full_prereqs->requirements_for( $phase, $type )->accepts_module( $mod => $have ) ) {
+                        push @dep_errors, "$mod version '$have' is not in required range '$want'";
+                    }
+                }
+            }
+            else {
+                push @reports, [$mod, $want, "missing"];
+
+                if ( $DO_VERIFY_PREREQS && $type eq 'requires' ) {
+                    push @dep_errors, "$mod is not installed ($req_string)";
+                }
+            }
+        }
+
+        if ( @reports ) {
+            push @full_reports, "=== $title ===\n\n";
+
+            my $ml = _max( map { length $_->[0] } @reports );
+            my $wl = _max( map { length $_->[1] } @reports );
+            my $hl = _max( map { length $_->[2] } @reports );
+
+            if ($type eq 'modules') {
+                splice @reports, 1, 0, ["-" x $ml, "", "-" x $hl];
+                push @full_reports, map { sprintf("    %*s %*s\n", -$ml, $_->[0], $hl, $_->[2]) } @reports;
+            }
+            else {
+                splice @reports, 1, 0, ["-" x $ml, "-" x $wl, "-" x $hl];
+                push @full_reports, map { sprintf("    %*s %*s %*s\n", -$ml, $_->[0], $wl, $_->[1], $hl, $_->[2]) } @reports;
+            }
+
+            push @full_reports, "\n";
+        }
+    }
+}
+
+if ( @full_reports ) {
+    diag "\nVersions for all modules listed in $source (including optional ones):\n\n", @full_reports;
+}
+
+if ( $cpan_meta_error || @dep_errors ) {
+    diag "\n*** WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING ***\n";
+}
+
+if ( $cpan_meta_error ) {
+    my ($orig_source) = grep { -f } 'MYMETA.json', 'MYMETA.yml';
+    diag "\nCPAN::Meta->load_file('$orig_source') failed with: $cpan_meta_error\n";
+}
+
+if ( @dep_errors ) {
+    diag join("\n",
+        "\nThe following REQUIRED prerequisites were not satisfied:\n",
+        @dep_errors,
+        "\n"
+    );
+}
+
+pass;
+
+# vim: ts=4 sts=4 sw=4 et:
index e2d63b6a2900f8482fb315812d56a6ce042d6306..e77d24aaad89c7efece6b93f09d0e52b8accfb4d 100644 (file)
@@ -29,4 +29,3 @@ sub _is_present
         }
     }
 }
-