Bug#1134153: saga: FTBFS with GDAL 3.13.0

Bas Couwenberg sebastic at debian.org
Fri Apr 17 06:35:32 BST 2026


Source: saga
Version: 9.9.3+dfsg-1
Severity: important
Tags: upstream ftbfs patch
User: debian-gis at lists.debian.org
Usertags: gdal-3.13

Dear Maintainer,

Your package FTBFS with GDAL 3.13.0:

 error: invalid conversion from 'CSLConstList' {aka 'const char* const*'} to 'char**' [-fpermissive]

>From GDAL 3.13.0 NEWS:

 * GDALMajorObject: Use CSLConstList for GetMetadata, SetMetadata (API breakage)

https://github.com/OSGeo/gdal/blob/v3.13.0beta1/NEWS.md

The attached patch fixes the issue.

Kind Regards,

Bas
-------------- next part --------------
diff -Nru saga-9.9.3+dfsg/debian/patches/gdal-3.13.patch saga-9.9.3+dfsg/debian/patches/gdal-3.13.patch
--- saga-9.9.3+dfsg/debian/patches/gdal-3.13.patch	1970-01-01 01:00:00.000000000 +0100
+++ saga-9.9.3+dfsg/debian/patches/gdal-3.13.patch	2026-04-17 07:04:14.000000000 +0200
@@ -0,0 +1,74 @@
+Description: Fix FTBFS with GDAL 3.13.0.
+ error: invalid conversion from 'CSLConstList' {aka 'const char* const*'} to 'char**' [-fpermissive]
+ .
+ From GDAL 3.13.0 NEWS:
+ "
+  * GDALMajorObject: Use CSLConstList for GetMetadata, SetMetadata (API breakage)
+ "
+Author: Bas Couwenberg <sebastic at debian.org>
+
+--- a/saga-gis/src/tools/io/io_gdal/gdal_driver.cpp
++++ b/saga-gis/src/tools/io/io_gdal/gdal_driver.cpp
+@@ -749,7 +749,11 @@ bool CSG_GDAL_DataSet::Get_MetaData(CSG_
+ {
+ 	if( m_pDataSet && is_Reading() )
+ 	{
+-		char	**pMetaData	= GDALGetMetadata(m_pDataSet, 0);
++#if GDAL_VERSION_NUM >= GDAL_COMPUTE_VERSION(3, 13, 0)
++		CSLConstList	pMetaData	= GDALGetMetadata(m_pDataSet, 0);
++#else
++		*char	**pMetaData	= GDALGetMetadata(m_pDataSet, 0);
++#endif
+ 
+ 		if( pMetaData )
+ 		{
+@@ -777,7 +781,11 @@ bool CSG_GDAL_DataSet::Get_MetaData(CSG_
+ {
+ 	if( m_pDataSet && is_Reading() )
+ 	{
++#if GDAL_VERSION_NUM >= GDAL_COMPUTE_VERSION(3, 13, 0)
++		CSLConstList	pMetaData	= GDALGetMetadata(m_pDataSet, pszDomain);
++#else
+ 		char	**pMetaData	= GDALGetMetadata(m_pDataSet, pszDomain);
++#endif
+ 
+ 		if( pMetaData )
+ 		{
+@@ -895,7 +903,11 @@ CSG_String CSG_GDAL_DataSet::Get_MetaDat
+ 
+ 	GDALRasterBandH	pBand = is_Reading() ? GDALGetRasterBand(m_pDataSet, i + 1) : NULL;
+ 
++#if GDAL_VERSION_NUM >= GDAL_COMPUTE_VERSION(3, 13, 0)
++	CSLConstList pMetaData = pBand ? GDALGetMetadata(pBand, NULL) : NULL;
++#else
+ 	char **pMetaData = pBand ? GDALGetMetadata(pBand, NULL) : NULL;
++#endif
+ 
+ 	if( pMetaData )
+ 	{
+@@ -920,7 +932,11 @@ bool CSG_GDAL_DataSet::Get_MetaData(int
+ {
+ 	GDALRasterBandH	pBand = is_Reading() ? GDALGetRasterBand(m_pDataSet, i + 1) : NULL;
+ 
++#if GDAL_VERSION_NUM >= GDAL_COMPUTE_VERSION(3, 13, 0)
++	CSLConstList pMetaData = pBand ? GDALGetMetadata(pBand, NULL) : NULL;
++#else
+ 	char **pMetaData = pBand ? GDALGetMetadata(pBand, NULL) : NULL;
++#endif
+ 
+ 	if( pMetaData )
+ 	{
+--- a/saga-gis/src/tools/io/io_gdal/ogr_driver.cpp
++++ b/saga-gis/src/tools/io/io_gdal/ogr_driver.cpp
+@@ -546,7 +546,11 @@ CSG_String CSG_OGR_DataSet::Get_Descript
+ 
+ 	if( pLayer != NULL )
+ 	{
++#if GDAL_VERSION_NUM >= GDAL_COMPUTE_VERSION(3, 13, 0)
++		CSLConstList	pMetaData	= GDALGetMetadata(pLayer, 0);
++#else
+ 		char	**pMetaData	= GDALGetMetadata(pLayer, 0);
++#endif
+ 
+ 		if( pMetaData )
+ 		{
diff -Nru saga-9.9.3+dfsg/debian/patches/series saga-9.9.3+dfsg/debian/patches/series
--- saga-9.9.3+dfsg/debian/patches/series	1970-01-01 01:00:00.000000000 +0100
+++ saga-9.9.3+dfsg/debian/patches/series	2026-04-17 07:04:14.000000000 +0200
@@ -0,0 +1 @@
+gdal-3.13.patch


More information about the Pkg-grass-devel mailing list