[packages/perl-PDL] add various patches to fix build with new hdf and gcc
atler
atler at pld-linux.org
Mon Jul 28 19:19:12 CEST 2025
commit 1596385a0601013c2cd2d416024e268eeed047ca
Author: Jan Palus <atler at pld-linux.org>
Date: Mon Jul 28 19:17:48 2025 +0200
add various patches to fix build with new hdf and gcc
hdf.patch | 31 +++++++++++++++++++++++++++++++
includes.patch | 16 ++++++++++++++++
perl-PDL.spec | 6 ++++++
types.patch | 34 ++++++++++++++++++++++++++++++++++
4 files changed, 87 insertions(+)
---
diff --git a/perl-PDL.spec b/perl-PDL.spec
index 1f04ca6..cf58c31 100644
--- a/perl-PDL.spec
+++ b/perl-PDL.spec
@@ -21,6 +21,9 @@ Patch1: %{name}-dep.patch
Patch2: %{name}-Makefile.PL.patch-dumb
Patch4: %{name}-vendorarch.patch
Patch5: PDL-Disable-PDL-GIS-Proj.patch
+Patch6: hdf.patch
+Patch7: includes.patch
+Patch8: types.patch
# defunct as of 2024-06-13
#URL: https://pdl.perl.org/
URL: https://metacpan.org/dist/PDL
@@ -457,6 +460,9 @@ Przykładowe skrypty z użyciem PDL.
%patch -P2 -p1
%patch -P4 -p1
%patch -P5 -p1
+%patch -P6 -p1
+%patch -P7 -p1
+%patch -P8 -p1
# g77 flags for compiling Slatec:
%{__perl} -pi -e 's@\) \$mycflags s@\) %{rpmcflags} -fPIC s@' Lib/Slatec/Makefile.PL
diff --git a/hdf.patch b/hdf.patch
new file mode 100644
index 0000000..44415c6
--- /dev/null
+++ b/hdf.patch
@@ -0,0 +1,31 @@
+--- PDL-2.029/IO/HDF/SD/SD.pd.orig 2021-02-20 02:22:59.000000000 +0100
++++ PDL-2.029/IO/HDF/SD/SD.pd 2025-07-28 17:49:36.821050955 +0200
+@@ -283,7 +283,7 @@
+ int i;
+ size_t size;
+ int status;
+- origin = HDgetspace( sizeof( int ) * rank );
++ origin = malloc( sizeof( int ) * rank );
+ for( i = 0; i < rank; i++ )
+ origin[i] = 0;
+ /* Just use the largest datatype here: */
+@@ -293,7 +293,7 @@
+ for( i = 1; i < rank; i++ )
+ size *= chunk_lengths[i];
+ }
+- data = HDgetspace( size );
++ data = malloc( size );
+ status = SDwritechunk(sds_id, origin, data);
+ if( status == FAIL )
+ {
+@@ -300,8 +300,8 @@
+ fprintf(stderr, "_SDinitchunk(): return status = %d\n", status);
+ HEprint(stderr, 0);
+ }
+- HDfreespace( data );
+- HDfreespace( origin );
++ free( data );
++ free( origin );
+ RETVAL = status;
+ OUTPUT:
+ RETVAL
diff --git a/includes.patch b/includes.patch
new file mode 100644
index 0000000..7b09f28
--- /dev/null
+++ b/includes.patch
@@ -0,0 +1,16 @@
+--- PDL-2.029/IO/Browser/browse.c.orig 2021-02-15 12:22:30.000000000 +0100
++++ PDL-2.029/IO/Browser/browse.c 2025-07-28 18:08:13.081220079 +0200
+@@ -1,3 +1,4 @@
++#include <ctype.h>
+ #include <stdio.h>
+ #include <stdlib.h>
+
+@@ -16,7 +17,7 @@
+ #include <string.h>
+
+ #include "EXTERN.h"
+-// #include "perl.h"
++#include "perl.h"
+ // #include "XSUB.h"
+
+ #include "pdl.h"
diff --git a/types.patch b/types.patch
new file mode 100644
index 0000000..e7dd973
--- /dev/null
+++ b/types.patch
@@ -0,0 +1,34 @@
+--- PDL-2.029/IO/Browser/browse.c.orig 2025-07-28 18:08:13.081220079 +0200
++++ PDL-2.029/IO/Browser/browse.c 2025-07-28 18:16:50.277724147 +0200
+@@ -61,7 +61,7 @@
+ sprintf(str,format[type],*(((double *)data)+y*nx+x));
+ break;
+ default:
+- Perl_croak("type (val=%d) not implemented",type);
++ Perl_croak_nocontext("type (val=%d) not implemented",type);
+ break;
+ }
+ return str;
+@@ -93,7 +93,7 @@
+ *(((PDL_Double *)data)+y*nx+x) = atof(str);
+ break;
+ default:
+- Perl_croak("type (val=%d) not implemented",type);
++ Perl_croak_nocontext("type (val=%d) not implemented",type);
+ break;
+ }
+ return;
+--- PDL-2.029/IO/Browser/browser.pd.orig 2019-04-22 02:30:51.000000000 +0200
++++ PDL-2.029/IO/Browser/browser.pd 2025-07-28 18:58:27.666379525 +0200
+@@ -16,6 +16,11 @@
+
+
+ EOD
++pp_addhdr(<<'EOH');
++
++void browse(int type, int nc, int nr, void *in);
++
++EOH
+
+ use PDL::Types;
+
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/perl-PDL.git/commitdiff/1596385a0601013c2cd2d416024e268eeed047ca
More information about the pld-cvs-commit
mailing list