[arch-commits] Commit in perl/trunk (PKGBUILD fix-h2ph-and-tests.patch)

Angel Velásquez angvp at archlinux.org
Mon Jan 24 15:50:54 EST 2011


    Date: Monday, January 24, 2011 @ 15:50:53
  Author: angvp
Revision: 107435

upgpkg: perl 5.12.2-2
Fixing FS#22518

Added:
  perl/trunk/fix-h2ph-and-tests.patch
Modified:
  perl/trunk/PKGBUILD

--------------------------+
 PKGBUILD                 |   15 ++++--
 fix-h2ph-and-tests.patch |  104 +++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 114 insertions(+), 5 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2011-01-24 20:48:32 UTC (rev 107434)
+++ PKGBUILD	2011-01-24 20:50:53 UTC (rev 107435)
@@ -4,7 +4,7 @@
 # Contributor: francois <francois.archlinux.org> 
 pkgname=perl
 pkgver=5.12.2
-pkgrel=1
+pkgrel=2
 pkgdesc="A highly capable, feature-rich programming language"
 arch=(i686 x86_64)
 license=('GPL' 'PerlArtistic')
@@ -12,7 +12,7 @@
 groups=('base')
 depends=('gdbm' 'db>=4.8' 'coreutils' 'glibc' 'sh')
 changelog=ChangeLog
-source=(http://www.cpan.org/src/5.0/perl-${pkgver}.tar.bz2 perlbin.sh)
+source=(http://www.cpan.org/src/5.0/perl-${pkgver}.tar.bz2 perlbin.sh fix-h2ph-and-tests.patch)
 install=perl.install
 provides=(
 perl-archive-extract=0.38
@@ -156,8 +156,11 @@
     -Dinc_version_list=none \
     -Dman1ext=1perl -Dman3ext=3perl ${arch_opts}
     #-Dotherlibdirs=/usr/lib/perl5/site_perl/5.10.1:/usr/share/perl5/site_perl/5.10.1:/usr/lib/perl5/current:/usr/lib/perl5/site_perl/current \
-
-  make || return 1
+  patch -Np1 -i $srcdir/fix-h2ph-and-tests.patch
+  make
+}
+package() {
+  cd ${srcdir}/${pkgname}-${pkgver}
   make install
 
   ### Perl Settings ###
@@ -200,4 +203,6 @@
   find $pkgdir/usr/lib -name *.pod -delete
   find $pkgdir -name .packlist -delete
 }
-md5sums=('7b018fe9c2f434eff0c629b4c515a8fc' 'f86eb0dba1638ca6d1c8fff1b06c2a71')
+md5sums=('7b018fe9c2f434eff0c629b4c515a8fc'
+         'f86eb0dba1638ca6d1c8fff1b06c2a71'
+         '294b5311cbfc50e7dcffbee85854da38')

Added: fix-h2ph-and-tests.patch
===================================================================
--- fix-h2ph-and-tests.patch	                        (rev 0)
+++ fix-h2ph-and-tests.patch	2011-01-24 20:50:53 UTC (rev 107435)
@@ -0,0 +1,104 @@
+From 8d66b3f930dc6d88b524d103e304308ae73a46e7 Mon Sep 17 00:00:00 2001
+From: Robin Barker <rmbarker at cpan.org>
+Date: Thu, 22 Apr 2010 11:51:20 +0100
+Subject: [PATCH 1/1] Fix h2ph and test
+
+---
+ lib/h2ph.t    |   12 ++++++++++--
+ utils/h2ph.PL |   28 +++++++++++++++++++++++-----
+ 2 files changed, 33 insertions(+), 7 deletions(-)
+
+diff --git a/lib/h2ph.t b/lib/h2ph.t
+index 27dd7b9..8d62d46 100644
+--- a/lib/h2ph.t
++++ b/lib/h2ph.t
+@@ -18,7 +18,7 @@ if (!(-e $extracted_program)) {
+     exit 0;
+ }
+ 
+-plan(4);
++plan(5);
+ 
+ # quickly compare two text files
+ sub txt_compare {
+@@ -41,8 +41,16 @@ $result = runperl( progfile => 'lib/h2ph.pht',
+                    stderr => 1 );
+ like( $result, qr/syntax OK$/, "output compiles");
+ 
++$result = runperl( progfile => '_h2ph_pre.ph',
++                   switches => ['-c'],
++                   stderr => 1 );
++like( $result, qr/syntax OK$/, "preamble compiles");
++
+ $result = runperl( switches => ["-w"], 
+-                   prog => '$SIG{__WARN__} = sub { die $_[0] }; require q(lib/h2ph.pht);');
++                   stderr => 1,
++                   prog => <<'PROG' );
++$SIG{__WARN__} = sub { die $_[0] }; require q(lib/h2ph.pht);
++PROG
+ is( $result, '', "output free of warnings" );
+ 
+ # cleanup
+diff --git a/utils/h2ph.PL b/utils/h2ph.PL
+index 8f56db4..1255807 100644
+--- a/utils/h2ph.PL
++++ b/utils/h2ph.PL
+@@ -401,7 +401,10 @@ if ($opt_e && (scalar(keys %bad_file) > 0)) {
+ exit $Exit;
+ 
+ sub expr {
+-    $new = '"(assembly code)"' and return if /\b__asm__\b/; # freak out.
++    if (/\b__asm__\b/) {	# freak out
++	$new = '"(assembly code)"';
++	return
++    }
+     my $joined_args;
+     if(keys(%curargs)) {
+ 	$joined_args = join('|', keys(%curargs));
+@@ -770,7 +773,7 @@ sub inc_dirs
+ sub build_preamble_if_necessary
+ {
+     # Increment $VERSION every time this function is modified:
+-    my $VERSION     = 2;
++    my $VERSION     = 3;
+     my $preamble    = "$Dest_dir/_h2ph_pre.ph";
+ 
+     # Can we skip building the preamble file?
+@@ -798,7 +801,16 @@ sub build_preamble_if_necessary
+ 		# parenthesized value:  d=(v)
+ 		$define{$_} = $1;
+ 	    }
+-	    if ($define{$_} =~ /^([+-]?(\d+)?\.\d+([eE][+-]?\d+)?)[FL]?$/) {
++	    if (/^(\w+)\((\w)\)$/) {
++		my($macro, $arg) = ($1, $2);
++		my $def = $define{$_};
++		$def =~ s/$arg/\$\{$arg\}/g;
++		print PREAMBLE <<DEFINE;
++unless (defined &$macro) { sub $macro(\$) { my (\$$arg) = \@_; \"$def\" } }
++
++DEFINE
++	    } elsif
++		($define{$_} =~ /^([+-]?(\d+)?\.\d+([eE][+-]?\d+)?)[FL]?$/) {
+ 		# float:
+ 		print PREAMBLE
+ 		    "unless (defined &$_) { sub $_() { $1 } }\n\n";
+@@ -807,8 +819,14 @@ sub build_preamble_if_necessary
+ 		print PREAMBLE
+ 		    "unless (defined &$_) { sub $_() { $1 } }\n\n";
+ 	    } elsif ($define{$_} =~ /^\w+$/) {
+-		print PREAMBLE
+-		    "unless (defined &$_) { sub $_() { &$define{$_} } }\n\n";
++		my $def = $define{$_};
++		if ($isatype{$def}) {
++		  print PREAMBLE
++		    "unless (defined &$_) { sub $_() { \"$def\" } }\n\n";
++		} else {
++		  print PREAMBLE
++		    "unless (defined &$_) { sub $_() { &$def } }\n\n";
++	        }
+ 	    } else {
+ 		print PREAMBLE
+ 		    "unless (defined &$_) { sub $_() { \"",
+-- 
+1.6.5.2.74.g610f9.dirty
+



More information about the arch-commits mailing list