From e646b4c16459211af04fa19301f98ac40460a239 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= Date: Tue, 11 Feb 2025 21:29:29 -0300 Subject: [PATCH] med: rebuild for hdf5 --- srcpkgs/med/patches/hdf5-1.14.patch | 99 ++++++++++++++++++++++++++ srcpkgs/med/patches/hdf5-version.patch | 17 +++++ srcpkgs/med/template | 3 +- 3 files changed, 118 insertions(+), 1 deletion(-) create mode 100644 srcpkgs/med/patches/hdf5-1.14.patch create mode 100644 srcpkgs/med/patches/hdf5-version.patch diff --git a/srcpkgs/med/patches/hdf5-1.14.patch b/srcpkgs/med/patches/hdf5-1.14.patch new file mode 100644 index 00000000000..4d72add6b9f --- /dev/null +++ b/srcpkgs/med/patches/hdf5-1.14.patch @@ -0,0 +1,99 @@ +https://salsa.debian.org/science-team/med-fichier/-/blob/master/debian/patches/hdf5-1.14.patch + +Index: med-fichier/config/med_check_hdf5.m4 +=================================================================== +--- med-fichier.orig/config/med_check_hdf5.m4 ++++ med-fichier/config/med_check_hdf5.m4 +@@ -134,12 +134,6 @@ AC_REQUIRE([AC_PROG_GREP]) + H5_VER_MINOR=` grep '#define *H5_VERS_MINOR' $HDF5_ABS_PATH | sed 's/^.*H5_VERS_MINOR[ \t]*\([0-9]*\)[ \t]*.*$/\1/g' ` + H5_VER_RELEASE=`grep '#define *H5_VERS_RELEASE' $HDF5_ABS_PATH | sed 's/^.*H5_VERS_RELEASE[ \t]*\([0-9]*\)[ \t]*.*$/\1/g' ` + HDF5_VERSION=` expr 10000 \* ${H5_VER_MAJOR} + 100 \* ${H5_VER_MINOR} + ${H5_VER_RELEASE} ` +- test "0${HDF5_VERSION}" -gt "11100" || test "0${HDF5_VERSION}" -lt "11002" && AC_MSG_ERROR([ +-This HDF5 version ${H5_VER_MAJOR}.${H5_VER_MINOR}.${H5_VER_RELEASE} must not be used with med-fichier${MED_NUM_MAJEUR}.${MED_NUM_MINEUR}.${MED_NUM_RELEASE}. +-The HDF5 library version used by med-fichier${MED_NUM_MAJEUR}.y.z MUST NOT be > 1.10 and have to be at least HDF${HDF_VERSION_REF}. +-DO NOT TRY TO COMPILE med-fichier${MED_NUM_MAJEUR}.${MED_NUM_MINEUR}.${MED_NUM_RELEASE} version with an HDF5 library which would generate an hdf5 file not compliant with HDF5-${HDF_VERSION_MAJOR_REF}.${HDF_VERSION_MINOR_REF}.z library. +-This would BREAK med-fichier compatibility between files with the same revision number ! +- ]) + else + ## In case user explicitly ask to not use hdf5 ! + AC_MSG_WARN([Can't compile MED without hdf5]) +Index: med-fichier/src/ci/MEDfileCompatibility.c +=================================================================== +--- med-fichier.orig/src/ci/MEDfileCompatibility.c ++++ med-fichier/src/ci/MEDfileCompatibility.c +@@ -15,7 +15,6 @@ + * along with MED. If not, see . + */ + +- + #include + #include + #include +@@ -71,7 +70,7 @@ MEDfileCompatibility(const char* const f + _hversionMMR=10000*_hmajeur+100*_hmineur+_hrelease; + /* ISCRUTE(_hversionMMR); */ + /* ISCRUTE(HDF_VERSION_NUM_REF); */ +- if ( (_hversionMMR >= HDF_VERSION_NUM_REF) && (_hmineur == HDF_VERSION_MINOR_REF) ) *hdfok = MED_TRUE; ++ if ( (_hversionMMR >= HDF_VERSION_NUM_REF) && (_hmineur >= HDF_VERSION_MINOR_REF) ) *hdfok = MED_TRUE; + + /* TODO : Vérifier si la version mineure HDF du fichier est supérieure + à la version mineure de la bibliothèque HDF utilisée : +@@ -114,8 +113,8 @@ MEDfileCompatibility(const char* const f + #error "Don't forget to update the test version here when you change the major version of the library !" + #endif + #if H5_VERS_MINOR > 10 +-#error "Don't forget to check the compatibility version of the library, depending on the internal hdf model choice !" +-#error "Cf. _MEDfileCreate ..." ++#warning "Don't forget to check the compatibility version of the library, depending on the internal hdf model choice !" ++#warning "Cf. _MEDfileCreate ..." + #endif + + SORTIE: +Index: med-fichier/src/hdfi/_MEDfileCreate.c +=================================================================== +--- med-fichier.orig/src/hdfi/_MEDfileCreate.c ++++ med-fichier/src/hdfi/_MEDfileCreate.c +@@ -132,7 +132,7 @@ med_idt _MEDfileCreate(const char * cons + { + case 0: _release = MED_40_LATEST_RELEASE; break; + #if (MED_NUM_MINEUR == 0) && (MED_NUM_RELEASE > 1) +-#error "Don't forget to change the value of MED_40_LATEST_RELEASE when you change the release of version 4.0 of the library !" ++#warning "Don't forget to change the value of MED_40_LATEST_RELEASE when you change the release of version 4.0 of the library !" + #endif + /* case 1: _release = 0; break; */ + /* case 2: _release = 1; break; */ +@@ -160,7 +160,7 @@ med_idt _MEDfileCreate(const char * cons + * Un test autoconf permet de fixer un intervalle de version HDF à MED. + */ + #if H5_VERS_MINOR > 10 +-#error "Don't forget to change the compatibility version of the library !" ++#warning "Don't forget to change the compatibility version of the library !" + #endif + + if ( H5Pset_libver_bounds( _fapl, H5F_LIBVER_18, H5F_LIBVER_18 ) ) { +Index: med-fichier/src/hdfi/_MEDfileOpen.c +=================================================================== +--- med-fichier.orig/src/hdfi/_MEDfileOpen.c ++++ med-fichier/src/hdfi/_MEDfileOpen.c +@@ -73,7 +73,7 @@ med_idt _MEDfileOpen(const char * const + • The creation order tracking property, H5P_CRT_ORDER_TRACKED, has been set in the group creation property list (see H5Pset_link_creation_order). + */ + #if H5_VERS_MINOR > 10 +-#error "Don't forget to change the compatibility version of the library !" ++#warning "Don't forget to change the compatibility version of the library !" + #endif + /* L'avantage de bloquer le modèle interne HDF5 + est que l'on peut modifier des fichiers med de différentes versions majeures de fichiers. +Index: med-fichier/src/hdfi/_MEDmemFileOpen.c +=================================================================== +--- med-fichier.orig/src/hdfi/_MEDmemFileOpen.c ++++ med-fichier/src/hdfi/_MEDmemFileOpen.c +@@ -435,7 +435,7 @@ med_idt _MEDmemFileOpen(const char * con + } + + #if H5_VERS_MINOR > 10 +-#error "Don't forget to change the compatibility version of the library !" ++#warning "Don't forget to change the compatibility version of the library !" + #endif + if ( H5Pset_libver_bounds( _fapl, H5F_LIBVER_18, H5F_LIBVER_18) ) { + MED_ERR_(_fid,MED_ERR_INIT,MED_ERR_PROPERTY,MED_ERR_FILEVERSION_MSG); diff --git a/srcpkgs/med/patches/hdf5-version.patch b/srcpkgs/med/patches/hdf5-version.patch new file mode 100644 index 00000000000..36db2c66899 --- /dev/null +++ b/srcpkgs/med/patches/hdf5-version.patch @@ -0,0 +1,17 @@ +Don't complain on hdf5, it works with hdf5 1.14 using `-DH5_USE_110_API=1` + +--- a/config/cmake_files/medMacros.cmake ++++ b/config/cmake_files/medMacros.cmake +@@ -447,9 +447,9 @@ + ## + ## Requires 1.10.x version + ## +- IF (NOT HDF_VERSION_MAJOR_REF EQUAL 1 OR NOT HDF_VERSION_MINOR_REF EQUAL 10 OR NOT HDF_VERSION_RELEASE_REF GREATER 1) +- MESSAGE(FATAL_ERROR "HDF5 version is ${HDF_VERSION_REF}. Only versions >= 1.10.2 are supported.") +- ENDIF() ++ # IF (NOT HDF_VERSION_MAJOR_REF EQUAL 1 OR NOT HDF_VERSION_MINOR_REF EQUAL 10 OR NOT HDF_VERSION_RELEASE_REF GREATER 1) ++ # MESSAGE(FATAL_ERROR "HDF5 version is ${HDF_VERSION_REF}. Only versions >= 1.10.2 are supported.") ++ # ENDIF() + ## + ## + diff --git a/srcpkgs/med/template b/srcpkgs/med/template index cc553adb493..85151578d68 100644 --- a/srcpkgs/med/template +++ b/srcpkgs/med/template @@ -14,7 +14,8 @@ homepage="https://www.salome-platform.org" distfiles="https://github.com/chennes/med/archive/v${version}.tar.gz" checksum=ee8b3b6d46bfee25c1d289308b16c7f248d1339161fd5448339382125e6119ad -nocross="hdf5 is nocross" +# uses hdf5 old api +CFLAGS+=" -DH5_USE_110_API=1" post_extract() { # The py-compile helper uses the imp module, removed in Python 3.12;