[Git][debian-gis-team/gdal][master] Add upstream patch to fix FTBFS with HDF 4.4.0. (closes: #1146650)

Bas Couwenberg (@sebastic) gitlab at salsa.debian.org
Fri Sep 4 12:33:44 BST 2026



Bas Couwenberg pushed to branch master at Debian GIS Project / gdal


Commits:
504e08a6 by Bas Couwenberg at 2026-09-04T13:22:59+02:00
Add upstream patch to fix FTBFS with HDF 4.4.0. (closes: #1146650)

- - - - -


3 changed files:

- debian/changelog
- + debian/patches/hdf-4.4.patch
- debian/patches/series


Changes:

=====================================
debian/changelog
=====================================
@@ -1,3 +1,10 @@
+gdal (3.13.3+dfsg-2) UNRELEASED; urgency=medium
+
+  * Add upstream patch to fix FTBFS with HDF 4.4.0.
+    (closes: #1146650)
+
+ -- Bas Couwenberg <sebastic at debian.org>  Fri, 04 Sep 2026 13:22:29 +0200
+
 gdal (3.13.3+dfsg-1) unstable; urgency=medium
 
   * New upstream release.


=====================================
debian/patches/hdf-4.4.patch
=====================================
@@ -0,0 +1,110 @@
+Description: HDF4: fix build against libhdf4 4.4.0dev
+ In https://github.com/HDFGroup/hdf4/issues/909 , the hdf4 team confirmed
+ the change in prototypes were intended.
+ .
+ Tested against https://github.com/HDFGroup/hdf4 at 6f4209bc698019263fc40a477eea4cc32da957c8
+Author: Even Rouault <even.rouault at spatialys.com>
+Origin: https://github.com/OSGeo/gdal/commit/f8633d48ba49219f8d4285405b66949fe64be1f4
+Bug: https://github.com/OSGeo/gdal/issues/15126
+
+--- a/frmts/hdf4/hdf-eos/EHapi.c
++++ b/frmts/hdf4/hdf-eos/EHapi.c
+@@ -20,6 +20,7 @@ this permission notice appear in support
+ #include <limits.h>
+ #include "mfhdf.h"
+ #include "HdfEosDef.h"
++#include "hfile.h"
+ 
+ /* Set maximum number of HDF-EOS files to HDF limit (MAX_FILE) */
+ #define NEOSHDF MAX_FILE
+@@ -2039,8 +2040,12 @@ EHinquire(const char *filename, const ch
+ 	/* ------------------------------ */
+ 	vGrpID = Vattach(HDFfid, vgRef, "r");
+ 	VgetnameSafe(vGrpID, name, sizeof(name));
++#if LIBVER_MAJOR == 4 && LIBVER_MINOR >= 4
++    size_t sz = sizeof(class);
++    Vgetclass(vGrpID, class, &sz);
++#else
+ 	Vgetclass(vGrpID, class);
+-
++#endif
+ 
+ 	/* If object of desired type (SWATH, POINT, GRID) ... */
+ 	/* -------------------------------------------------- */
+--- a/frmts/hdf4/hdf-eos/GDapi.c
++++ b/frmts/hdf4/hdf-eos/GDapi.c
+@@ -90,6 +90,7 @@ Jun  05, 2003 Bruce Beaumont / Abe Taahe
+ #include "hcomp.h"
+ #include <math.h>
+ #include "HdfEosDef.h"
++#include "hfile.h"
+ 
+ #include "hdf4compat.h"
+ 
+@@ -379,8 +380,12 @@ GDattach(int32 fid, const char *gridname
+ 		/* ---------------------------- */
+ 		vgid[0] = Vattach(HDFfid, vgRef, "r");
+ 		VgetnameSafe(vgid[0], name, sizeof(name));
++#if LIBVER_MAJOR == 4 && LIBVER_MINOR >= 4
++        size_t sz = sizeof(class);
++        Vgetclass(vgid[0], class, &sz);
++#else
+ 		Vgetclass(vgid[0], class);
+-
++#endif
+ 
+ 		/*
+ 		 * If Vgroup with gridname and class GRID found, load tables
+--- a/frmts/hdf4/hdf-eos/SWapi.c
++++ b/frmts/hdf4/hdf-eos/SWapi.c
+@@ -79,6 +79,7 @@ June 05, 2003 Abe Taaheri / Bruce Beaumo
+ #include "mfhdf.h"
+ #include "hcomp.h"
+ #include "HdfEosDef.h"
++#include "hfile.h"
+ #include <math.h>
+ 
+ #include "hdf4compat.h"
+@@ -302,8 +303,12 @@ SWattach(int32 fid, const char *swathnam
+ 		/* ---------------------------- */
+ 		vgid[0] = Vattach(HDFfid, vgRef, "r");
+ 		VgetnameSafe(vgid[0], name, sizeof(name));
++#if LIBVER_MAJOR == 4 && LIBVER_MINOR >= 4
++        size_t sz = sizeof(class);
++        Vgetclass(vgid[0], class, &sz);
++#else
+ 		Vgetclass(vgid[0], class);
+-
++#endif
+ 
+ 		/*
+ 		 * If Vgroup with swathname and class SWATH found, load
+--- a/frmts/hdf4/hdf-eos/helper.c
++++ b/frmts/hdf4/hdf-eos/helper.c
+@@ -1,8 +1,20 @@
+ #include "mfhdf.h"
+ #include "HdfEosDef.h"
++#include "hfile.h"
+ 
+ int32 VgetnameSafe(int32 vkey, char *vgname, size_t vgnamesize)
+ {
++#if LIBVER_MAJOR == 4 && LIBVER_MINOR >= 4
++    size_t len = 0;
++    if( Vgetname(vkey, NULL, &len) != SUCCEED ||
++        len >= vgnamesize ||
++        Vgetname(vkey, vgname, &vgnamesize) != SUCCEED)
++    {
++         vgname[0] = 0;
++         return DFE_BADLEN;
++    }
++    return SUCCEED;
++#else
+     uint16 name_len = 0;
+     if (Vgetnamelen(vkey, &name_len) != SUCCEED)
+     {
+@@ -15,4 +27,5 @@ int32 VgetnameSafe(int32 vkey, char *vgn
+          return DFE_BADLEN;
+     }
+     return Vgetname(vkey, vgname);
++#endif
+ }


=====================================
debian/patches/series
=====================================
@@ -1,2 +1,3 @@
 repack.patch
 pip-install.patch
+hdf-4.4.patch



View it on GitLab: https://salsa.debian.org/debian-gis-team/gdal/-/commit/504e08a614ff1f720e855e46d33692ec418e2907

-- 
View it on GitLab: https://salsa.debian.org/debian-gis-team/gdal/-/commit/504e08a614ff1f720e855e46d33692ec418e2907
You're receiving this email because of your account on salsa.debian.org. Manage all notifications: https://salsa.debian.org/-/profile/notifications | Help: https://salsa.debian.org/help


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-grass-devel/attachments/20260904/67f1bc92/attachment-0001.htm>


More information about the Pkg-grass-devel mailing list