[packages/h4h5tools] - more patches for missing includes and incompatible types; allow building with hdf 4.3

qboosh qboosh at pld-linux.org
Sun Dec 22 13:16:15 CET 2024


commit dc06eb96e5542f496b975b3f701c906ef988425f
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Sun Dec 22 12:23:14 2024 +0100

    - more patches for missing includes and incompatible types; allow building with hdf 4.3

 h4h5tools-hdf4.3.patch   | 78 ++++++++++++++++++++++++++++++++++++++++++++++++
 h4h5tools-includes.patch | 55 ++++++++++++++++++++++++++++++++++
 h4h5tools-types.patch    | 20 +++++++++++++
 h4h5tools.spec           | 13 +++++---
 4 files changed, 162 insertions(+), 4 deletions(-)
---
diff --git a/h4h5tools.spec b/h4h5tools.spec
index d87445e..5d4b1db 100644
--- a/h4h5tools.spec
+++ b/h4h5tools.spec
@@ -11,7 +11,10 @@ Patch0:		%{name}-config.patch
 Patch1:		%{name}-shared.patch
 Patch2:		%{name}-hdfeos.patch
 Patch3:		%{name}-format.patch
-URL:		http://portal.hdfgroup.org/display/support/h4h5tools
+Patch4:		%{name}-hdf4.3.patch
+Patch5:		%{name}-includes.patch
+Patch6:		%{name}-types.patch
+URL:		https://support.hdfgroup.org/documentation/index.html
 BuildRequires:	autoconf >= 2.50
 BuildRequires:	automake
 BuildRequires:	hdf-devel >= 4.2.6
@@ -84,18 +87,20 @@ oraz z HDF5 do HDF 4.x.
 %patch -P1 -p1
 %patch -P2 -p1
 %patch -P3 -p1
+%patch -P4 -p1
+%patch -P5 -p1
+%patch -P6 -p1
 
 %build
 %{__libtoolize}
 %{__aclocal}
 %{__autoconf}
 %{__automake}
-CPPFLAGS="%{rpmcppflags} -I/usr/include/hdf -DH5_USE_16_API"
+CPPFLAGS="%{rpmcppflags} -I/usr/include/hdf"
 %configure \
 	--with-hdfeos2
 
-%{__make} \
-	h5toh4_LDADD="-lmfhdf"
+%{__make}
 
 %install
 rm -rf $RPM_BUILD_ROOT
diff --git a/h4h5tools-hdf4.3.patch b/h4h5tools-hdf4.3.patch
new file mode 100644
index 0000000..fed492e
--- /dev/null
+++ b/h4h5tools-hdf4.3.patch
@@ -0,0 +1,78 @@
+--- h4h5tools-2.2.5/lib/src/h4toh5main.c.orig	2020-03-10 15:33:18.000000000 +0100
++++ h4h5tools-2.2.5/lib/src/h4toh5main.c	2024-12-22 08:16:29.398558715 +0100
+@@ -518,7 +518,7 @@ hid_t H4toH5open(char* filename,char* fi
+ 
+ /* create or open current hdf5 file. */
+ 
+-    h5_extension = HDstrdup("h5");
++    h5_extension = strdup("h5");
+     short file5name_null=0;
+     if(file5name == NULL) {
+         file5name= BuildFilename(filename,h5_extension);
+--- h4h5tools-2.2.5/utils/h4toh5/h4toh5main.c.orig	2020-03-10 15:33:18.000000000 +0100
++++ h4h5tools-2.2.5/utils/h4toh5/h4toh5main.c	2024-12-22 08:16:36.051856005 +0100
+@@ -874,7 +874,7 @@ int gen_h4toh5(char*h4_filename,char*h5_
+ #endif
+ 
+     if(h5_filename == NULL){
+-        h5_extension = HDstrdup("h5");
++        h5_extension = strdup("h5");
+         h5_filename = util_BuildFilename(h4_filename,h5_extension);
+         free(h5_extension);
+         if (h5_filename == NULL) {
+--- h4h5tools-2.2.5/utils/h5toh4/h5toh4.c.orig	2024-12-22 07:55:42.471980563 +0100
++++ h4h5tools-2.2.5/utils/h5toh4/h5toh4.c	2024-12-22 08:16:54.701754969 +0100
+@@ -392,7 +392,7 @@ main(int argc, char *argv[])
+ 
+       if (outfile_named == FALSE)
+       {
+-            h4_extension = HDstrdup("hdf");
++            h4_extension = strdup("hdf");
+             h4_filename = BuildFilename(h5_filename, h4_extension);
+ 
+             if (h4_filename == NULL) {
+@@ -907,7 +907,7 @@ int h5toh4(char *h5_filename, char *h4_f
+                 op_data.vgroup_id = 0;
+ 
+                 /* start at root group */
+-                /*if ((status = convert_group(gid, HDstrdup("/"), &op_data)) != SUCCEED) */
++                /*if ((status = convert_group(gid, strdup("/"), &op_data)) != SUCCEED) */
+                 if ((status = convert_group(gid, "/", &op_data)) != SUCCEED) {
+                     fprintf(stderr, "Error: convert_group did not work for %s\n", "/");
+                     DEBUG_PRINT("Error detected in %s() [%s line %d]\n",
+@@ -4006,7 +4006,7 @@ find_objs(hid_t group, const char *name,
+                 info->type_table->objs[info->type_table->nobjs-1].objflag = 1;
+             } else {
+                 free(info->type_table->objs[i].objname);
+-                info->type_table->objs[i].objname = HDstrdup(tmp);
++                info->type_table->objs[i].objname = strdup(tmp);
+                 info->type_table->objs[i].recorded = 1; 
+ 
+                 /* named data type */  
+@@ -4087,7 +4087,7 @@ set_tableflag(table_t *table, int idx)
+  *
+  * Purpose:     Get name of i'th object in table
+  *
+- * Return:      Success:    HDstrdup() of object name character string
++ * Return:      Success:    strdup() of object name character string
+  *
+  *              Failure:    NULL and sets errno to ENOMEM
+  *
+@@ -4098,7 +4098,7 @@ set_tableflag(table_t *table, int idx)
+ static char *
+ get_objectname(table_t *table, int idx)
+ {
+-    return HDstrdup(table->objs[idx].objname);
++    return strdup(table->objs[idx].objname);
+ }
+ 
+ 

+@@ -4138,7 +4138,7 @@ add_obj(table_t *table, unsigned long *o
+     table->objs[i].objno[0] = objno[0];
+     table->objs[i].objno[1] = objno[1];
+     free(table->objs[i].objname);
+-    table->objs[i].objname = HDstrdup(objname);
++    table->objs[i].objname = strdup(objname);
+ }
+ 
+ /* pkamat. Everything in this file below this point has been ADDED by pkamat. */
diff --git a/h4h5tools-includes.patch b/h4h5tools-includes.patch
new file mode 100644
index 0000000..68b3da1
--- /dev/null
+++ b/h4h5tools-includes.patch
@@ -0,0 +1,55 @@
+--- h4h5tools-2.2.5/lib/src/h4toh5main.c.orig	2024-12-22 08:17:47.414802732 +0100
++++ h4h5tools-2.2.5/lib/src/h4toh5main.c	2024-12-22 08:21:48.053499080 +0100
+@@ -37,6 +37,7 @@ Author:  Kent Yang(myang6 at hdfgroup.org)
+ *****************************************************************************/
+ 
+ 
++#include <sys/stat.h>
+ #include "h4toh5main.h"
+ 
+ /*-------------------------------------------------------------------------
+--- h4h5tools-2.2.5/lib/test/h4toh5test.c.orig	2020-03-10 15:33:18.000000000 +0100
++++ h4h5tools-2.2.5/lib/test/h4toh5test.c	2024-12-22 08:22:32.523258166 +0100
+@@ -16,6 +16,8 @@
+ #include "hdf.h"
+ #include "mfhdf.h"
+ #include <stdio.h>
++#include <stdlib.h>
++#include <string.h>
+ 
+ 
+ #define FILESDS1  "sds_typ_test.hdf"
+--- h4h5tools-2.2.5/lib/test/h4h5apitestadvgroup.c.orig	2020-03-10 15:33:18.000000000 +0100
++++ h4h5tools-2.2.5/lib/test/h4h5apitestadvgroup.c	2024-12-22 08:23:49.379508467 +0100
+@@ -11,6 +11,7 @@
+  * either file, you may request a copy from help at hdfgroup.org.               *
+  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+ 
++#include <stdlib.h>
+ #include "h4toh5.h"
+ #define _HDF_CHK_TBL_CLASST "_HDF_CHK_TBL_"
+ /* There are 12 test cases for h4toh5 library.*/
+--- h4h5tools-2.2.5/lib/test/h4toh5eostest.c.orig	2020-03-10 15:33:18.000000000 +0100
++++ h4h5tools-2.2.5/lib/test/h4toh5eostest.c	2024-12-22 08:24:39.852568364 +0100
+@@ -11,6 +11,8 @@
+  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+ 
+ #ifdef HAVE_LIBHDFEOS
++#include <stdlib.h>
++#include <string.h>
+ #include "hdf.h"
+ #include "mfhdf.h"
+ #include "HdfEosDef.h"
+--- h4h5tools-2.2.5/utils/h4toh5/h4toh5main.c.orig	2024-12-22 08:17:47.414802732 +0100
++++ h4h5tools-2.2.5/utils/h4toh5/h4toh5main.c	2024-12-22 08:25:50.512185568 +0100
+@@ -39,8 +39,10 @@ Author:  Kent Yang(myang6 at hdfgroup.org)
+ #include "h4toh5main.h"
+ #include "h4toh5.h"
+ #ifndef WIN32
++#include <stdlib.h>
+ #include <strings.h>
+ #include <string.h>
++#include <sys/stat.h>
+ #endif
+ 
+ 
diff --git a/h4h5tools-types.patch b/h4h5tools-types.patch
new file mode 100644
index 0000000..d9553ff
--- /dev/null
+++ b/h4h5tools-types.patch
@@ -0,0 +1,20 @@
+--- h4h5tools-2.2.5/lib/src/h4toh5eos.c.orig	2024-12-22 12:09:33.436134014 +0100
++++ h4h5tools-2.2.5/lib/src/h4toh5eos.c	2024-12-22 12:09:36.299451836 +0100
+@@ -725,7 +725,7 @@ static int get_dimension(hid_t h4toh5id,
+  *
+  * @return FAIL if failed, SUCCEED if successful
+  */
+-static int get_fieldinfo(hid_t h4toh5id, int32 id, int32 (*entries)(int32, int32, int32 *), int32 (*inq)(int32, char *, int32 *, int32 *), intn (*fldinfo)(int32, char *, int32 *, int32 *, int32 *, char *), intn (*readfld)(int32, char *, int32 *, int32 *, int32 *, VOIDP), intn (*getfill)(int32, char *, VOIDP), int geofield, fieldinfoalloc *fields)
++static int get_fieldinfo(hid_t h4toh5id, int32 id, int32 (*entries)(int32, int32, int32 *), int32 (*inq)(int32, char *, int32 *, int32 *), intn (*fldinfo)(int32, const char *, int32 *, int32 *, int32 *, char *), intn (*readfld)(int32, const char *, int32 *, int32 *, int32 *, VOIDP), intn (*getfill)(int32, const char *, VOIDP), int geofield, fieldinfoalloc *fields)
+ {
+     char *namelist = NULL;
+     namelistalloc dimnames;
+@@ -824,7 +824,7 @@ static int get_fieldinfo(hid_t h4toh5id,
+  * 
+  * @return FAIL if failed, SUCCEED if successful
+  */
+-static int get_attribute(hid_t h4toh5id, int32 id, int32 (*inq)(int32, char *, int32 *), intn (*attrinfo)(int32, char *, int32 *, int32 *), intn (*readattr)(int32, char *, VOIDP), attributealloc *attrs)
++static int get_attribute(hid_t h4toh5id, int32 id, int32 (*inq)(int32, char *, int32 *), intn (*attrinfo)(int32, const char *, int32 *, int32 *), intn (*readattr)(int32, const char *, VOIDP), attributealloc *attrs)
+ {
+     char *namelist = NULL;
+     int succeeded = 0;
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/h4h5tools.git/commitdiff/dc06eb96e5542f496b975b3f701c906ef988425f



More information about the pld-cvs-commit mailing list