pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/sysutils/libgtop libgtop: fix build with Perl >= 5.30



details:   https://anonhg.NetBSD.org/pkgsrc/rev/6a0c47a0708b
branches:  trunk
changeset: 399955:6a0c47a0708b
user:      gutteridge <gutteridge%pkgsrc.org@localhost>
date:      Mon Aug 19 05:59:56 2019 +0000

description:
libgtop: fix build with Perl >= 5.30

As of Perl 5.30, it's no longer permitted to set $[ to a non-zero
value, which was causing the lib.pl script to fail. Adjust the script
to use zero-based indexing. (Upstream has also changed this script
accordingly in subsequent releases, but this isn't a straight lift from
there, as the ingoing features.def input file format has also changed
in intervening releases, and there were other, unrelated changes
applied too.) This is a workaround until this package is updated to a
newer release (that is non-trivial because of the number of local
patches, etc.). Addresses PR pkg/54475.

diffstat:

 sysutils/libgtop/Makefile                 |   4 +-
 sysutils/libgtop/distinfo                 |   3 +-
 sysutils/libgtop/patches/patch-lib_lib.pl |  72 +++++++++++++++++++++++++++++++
 3 files changed, 76 insertions(+), 3 deletions(-)

diffs (106 lines):

diff -r 0a3d5a815934 -r 6a0c47a0708b sysutils/libgtop/Makefile
--- a/sysutils/libgtop/Makefile Mon Aug 19 05:45:25 2019 +0000
+++ b/sysutils/libgtop/Makefile Mon Aug 19 05:59:56 2019 +0000
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.59 2019/08/11 13:23:09 wiz Exp $
+# $NetBSD: Makefile,v 1.60 2019/08/19 05:59:56 gutteridge Exp $
 
 DISTNAME=              libgtop-2.28.4
-PKGREVISION=           15
+PKGREVISION=           16
 CATEGORIES=            sysutils gnome
 MASTER_SITES=          ${MASTER_SITE_GNOME:=sources/libgtop/2.28/}
 EXTRACT_SUFX=          .tar.bz2
diff -r 0a3d5a815934 -r 6a0c47a0708b sysutils/libgtop/distinfo
--- a/sysutils/libgtop/distinfo Mon Aug 19 05:45:25 2019 +0000
+++ b/sysutils/libgtop/distinfo Mon Aug 19 05:59:56 2019 +0000
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.35 2019/01/21 03:31:05 youri Exp $
+$NetBSD: distinfo,v 1.36 2019/08/19 05:59:56 gutteridge Exp $
 
 SHA1 (libgtop-2.28.4.tar.bz2) = b6f002cc80a61dc0908dd96e0b543113a46bc4b7
 RMD160 (libgtop-2.28.4.tar.bz2) = 96ac76aa409bbd202bedacd94df14cd549e10d6b
@@ -36,6 +36,7 @@
 SHA1 (patch-dl) = 9d6a44be02ec21d195076125c0cdfe5b51a0ab0a
 SHA1 (patch-dm) = ef08973aecacb1fb69f258632dd36edfdafd8c50
 SHA1 (patch-dn) = 66f66731a3abd1290f67d62f9ef654f68756bccb
+SHA1 (patch-lib_lib.pl) = f581a74c7a80519ed850ff050295dd805dcdd4db
 SHA1 (patch-sysdeps_bsd_cpu.c) = e6b2b1e90385340128505fcab1c5c4aa510e165a
 SHA1 (patch-sysdeps_bsd_glibtop__machine.h) = 1682156e3cb21d335499e38b6b91b8c315f1b962
 SHA1 (patch-sysdeps_bsd_netload.c) = d143e392982afdd095fd052f857bfca2319ac7e7
diff -r 0a3d5a815934 -r 6a0c47a0708b sysutils/libgtop/patches/patch-lib_lib.pl
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sysutils/libgtop/patches/patch-lib_lib.pl Mon Aug 19 05:59:56 2019 +0000
@@ -0,0 +1,72 @@
+$NetBSD: patch-lib_lib.pl,v 1.1 2019/08/19 05:59:56 gutteridge Exp $
+
+Adjust indexing basis for compatibility with Perl >=5.30.
+
+--- lib/lib.pl.orig    2011-06-01 15:40:47.000000000 +0000
++++ lib/lib.pl
+@@ -1,6 +1,5 @@
+ #!/usr/bin/perl
+ 
+-$[ = 1;                       # set array base to 1
+ $, = ' ';             # set output field separator
+ $\ = "\n";            # set output record separator
+ 
+@@ -86,9 +85,9 @@ while (<>) {
+ sub output {
+     local($line) = @_;
+     @line_fields = split(/\|/, $line, 9999);
+-    $retval = $line_fields[1];
+-    $feature = $line_fields[2];
+-    $param_def = $line_fields[4];
++    $retval = $line_fields[0];
++    $feature = $line_fields[1];
++    $param_def = $line_fields[3];
+ 
+     $orig = $feature;
+     $feature =~ s/^@//;
+@@ -106,16 +105,16 @@ sub output {
+     }
+ 
+     if ($param_def eq 'string') {
+-      $call_param = ', ' . $line_fields[5];
++      $call_param = ', ' . $line_fields[4];
+       $param_buf = '';
+       $buf_set = '';
+       $param_decl = ",\n            " . $space . '    const char *' .
+ 
+-        $line_fields[5];
+-      $send_ptr = "\n\tconst void *send_ptr = " . $line_fields[5] . ';';
++        $line_fields[4];
++      $send_ptr = "\n\tconst void *send_ptr = " . $line_fields[4] . ';';
+       $send_size = "\n\tconst size_t send_size =\n\t\tstrlen (" .
+ 
+-        $line_fields[5] . ') + 1;';
++        $line_fields[4] . ') + 1;';
+     }
+     else {
+       $call_param = '';
+@@ -128,7 +127,7 @@ sub output {
+       if ($nr_params) {
+           $param_buf = "\n\tstruct {\n";
+       }
+-      for ($param = 1; $param <= $nr_params; $param++) {
++      for ($param = 0; $param < $nr_params; $param++) {
+           $list = $params[$param];
+           $type = $params[$param];
+           $type =~ s/\(.*//;
+@@ -137,13 +136,13 @@ sub output {
+           $count = (@fields = split(/,/, $list, 9999));
+ 
+           if ($count > 0) {
+-              for ($field = 1; $field <= $count; $field++) {
++              for ($field = 0; $field < $count; $field++) {
+                   $param_buf .= "\t\t$convert{$type} buf_$fields[$field];\n";
+                   $buf_set .= "\tparam_buf.buf_$fields[$field] = $fields[$field];\n";
+               }
+           }
+ 
+-          for ($field = 1; $field <= $count; $field++) {
++          for ($field = 0; $field < $count; $field++) {
+               if ($param_decl eq '') {
+                   $param_decl = ",\n            " . $space . '    ';
+               }



Home | Main Index | Thread Index | Old Index