Package: src:scilab
Version: 5.5.2-2
Severity: important
Tags: patch

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Hi,

Please find attached a patch to support building against HDF5-1.10 currently in 
experimental. This patch partly comes from upstream ticket #14539 [1].

[1] https://bugzilla.scilab.org/show_bug.cgi?id=14539

I intend to request a transition slot this week, and will upload if need be, as 
member of the Debian Science team.

Thanks,

_g.

- -- System Information:
Debian Release: stretch/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.6.0-1-amd64 (SMP w/2 CPU cores)
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

-----BEGIN PGP SIGNATURE-----

iQEcBAEBCAAGBQJYDnitAAoJEO/obGx//s+DO0wIALLEK4eTLTT0hK1wVPA9p/Hx
bBWmn79jYXyyic83vN7C3ZlQ7WHBmXU+bLNFQGw+DwIn5dKmd/a5/55jqcp5BFoG
7zhOsU4tb0ro21zvbNcMjgJbt/Ilvf3xPq6fN6QNpQqDmtuIuGX8vVVbbMFp3y7i
PBIX+bE7xfwWRzhhjXMGRRdoZ6wKHyxIEmp92OLBKkr8EvOft4Dmj2Z2BvmOyi0/
Uc6xVOEC+TlAguVtSevewX+gBACbEiBQyf05snIRQV1DA5ntRKMhiZy5iGZLE4gP
zzdMiRZInBYUCo7oNa1xVl+czE+qyL0F+/HpWQPD9qik4l45297NVGmsdgnohrY=
=T6xH
-----END PGP SIGNATURE-----
diff -Nru scilab-5.5.2/debian/changelog scilab-5.5.2/debian/changelog
--- scilab-5.5.2/debian/changelog	2015-10-30 10:22:41.000000000 +0100
+++ scilab-5.5.2/debian/changelog	2016-10-22 15:54:38.000000000 +0200
@@ -1,3 +1,9 @@
+scilab (5.5.2-3) unstable; urgency=medium
+
+  * New patch to support HDF5-1.10
+
+ -- Gilles Filippini <p...@debian.org>  Sat, 22 Oct 2016 15:54:20 +0200
+
 scilab (5.5.2-2) unstable; urgency=medium
 
   * Team upload.
diff -Nru scilab-5.5.2/debian/patches/hdf5-1.10-api.patch scilab-5.5.2/debian/patches/hdf5-1.10-api.patch
--- scilab-5.5.2/debian/patches/hdf5-1.10-api.patch	1970-01-01 01:00:00.000000000 +0100
+++ scilab-5.5.2/debian/patches/hdf5-1.10-api.patch	2016-10-24 21:14:57.000000000 +0200
@@ -0,0 +1,331 @@
+Index: scilab-5.5.2/m4/hdf5.m4
+===================================================================
+--- scilab-5.5.2.orig/m4/hdf5.m4
++++ scilab-5.5.2/m4/hdf5.m4
+@@ -65,6 +65,11 @@ if test "x$with_hdf5_library" != "xyes";
+             [AC_MSG_ERROR([libhdf5 or libhdf5_hl: library missing. (Cannot find symbol H5Fopen) in $with_hdf5_library. Check if libhdf5 is installed and if the version is correct])],
+             [-lz]
+             )
++    AC_CHECK_LIB([hdf5], [H5Rdereference2],
++            [FORCE_HDF_1_10_API="-DH5Rdereference_vers=2"],
++            [],
++            [-lz]
++            )
+ else
+     if $WITH_DEVTOOLS; then # Scilab thirparties
+         HDF5_LIBS="-L$DEVTOOLS_LIBDIR -lhdf5 -lhdf5_hl"
+@@ -93,6 +98,7 @@ LIBS="$save_LIBS"
+ 
+ AC_SUBST(HDF5_LIBS)
+ AC_SUBST(HDF5_CFLAGS)
++AC_SUBST(FORCE_HDF_1_10_API)
+ 
+ AC_DEFINE([WITH_HDF5], [], [With the HDF5 library])
+ 
+Index: scilab-5.5.2/modules/hdf5/Makefile.am
+===================================================================
+--- scilab-5.5.2.orig/modules/hdf5/Makefile.am
++++ scilab-5.5.2/modules/hdf5/Makefile.am
+@@ -86,6 +86,8 @@ FORCE_HDF_1.8_API =  -DH5Dopen_vers=2 -D
+  -DH5Gcreate_vers=2 -DH5Gopen_vers=2 -DH5Tget_array_dims_vers=2 \
+  -DH5Acreate_vers=2 -DNO_DEPRECATED_SYMBOLS
+ 
++FORCE_HDF_1.10_API = @FORCE_HDF_1_10_API@
++
+ libscihdf5_la_CPPFLAGS = -I$(srcdir)/includes/ \
+ 				-I$(srcdir)/src/c/ \
+ 				-I$(srcdir)/src/cpp/ \
+@@ -98,7 +100,8 @@ libscihdf5_la_CPPFLAGS = -I$(srcdir)/inc
+ 				$(JAVA_JNI_INCLUDE) \
+ 				$(HDF5_CFLAGS) \
+ 				$(AM_CPPFLAGS) \
+-				$(FORCE_HDF_1.8_API)
++				$(FORCE_HDF_1.8_API) \
++				$(FORCE_HDF_1.10_API)
+ 
+ 
+ 
+Index: scilab-5.5.2/modules/hdf5/src/c/h5_readDataFromFile.c
+===================================================================
+--- scilab-5.5.2.orig/modules/hdf5/src/c/h5_readDataFromFile.c
++++ scilab-5.5.2/modules/hdf5/src/c/h5_readDataFromFile.c
+@@ -716,7 +716,11 @@ int readCommonPolyMatrix(int _iDatasetId
+         /*
+          * Open the referenced object, get its name and type.
+          */
+-        obj = H5Rdereference(_iDatasetId, H5R_OBJECT, &pData[i]);
++        obj = H5Rdereference(_iDatasetId,
++    #if H5_VERSION_GE(1,10,0)
++                             H5P_DATASET_ACCESS_DEFAULT,
++    #endif
++                             H5R_OBJECT, &pData[i]);
+         if (_iComplex)
+         {
+             status = readComplexPoly(obj, &_piNbCoef[i], &_pdblReal[i], &_pdblImg[i]);
+@@ -950,7 +954,11 @@ int readCommonSparseComplexMatrix(int _i
+     }
+ 
+     //read Row data
+-    obj = H5Rdereference(_iDatasetId, H5R_OBJECT, &pRef[0]);
++    obj = H5Rdereference(_iDatasetId,
++#if H5_VERSION_GE(1,10,0)
++                         H5P_DATASET_ACCESS_DEFAULT,
++#endif
++                         H5R_OBJECT, &pRef[0]);
+     status = readInteger32Matrix(obj, _piNbItemRow);
+     if (status < 0)
+     {
+@@ -958,7 +966,11 @@ int readCommonSparseComplexMatrix(int _i
+     }
+ 
+     //read cols data
+-    obj = H5Rdereference(_iDatasetId, H5R_OBJECT, &pRef[1]);
++    obj = H5Rdereference(_iDatasetId,
++#if H5_VERSION_GE(1,10,0)
++                         H5P_DATASET_ACCESS_DEFAULT,
++#endif
++                         H5R_OBJECT, &pRef[1]);
+     status = readInteger32Matrix(obj, _piColPos);
+     if (status < 0)
+     {
+@@ -966,7 +978,11 @@ int readCommonSparseComplexMatrix(int _i
+     }
+ 
+     //read sparse data
+-    obj = H5Rdereference(_iDatasetId, H5R_OBJECT, &pRef[2]);
++    obj = H5Rdereference(_iDatasetId,
++#if H5_VERSION_GE(1,10,0)
++                         H5P_DATASET_ACCESS_DEFAULT,
++#endif
++                         H5R_OBJECT, &pRef[2]);
+ 
+     if (_iComplex)
+     {
+@@ -1017,7 +1033,11 @@ int readBooleanSparseMatrix(int _iDatase
+     }
+ 
+     //read Row data
+-    obj = H5Rdereference(_iDatasetId, H5R_OBJECT, &pRef[0]);
++    obj = H5Rdereference(_iDatasetId,
++#if H5_VERSION_GE(1,10,0)
++                         H5P_DATASET_ACCESS_DEFAULT,
++#endif
++                         H5R_OBJECT, &pRef[0]);
+     status = readInteger32Matrix(obj, _piNbItemRow);
+     if (status < 0)
+     {
+@@ -1027,7 +1047,11 @@ int readBooleanSparseMatrix(int _iDatase
+     if (_iNbItem != 0)
+     {
+         //read cols data
+-        obj = H5Rdereference(_iDatasetId, H5R_OBJECT, &pRef[1]);
++        obj = H5Rdereference(_iDatasetId,
++    #if H5_VERSION_GE(1,10,0)
++                             H5P_DATASET_ACCESS_DEFAULT,
++    #endif
++                             H5R_OBJECT, &pRef[1]);
+         status = readInteger32Matrix(obj, _piColPos);
+         if (status < 0)
+         {
+@@ -1132,7 +1156,11 @@ int getListItemDataset(int _iDatasetId,
+ {
+     hobj_ref_t poRef = ((hobj_ref_t *) _piItemRef)[_iItemPos];
+ 
+-    *_piItemDataset = H5Rdereference(_iDatasetId, H5R_OBJECT, &poRef);
++    *_piItemDataset = H5Rdereference(_iDatasetId,
++#if H5_VERSION_GE(1,10,0)
++                                     H5P_DATASET_ACCESS_DEFAULT,
++#endif
++                                     H5R_OBJECT, &poRef);
+ 
+     if (*_piItemDataset == 0)
+     {
+Index: scilab-5.5.2/modules/hdf5/src/c/h5_readDataFromFile_v1.c
+===================================================================
+--- scilab-5.5.2.orig/modules/hdf5/src/c/h5_readDataFromFile_v1.c
++++ scilab-5.5.2/modules/hdf5/src/c/h5_readDataFromFile_v1.c
+@@ -471,7 +471,11 @@ int readDoubleMatrix_v1(int _iDatasetId,
+         }
+ 
+         //Open the referenced object, get its name and type.
+-        obj = H5Rdereference(_iDatasetId, H5R_OBJECT, &Ref);
++        obj = H5Rdereference(_iDatasetId,
++    #if H5_VERSION_GE(1,10,0)
++                             H5P_DATASET_ACCESS_DEFAULT,
++    #endif
++                             H5R_OBJECT, &Ref);
+         readDouble_v1(obj, _iRows, _iCols, _pdblData);
+     }
+ 
+@@ -498,14 +502,22 @@ int readDoubleComplexMatrix_v1(int _iDat
+     }
+ 
+     //Open the referenced object, get its name and type.
+-    obj = H5Rdereference(_iDatasetId, H5R_OBJECT, &pRef[0]);
++    obj = H5Rdereference(_iDatasetId,
++#if H5_VERSION_GE(1,10,0)
++                         H5P_DATASET_ACCESS_DEFAULT,
++#endif
++                         H5R_OBJECT, &pRef[0]);
+     status = readDouble_v1(obj, _iRows, _iCols, _pdblReal);
+     if (status < 0)
+     {
+         return -1;
+     }
+ 
+-    obj = H5Rdereference(_iDatasetId, H5R_OBJECT, &pRef[1]);
++    obj = H5Rdereference(_iDatasetId,
++#if H5_VERSION_GE(1,10,0)
++                         H5P_DATASET_ACCESS_DEFAULT,
++#endif
++                         H5R_OBJECT, &pRef[1]);
+     status = readDouble_v1(obj, _iRows, _iCols, _pdblImg);
+     if (status < 0)
+     {
+@@ -831,7 +843,11 @@ int readCommonPolyMatrix_v1(int _iDatase
+         /*
+         * Open the referenced object, get its name and type.
+         */
+-        obj = H5Rdereference(_iDatasetId, H5R_OBJECT, &pData[i]);
++        obj = H5Rdereference(_iDatasetId,
++    #if H5_VERSION_GE(1,10,0)
++                             H5P_DATASET_ACCESS_DEFAULT,
++    #endif
++                             H5R_OBJECT, &pData[i]);
+         if (_iComplex)
+         {
+             status = readComplexPoly_v1(obj, &_piNbCoef[i], &_pdblReal[i], &_pdblImg[i]);
+@@ -1066,7 +1082,11 @@ int readCommonSparseComplexMatrix_v1(int
+     }
+ 
+     //read Row data
+-    obj = H5Rdereference(_iDatasetId, H5R_OBJECT, &pRef[0]);
++    obj = H5Rdereference(_iDatasetId,
++#if H5_VERSION_GE(1,10,0)
++                         H5P_DATASET_ACCESS_DEFAULT,
++#endif
++                         H5R_OBJECT, &pRef[0]);
+     status = readInteger32Matrix_v1(obj, 1, _iRows, _piNbItemRow);
+     if (status < 0)
+     {
+@@ -1074,7 +1094,11 @@ int readCommonSparseComplexMatrix_v1(int
+     }
+ 
+     //read cols data
+-    obj = H5Rdereference(_iDatasetId, H5R_OBJECT, &pRef[1]);
++    obj = H5Rdereference(_iDatasetId,
++#if H5_VERSION_GE(1,10,0)
++                         H5P_DATASET_ACCESS_DEFAULT,
++#endif
++                         H5R_OBJECT, &pRef[1]);
+     status = readInteger32Matrix_v1(obj, 1, _iNbItem, _piColPos);
+     if (status < 0)
+     {
+@@ -1082,7 +1106,11 @@ int readCommonSparseComplexMatrix_v1(int
+     }
+ 
+     //read sparse data
+-    obj = H5Rdereference(_iDatasetId, H5R_OBJECT, &pRef[2]);
++    obj = H5Rdereference(_iDatasetId,
++#if H5_VERSION_GE(1,10,0)
++                         H5P_DATASET_ACCESS_DEFAULT,
++#endif
++                         H5R_OBJECT, &pRef[2]);
+ 
+     if (_iComplex)
+     {
+@@ -1128,7 +1156,11 @@ int readBooleanSparseMatrix_v1(int _iDat
+     }
+ 
+     //read Row data
+-    obj = H5Rdereference(_iDatasetId, H5R_OBJECT, &pRef[0]);
++    obj = H5Rdereference(_iDatasetId,
++#if H5_VERSION_GE(1,10,0)
++                         H5P_DATASET_ACCESS_DEFAULT,
++#endif
++                         H5R_OBJECT, &pRef[0]);
+     status = readInteger32Matrix_v1(obj, 1, _iRows, _piNbItemRow);
+     if (status < 0)
+     {
+@@ -1136,7 +1168,11 @@ int readBooleanSparseMatrix_v1(int _iDat
+     }
+ 
+     //read cols data
+-    obj = H5Rdereference(_iDatasetId, H5R_OBJECT, &pRef[1]);
++    obj = H5Rdereference(_iDatasetId,
++#if H5_VERSION_GE(1,10,0)
++                         H5P_DATASET_ACCESS_DEFAULT,
++#endif
++                         H5R_OBJECT, &pRef[1]);
+     status = readInteger32Matrix_v1(obj, 1, _iNbItem, _piColPos);
+     if (status < 0)
+     {
+@@ -1235,7 +1271,11 @@ int getListItemDataset_v1(int _iDatasetI
+ {
+     hobj_ref_t poRef = ((hobj_ref_t *) _piItemRef)[_iItemPos];
+ 
+-    *_piItemDataset = H5Rdereference(_iDatasetId, H5R_OBJECT, &poRef);
++    *_piItemDataset = H5Rdereference(_iDatasetId,
++#if H5_VERSION_GE(1,10,0)
++                                     H5P_DATASET_ACCESS_DEFAULT,
++#endif
++                                     H5R_OBJECT, &poRef);
+ 
+     if (*_piItemDataset == 0)
+     {
+Index: scilab-5.5.2/modules/hdf5/src/cpp/H5ReferenceData.cpp
+===================================================================
+--- scilab-5.5.2.orig/modules/hdf5/src/cpp/H5ReferenceData.cpp
++++ scilab-5.5.2/modules/hdf5/src/cpp/H5ReferenceData.cpp
+@@ -39,7 +39,11 @@ const char ** H5ReferenceData::getRefere
+     for (int i = 0; i < totalSize; i++)
+     {
+         void * ref = &(((void **)cdata)[i]);
+-        hid_t obj = H5Rdereference(file, datasetReference ? H5R_DATASET_REGION : H5R_OBJECT, ref);
++        hid_t obj = H5Rdereference(file,
++    #if H5_VERSION_GE(1,10,0)
++                                   H5P_DATASET_ACCESS_DEFAULT,
++    #endif
++                                   datasetReference ? H5R_DATASET_REGION : H5R_OBJECT, ref);
+         H5O_info_t info;
+         H5Oget_info(obj, &info);
+         H5Oclose(obj);
+@@ -81,7 +85,11 @@ H5Object & H5ReferenceData::getData(cons
+ 
+     file = getFile().getH5Id();
+     ref = &(((void **)cdata)[0]);
+-    obj = H5Rdereference(file, datasetReference ? H5R_DATASET_REGION : H5R_OBJECT, ref);
++    obj = H5Rdereference(file,
++#if H5_VERSION_GE(1,10,0)
++                         H5P_DATASET_ACCESS_DEFAULT,
++#endif
++                         datasetReference ? H5R_DATASET_REGION : H5R_OBJECT, ref);
+     if (obj < 0)
+     {
+         throw H5Exception(__LINE__, __FILE__, _("Cannot open object at the given position."));
+@@ -123,7 +131,11 @@ H5Object ** H5ReferenceData::getReferenc
+     for (int i = 0; i < totalSize; i++)
+     {
+         void * ref = &(((void **)cdata)[i]);
+-        hid_t obj = H5Rdereference(file, datasetReference ? H5R_DATASET_REGION : H5R_OBJECT, ref);
++        hid_t obj = H5Rdereference(file,
++    #if H5_VERSION_GE(1,10,0)
++                                   H5P_DATASET_ACCESS_DEFAULT,
++    #endif
++                                   datasetReference ? H5R_DATASET_REGION : H5R_OBJECT, ref);
+         objs[i] = &H5Object::getObject(getParent(), obj);
+     }
+ 
+@@ -178,7 +190,11 @@ void H5ReferenceData::printData(std::ost
+     char * cdata = static_cast<char *>(data) + offset + pos * (stride ? stride : dataSize);
+     void ** ref = &(((void **)cdata)[0]);
+     hid_t file = getFile().getH5Id();
+-    hid_t obj = H5Rdereference(file, datasetReference ? H5R_DATASET_REGION : H5R_OBJECT, ref);
++    hid_t obj = H5Rdereference(file,
++#if H5_VERSION_GE(1,10,0)
++                               H5P_DATASET_ACCESS_DEFAULT,
++#endif
++                               datasetReference ? H5R_DATASET_REGION : H5R_OBJECT, ref);
+     if (obj < 0)
+     {
+         os << "NULL";
diff -Nru scilab-5.5.2/debian/patches/series scilab-5.5.2/debian/patches/series
--- scilab-5.5.2/debian/patches/series	2015-10-18 22:53:53.000000000 +0200
+++ scilab-5.5.2/debian/patches/series	2016-10-24 21:08:16.000000000 +0200
@@ -11,3 +11,4 @@
 jvm-archdir-ppc64le.diff
 aarch64-detection.patch
 libjogl2-java-2.3.2.diff
+hdf5-1.10-api.patch

Reply via email to