perl: update to 5.16.0.

This commit is contained in:
Juan RP 2012-05-27 11:58:37 +02:00
parent 9540ebd754
commit f6a4e9e6b5
3 changed files with 430 additions and 86 deletions

289
srcpkgs/perl/files/provides.pl Executable file
View file

@ -0,0 +1,289 @@
#!/usr/bin/env perl
##
# Script for printing out a provides list of every CPAN distribution
# that is bundled with perl. You can run it before building perl
# or you can run it after building perl. Required modules are in core
# for perl 5.13 and above. It might be nice if this didn't require
# HTTP::Tiny and maybe just used wget or curl.
#
# This script uses HTTP::Tiny to query Tatsuhiko Miyagawa's webapp at
# cpanmetadb.plackperl.org to cross-reference module files to their
# providing CPAN distribution. Thank you Miyagawa!
#
# - Justin "juster" Davis <jrcd83@gmail.com>
#
# Based on the Archlinux version and modified for xbps.
use warnings 'FATAL' => 'all';
use strict;
package Common;
sub evalver
{
my ($path, $mod) = @_;
open my $fh, '<', $path or die "open $path: $!";
my $m = ($mod
? qr/(?:\$${mod}::VERSION|\$VERSION)/
: qr/\$VERSION/);
while (my $ln = <$fh>) {
next unless $ln =~ /\s*$m\s*=\s*.+/;
chomp $ln;
my $ver = do { no strict; eval $ln };
return $ver unless $@;
die qq{$path:$. bad version string in "$ln"\n};
}
close $fh;
return undef;
}
#-----------------------------------------------------------------------------
package Dists;
sub maindistfile
{
my ($dist, $dir) = @_;
# libpath is the modern style, installing modules under lib/
# with dirs matching the name components.
my $libpath = join q{/}, 'lib', split /-/, "${dist}.pm";
# dumbpath is an old style where there's no subdirs and just
# a .pm file.
my $dumbpath = $dist;
$dumbpath =~ s/\A.+-//;
$dumbpath .= ".pm";
my @paths = ($libpath, $dumbpath);
# Some modules (with simple names like XSLoader, lib, etc) are
# generated by Makefile.PL. Search through their generating code.
push @paths, "${dist}_pm.PL" if $dist =~ tr/-/-/ == 0;
for my $path (map { "$dir/$_" } @paths) { return $path if -f $path; }
return undef;
}
sub module_ver
{
my ($dist, $dir) = @_;
my $path = maindistfile($dist, $dir) or return undef;
my $mod = $dist;
$mod =~ s/-/::/g;
my $ver = Common::evalver($path, $mod);
unless ($ver) {
warn "failed to find version in module file for $dist\n";
return undef;
}
return $ver;
}
sub changelog_ver
{
my ($dist, $dir) = @_;
my $path;
for my $tmp (glob "$dir/{Changes,ChangeLog}") {
if (-f $tmp) { $path = $tmp; last; }
}
return undef unless $path;
open my $fh, '<', $path or die "open: $!";
while (<$fh>) {
return $1 if /\A\s*(?:$dist[ \t]*)?([0-9._]+)/;
return $1 if /\A\s*version\s+([0-9._]+)/i;
}
close $fh;
return undef;
}
# for some reason podlators has a VERSION file with perl code in it
sub verfile_ver
{
my ($dist, $dir) = @_;
my $path = "$dir/VERSION";
return undef unless -f $path; # no warning, only podlaters has it
return Common::evalver($path);
}
# scans a directory full of nicely separated dist. directories.
sub scan_distroot
{
my ($distroot) = @_;
opendir my $cpand, "$distroot" or die "failed to open $distroot";
my @dists = grep { !/^\./ && -d "$distroot/$_" } readdir $cpand;
closedir $cpand;
my @found;
for my $dist (@dists) {
my $distdir = "$distroot/$dist";
my $ver = (module_ver($dist, $distdir)
|| changelog_ver($dist, $distdir)
|| verfile_ver($dist, $distdir));
if ($ver) { push @found, [ $dist, $ver ]; }
else { warn "failed to find version for $dist\n"; }
}
return @found;
}
sub find
{
my ($srcdir) = @_;
return map { scan_distroot($_) } glob "$srcdir/{cpan,dist}";
}
#-----------------------------------------------------------------------------
package Modules;
use HTTP::Tiny qw();
use File::Find qw();
use File::stat;
*findfile = *File::Find::find;
sub cpan_provider
{
my ($module) = @_;
my $url = "http://cpanmetadb.plackperl.org/v1.0/package/$module";
my $http = HTTP::Tiny->new;
my $resp = $http->get($url);
return undef unless $resp->{'success'};
my ($cpanpath) = $resp->{'content'} =~ /^distfile: (.*)$/m
or return undef;
my $dist = $cpanpath;
$dist =~ s{\A.+/}{}; # remove author directory
$dist =~ s{-[^-]+\z}{}; # remove version and extension
return ($dist eq 'perl' ? undef : $dist);
}
sub find
{
my ($srcdir) = @_;
my $libdir = "$srcdir/lib/";
die "failed to find $libdir directory" unless -d $libdir;
# Find only the module files that have not changed since perl
# was extracted. We don't want the files perl just recently
# installed into lib/. We processed those already.
my @modfiles;
my $finder = sub {
return unless /[.]pm\z/;
return if m{\Q$libdir\E[^/]+/t/}; # ignore testing modules
push @modfiles, $_;
};
findfile({ 'no_chdir' => 1, 'wanted' => $finder }, $libdir);
# First we have to find what the oldest ctime actually is.
my $oldest = time;
@modfiles = map {
my $modfile = $_;
my $ctime = (stat $modfile)->ctime;
$oldest = $ctime if $ctime < $oldest;
[ $modfile, $ctime ]; # save ctime for later
} @modfiles;
# Then we filter out any file that was created more than a
# few seconds after that. Process the rest.
my @mods;
for my $modfile (@modfiles) {
my ($mod, $ctime) = @$modfile;
next if $ctime - $oldest > 5; # ignore newer files
my $path = $mod;
$mod =~ s{[.]pm\z}{};
$mod =~ s{\A$libdir}{};
$mod =~ s{/}{::}g;
my $ver = Common::evalver($path, $mod) || q{};
push @mods, [ $mod, $ver ];
}
# Convert modules names to the dist names who provide them.
my %seen;
my @dists;
for my $modref (@mods) {
my ($mod, $ver) = @$modref;
my $dist = cpan_provider($mod) or next; # filter out core modules
next if $seen{$dist}++; # avoid duplicate dists
push @dists, [ $dist, $ver ];
}
return @dists;
}
#-----------------------------------------------------------------------------
package Dist2Pkg;
sub name
{
my ($name) = @_;
my $orig = $name;
# Delete leading or trailing hyphens...
$name =~ s/\A-|-\z//g;
die qq{Dist. name '$orig' completely violates packaging standards}
unless $name;
return "perl-$name";
}
sub version
{
my ($version) = @_;
# Package versions should be numbers and decimal points only...
$version =~ tr/-/./;
$version =~ tr/_0-9.-//cd;
$version =~ tr/././s; # only one period at a time
$version =~ s/\A[.]|[.]\z//g; # shouldn't start or stop with a period
return $version;
}
#-----------------------------------------------------------------------------
package main;
my %CPANNAME = ('List-Util' => 'Scalar-List-Utils',
'Text-Tabs' => 'Text-Tabs+Wrap',
'Cwd' => 'PathTools');
my $perldir = shift or die "Usage: $0 [path to perl source directory]\n";
die "$perldir is not a valid directory." unless -d $perldir;
my @dists = (Dists::find($perldir), Modules::find($perldir));
for my $dist (@dists) {
my $name = $dist->[0];
$dist->[0] = $CPANNAME{$name} if exists $CPANNAME{$name};
}
my @pkgs = map {
my ($name, $ver) = @$_;
$name = Dist2Pkg::name($name);
$ver = Dist2Pkg::version($ver);
[ $name, $ver ];
} @dists;
@pkgs = sort { $a->[0] cmp $b->[0] } @pkgs;
for my $pkg (@pkgs) {
my ($name, $ver) = @$pkg;
print "$name-$ver\n";
}

View file

@ -1,83 +0,0 @@
From bb249b0b26c2e79a6f55355ef94889070f07fd21 Mon Sep 17 00:00:00 2001
From: Niko Tyni <ntyni@debian.org>
Date: Thu, 28 Apr 2011 09:18:54 +0300
Subject: [PATCH] Append CFLAGS and LDFLAGS to their Config.pm counterparts in
EU::CBuilder
Since ExtUtils::CBuilder 0.27_04 (bleadperl commit 06e8058f27e4),
CFLAGS and LDFLAGS from the environment have overridden the Config.pm
ccflags and ldflags settings. This can cause binary incompatibilities
between the core Perl and extensions built with EU::CBuilder.
Append to the Config.pm values rather than overriding them.
---
.../lib/ExtUtils/CBuilder/Base.pm | 6 +++-
dist/ExtUtils-CBuilder/t/04-base.t | 25 +++++++++++++++++++-
2 files changed, 28 insertions(+), 3 deletions(-)
diff --git a/dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Base.pm b/dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Base.pm
index b572312..2255c51 100644
--- dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Base.pm
+++ dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Base.pm
@@ -40,11 +40,13 @@ sub new {
$self->{config}{$k} = $v unless exists $self->{config}{$k};
}
$self->{config}{cc} = $ENV{CC} if defined $ENV{CC};
- $self->{config}{ccflags} = $ENV{CFLAGS} if defined $ENV{CFLAGS};
+ $self->{config}{ccflags} = join(" ", $self->{config}{ccflags}, $ENV{CFLAGS})
+ if defined $ENV{CFLAGS};
$self->{config}{cxx} = $ENV{CXX} if defined $ENV{CXX};
$self->{config}{cxxflags} = $ENV{CXXFLAGS} if defined $ENV{CXXFLAGS};
$self->{config}{ld} = $ENV{LD} if defined $ENV{LD};
- $self->{config}{ldflags} = $ENV{LDFLAGS} if defined $ENV{LDFLAGS};
+ $self->{config}{ldflags} = join(" ", $self->{config}{ldflags}, $ENV{LDFLAGS})
+ if defined $ENV{LDFLAGS};
unless ( exists $self->{config}{cxx} ) {
my ($ccpath, $ccbase, $ccsfx ) = fileparse($self->{config}{cc}, qr/\.[^.]*/);
diff --git a/dist/ExtUtils-CBuilder/t/04-base.t b/dist/ExtUtils-CBuilder/t/04-base.t
index c3bf6b5..1bb15aa 100644
--- dist/ExtUtils-CBuilder/t/04-base.t
+++ dist/ExtUtils-CBuilder/t/04-base.t
@@ -1,7 +1,7 @@
#! perl -w
use strict;
-use Test::More tests => 50;
+use Test::More tests => 64;
use Config;
use Cwd;
use File::Path qw( mkpath );
@@ -326,6 +326,29 @@ is_deeply( $mksymlists_args,
"_prepare_mksymlists_args(): got expected arguments for Mksymlists",
);
+my %testvars = (
+ CFLAGS => 'ccflags',
+ LDFLAGS => 'ldflags',
+);
+
+while (my ($VAR, $var) = each %testvars) {
+ local $ENV{$VAR};
+ $base = ExtUtils::CBuilder::Base->new( quiet => 1 );
+ ok( $base, "ExtUtils::CBuilder::Base->new() returned true value" );
+ isa_ok( $base, 'ExtUtils::CBuilder::Base' );
+ like($base->{config}{$var}, qr/\Q$Config{$var}/,
+ "honours $var from Config.pm");
+
+ $ENV{$VAR} = "-foo -bar";
+ $base = ExtUtils::CBuilder::Base->new( quiet => 1 );
+ ok( $base, "ExtUtils::CBuilder::Base->new() returned true value" );
+ isa_ok( $base, 'ExtUtils::CBuilder::Base' );
+ like($base->{config}{$var}, qr/\Q$ENV{$VAR}/,
+ "honours $VAR from the environment");
+ like($base->{config}{$var}, qr/\Q$Config{$var}/,
+ "doesn't override $var from Config.pm with $VAR from the environment");
+}
+
#####
for ($source_file, $object_file, $lib_file) {
--
1.7.4.4

View file

@ -1,14 +1,13 @@
# Template build file for 'perl'. # Template build file for 'perl'.
pkgname=perl pkgname=perl
version=5.14.2 version=5.16.0
distfiles="http://www.cpan.org/src/5.0/$pkgname-$version.tar.bz2" distfiles="http://www.cpan.org/src/5.0/$pkgname-$version.tar.bz2"
revision=4
makedepends="gdbm-devel db-devel less groff" makedepends="gdbm-devel db-devel less groff"
short_desc="Practical Extraction and Report Language" short_desc="Practical Extraction and Report Language"
maintainer="Juan RP <xtraeme@gmail.com>" maintainer="Juan RP <xtraeme@gmail.com>"
homepage="http://www.perl.org" homepage="http://www.perl.org"
license="GPL-2" license="GPL-2"
checksum=c2a2362e8d1fdd2bfbfde801fcd78241f154c164f00fba76065ab8cc5c7b06cd checksum=8c1d25e92a5760e84f77baa57fde5606fd6e95ec992408d36fa53c47162721d1
long_desc=" long_desc="
Perl is a general-purpose programming language originally developed Perl is a general-purpose programming language originally developed
for text manipulation and now used for a wide range of tasks including for text manipulation and now used for a wide range of tasks including
@ -20,6 +19,145 @@ long_desc="
support for text processing, and has one of the world's most impressive support for text processing, and has one of the world's most impressive
collections of third-party modules." collections of third-party modules."
# Before updating this package to a new major version, run ${FILESDIR}/provides.pl
# against ${wrksrc} to find the list of built in packages.
provides="
perl-Archive-Extract-0.58
perl-Archive-Tar-1.82
perl-Attribute-Handlers-0.93
perl-AutoLoader-5.72
perl-B-Debug-1.17
perl-B-Deparse-1.14
perl-B-Lint-1.14
perl-CGI-3.59
perl-CPAN-1.9800
perl-CPAN-Meta-2.120630
perl-CPAN-Meta-YAML-0.007
perl-CPANPLUS-0.9121
perl-CPANPLUS-Dist-Build-0.62
perl-Carp-1.26
perl-Compress-Raw-Bzip2-2.048
perl-Compress-Raw-Zlib-2.048
perl-DB_File-1.826
perl-Data-Dumper-2.135_06
perl-Devel-PPPort-3.20
perl-Devel-SelfStubber-1.05
perl-Digest-1.17
perl-Digest-MD5-2.51
perl-Digest-SHA-5.71
perl-Dumpvalue-1.17
perl-Encode-2.44
perl-Env-1.03
perl-Exporter-5.66
perl-ExtUtils-CBuilder-0.280206
perl-ExtUtils-Command-1.17
perl-ExtUtils-Constant-0.23
perl-ExtUtils-Install-1.58
perl-ExtUtils-MakeMaker-6.63_02
perl-ExtUtils-Manifest-1.61
perl-ExtUtils-ParseXS-3.16
perl-File-CheckTree-4.41
perl-File-Fetch-0.32
perl-File-Path-2.08_01
perl-File-Temp-0.22
perl-Filter-Simple-0.88
perl-Filter-Util-Call-1.40
perl-Getopt-Long-2.38
perl-HTTP-Tiny-0.017
perl-I18N-Collate-1.02
perl-I18N-LangTags-0.38
perl-IO-1.25_06
perl-IO-Compress-2.048
perl-IO-Zlib-1.10
perl-IPC-Cmd-0.76
perl-IPC-SysV-2.03
perl-JSON-PP-2.27200
perl-Locale-Codes-3.21
perl-Locale-Maketext-1.22
perl-Locale-Maketext-Simple-0.21
perl-Log-Message-0.04
perl-Log-Message-Simple-0.08
perl-MIME-Base64-3.13
perl-Math-BigInt-1.998
perl-Math-BigInt-FastCalc-0.30
perl-Math-BigRat-0.2603
perl-Math-Complex-1.59
perl-Memoize-1.02
perl-Module-Build-0.39_01
perl-Module-CoreList-2.66
perl-Module-Load-0.22
perl-Module-Load-Conditional-0.46
perl-Module-Loaded-0.08
perl-Module-Metadata-1.000009
perl-Module-Pluggable-4.0
perl-NEXT-0.65
perl-Net-Ping-2.38
perl-Object-Accessor-0.42
perl-Package-Constants-0.02
perl-Params-Check-0.32
perl-Parse-CPAN-Meta-1.4402
perl-PathTools-3.39_02
perl-Perl-OSType-1.002
perl-PerlIO-via-QuotedPrint-0.06
perl-Pod-Escapes-1.04
perl-Pod-LaTeX-0.60
perl-Pod-Parser-1.51
perl-Pod-Perldoc-3.17
perl-Pod-Simple-3.20
perl-Safe-2.31_01
perl-Scalar-List-Utils-1.23
perl-Search-Dict-1.04
perl-SelfLoader-1.20
perl-Socket-2.001
perl-Storable-2.34
perl-Sys-Syslog-0.29
perl-Term-ANSIColor-3.01
perl-Term-Cap-1.13
perl-Term-Complete-1.402
perl-Term-ReadLine-1.09
perl-Term-UI-0.30
perl-Test-1.25_02
perl-Test-Harness-3.23
perl-Test-Simple-0.98
perl-Text-Abbrev-1.02
perl-Text-Balanced-2.02
perl-Text-ParseWords-3.27
perl-Text-Soundex-3.03_01
perl-Text-Tabs+Wrap-2009.0305
perl-Thread-Queue-2.12
perl-Thread-Semaphore-2.12
perl-Tie-File-0.98
perl-Tie-RefHash-1.39
perl-Time-HiRes-1.9725
perl-Time-Local-1.2000
perl-Time-Piece-1.20_01
perl-Unicode-Collate-0.89
perl-Unicode-Normalize-1.14
perl-Version-Requirements-0.101022
perl-Win32-0.44
perl-Win32API-File-0.1200
perl-XSLoader-0.16
perl-autodie-2.10
perl-autouse-1.07
perl-base-2.18
perl-bignum-0.29
perl-constant-1.23
perl-encoding-warnings-0.11
perl-if-0.0602
perl-lib-0.63
perl-libnet-1.22
perl-parent-0.225
perl-perlfaq-5.0150039
perl-podlators-2.4.0
perl-threads-1.86
perl-threads-shared-1.40
perl-version-0.99
"
for _f in ${provides}; do
_p=$($XBPS_PKGDB_CMD getpkgname ${_f})
replaces="${replaces} ${_p}>=0"
done
do_build() { do_build() {
./Configure \ ./Configure \