[med-svn] [Git][med-team/libsis-jhdf5-java][master] 7 commits: Refresh patch use_debian_packaged_libs.patch
Pierre Gruet
gitlab at salsa.debian.org
Tue Apr 28 21:22:45 BST 2020
Pierre Gruet pushed to branch master at Debian Med / libsis-jhdf5-java
Commits:
1d0ed0a2 by Pierre Gruet at 2020-04-26T15:37:23+02:00
Refresh patch use_debian_packaged_libs.patch
- - - - -
36e4b8f7 by Pierre Gruet at 2020-04-26T15:38:49+02:00
Providing a patch to get around using private header from hdf5
- - - - -
6124adf1 by Pierre Gruet at 2020-04-26T15:40:44+02:00
Fixing omissions linked to prototypes in source/c/jni/h5util.h
- - - - -
fe78685d by Pierre Gruet at 2020-04-28T16:42:32+02:00
Installing the .so file in the -jni package
- - - - -
5123f22e by Pierre Gruet at 2020-04-28T16:43:57+02:00
Updating packages that are needed for building
- - - - -
186c9b40 by Pierre Gruet at 2020-04-28T16:44:37+02:00
Correcting the override of dh_auto_build
Changing the CLASSPATH and TESTCLASSPATH in debian/rules allow to build.
Meanwhile, debian/libsis-jhdf5-java.manifest must list another jar.
- - - - -
17111b58 by Pierre Gruet at 2020-04-28T16:49:07+02:00
Writing tentative tests in debian/tests
This is upstream-provided test series, something is wrong because of a link to
the jni that cannot be done.
- - - - -
10 changed files:
- debian/control
- debian/libsis-jhdf5-java.manifest
- debian/libsis-jhdf5-jni.install
- + debian/patches/avoid_using_private_hdf5_header.patch
- debian/patches/series
- debian/patches/use_debian_packaged_libs.patch
- + debian/patches/using_h5util_definitions.patch
- debian/rules
- + debian/tests/control
- + debian/tests/providedTests
Changes:
=====================================
debian/control
=====================================
@@ -10,7 +10,7 @@ Build-Depends: debhelper-compat (= 12),
javahelper,
gradle-debian-helper,
ant,
- libcommons-lang-java,
+ libcommons-lang3-java,
libcommons-io-java,
libecj-java,
libjaxb-java,
@@ -21,7 +21,8 @@ Build-Depends: debhelper-compat (= 12),
testng,
libhamcrest-java,
libjmock2-java,
- libobjenesis-java
+ libobjenesis-java,
+ libhdf5-java <!nocheck>
Standards-Version: 4.5.0
Vcs-Browser: https://salsa.debian.org/med-team/libsis-jhdf5-java
Vcs-Git: https://salsa.debian.org/med-team/libsis-jhdf5-java.git
=====================================
debian/libsis-jhdf5-java.manifest
=====================================
@@ -1,2 +1,2 @@
usr/share/java/sis-jhdf5.jar:
- Class-Path: commons-lang3.jar commons-io.jar sis-base.jar args4j.jar
+ Class-Path: commons-lang3.jar commons-io.jar sis-base.jar args4j.jar jarhdf5.jar
=====================================
debian/libsis-jhdf5-jni.install
=====================================
@@ -1 +1 @@
-# source/c/*.so /usr/lib/jni
+source/c/*.so /usr/lib/jni
=====================================
debian/patches/avoid_using_private_hdf5_header.patch
=====================================
@@ -0,0 +1,62 @@
+Description: avoid using the header H5private.h of hdf5, which is not shipped
+Author: Pierre Gruet <pgtdebian at free.fr>
+Last-Update: 2020-04-26
+
+--- a/source/c/jni/h5jni.h
++++ b/source/c/jni/h5jni.h
+@@ -20,7 +20,54 @@
+ #include <jni.h>
+ #include "H5version.h"
+ #include <string.h>
+-#include "H5private.h"
++
++#ifndef HDmemset
++ #define HDmemset(X,C,Z) memset(X,C,Z)
++#endif /* HDmemset */
++#ifndef HDmemcpy
++ #define HDmemcpy(X,Y,Z) memcpy((char*)(X),(const char*)(Y),Z)
++#endif /* HDmemcpy */
++#ifndef HDmalloc
++ #define HDmalloc(Z) malloc(Z)
++#endif /* HDmalloc */
++#ifndef HDcalloc
++ #define HDcalloc(N,Z) calloc(N,Z)
++#endif /* HDcalloc */
++#ifndef HDstrcpy
++ #define HDstrcpy(X,Y) strcpy(X,Y)
++#endif /* HDstrcpy */
++#ifndef HDstrncpy
++ #define HDstrncpy(X,Y,Z) strncpy(X,Y,Z)
++#endif /* HDstrncpy */
++#ifndef HDfree
++ #define HDfree(M) free(M)
++#endif /* HDfree */
++#ifndef HDstrlen
++ #define HDstrlen(S) strlen(S)
++#endif /* HDstrlen */
++#ifndef HDstrcat
++ #define HDstrcat(X,Y) strcat(X,Y)
++#endif /* HDstrcat */
++#ifndef HDstrtok
++ #define HDstrtok(X,Y) strtok(X,Y)
++#endif /* HDstrtok */
++#ifndef HDfopen
++ #define HDfopen(S,M) fopen(S,M)
++#endif /* HDfopen */
++#ifndef HDfclose
++ #define HDfclose(F) fclose(F)
++#endif /* HDfclose */
++
++/*
++ * HDF Boolean type.
++ */
++#ifndef FALSE
++ #define FALSE false
++#endif
++#ifndef TRUE
++ #define TRUE true
++#endif
++
+
+ #ifndef _Included_h5jni
+ #define _Included_h5jni
=====================================
debian/patches/series
=====================================
@@ -1,2 +1,4 @@
use_debian_packaged_libs.patch
use_jaxb.patch
+avoid_using_private_hdf5_header.patch
+using_h5util_definitions.patch
=====================================
debian/patches/use_debian_packaged_libs.patch
=====================================
@@ -19,8 +19,8 @@ Description: Use Debian packaged jars
- <classpathentry kind="lib" path="libs/build/ecj-4.6.1.jar"/>
- <classpathentry kind="lib" path="libs/prod/commons-lang3-3.7.jar" sourcepath="libs/prod/commons-lang3-3.7-sources.jar"/>
- <classpathentry kind="lib" path="libs/prod/commons-io-2.6.jar" sourcepath="libs/prod/commons-io-2.6-sources.jar"/>
-- <classpathentry kind="lib" path="libs/prod/sis-base-18.09-pre1.jar" sourcepath="libs/prod/sis-base-18.09-pre1-sources.jar"/>
- <classpathentry kind="lib" path="libs/prod/args4j-2.33.jar"/>
+- <classpathentry kind="lib" path="libs/prod/sis-base-18.09.0.jar" sourcepath="libs/prod/sis-base-18.09.0-sources.jar"/>
+ <classpathentry kind="lib" path="/usr/share/java/hamcrest-core.jar"/>
+ <classpathentry kind="lib" path="/usr/share/java/hamcrest-integration.jar"/>
+ <classpathentry kind="lib" path="/usr/share/java/hamcrest-library.jar"/>
=====================================
debian/patches/using_h5util_definitions.patch
=====================================
@@ -0,0 +1,29 @@
+Description: using definitions of source/c/jni/h5util.h
+ One prototype is missing in this file, as the function is defined in
+ source/c/jni/h5util.c
+ .
+ And this file should be included by source/c/h5lHelperImp.c, as the latter
+ uses functions of which prototypes are in this file.
+Author: Pierre Gruet <pgtdebian at free.fr>
+Last-Update: 2020-04-26
+
+--- a/source/c/h5lHelperImp.c
++++ b/source/c/h5lHelperImp.c
+@@ -17,6 +17,7 @@
+ #include "hdf5.h"
+ #include "H5Ppublic.h"
+ #include "h5jni.h"
++#include "jni/h5util.h"
+
+ #include <jni.h>
+ #include <stdlib.h>
+--- a/source/c/jni/h5util.h
++++ b/source/c/jni/h5util.h
+@@ -41,6 +41,7 @@
+ extern char* h5str_append (h5str_t *str, const char* cstr);
+ extern size_t h5str_vlsprintf(h5str_t *str, hid_t container, hid_t tid, hvl_t *buf, int expand_data);
+ extern size_t h5str_sprintf(h5str_t *str, hid_t container, hid_t tid, void *buf, int ptrlen, int expand_data);
++extern size_t h5str_vlconvert(char *str, hid_t container, hid_t tid, hvl_t *ptr, int expand_data);
+ extern size_t h5str_vlsconvert(char *str, hid_t container, hid_t tid, hvl_t *buf, int expand_data);
+ extern size_t h5str_convert(char **str, hid_t container, hid_t tid, hvl_t *buf, int ptroffset, int expand_data);
+ extern void h5str_array_free(char **strs, size_t len);
=====================================
debian/rules
=====================================
@@ -3,8 +3,8 @@
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
-export CLASSPATH=/usr/share/java/commons-lang.jar:/usr/share/java/commons-io.jar:/usr/share/java/sis-base.jar
-export TESTCLASSPATH=/usr/share/java/junit4.jar:/usr/share/java/testng.jar:/usr/share/java/jmock2.jar:/usr/share/java/jcommander.jar
+export CLASSPATH=/usr/share/java/commons-lang3.jar:/usr/share/java/commons-io.jar:/usr/share/java/sis-base.jar:/usr/share/java/jarhdf5.jar
+export TESTCLASSPATH=/usr/share/java/junit4.jar:/usr/share/java/testng.jar:/usr/share/java/jmock2.jar:/usr/share/java/jcommander.jar:/usr/share/java/sis-base.jar
DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/buildflags.mk
@@ -12,9 +12,6 @@ include /usr/share/java/java_defaults.mk
CPPFLAGS += ${jvm_includes} -Ijni
-TESTIGNORE = sourceTest/java/ch/systemsx/cisd/hdf5/HDF5RoundtripTest.java \
- sourceTest/java/ch/systemsx/cisd/hdf5/io/HDF5DataSetRandomAccessFileTest.java
-
%:
dh $@ --with javahelper
@@ -24,6 +21,7 @@ override_dh_auto_build:
# Upsteam seems to `cd source/c` and call a script which in turn calls compile_hdf5_gcc.sh
# In this script hdf5 source is unpacked, possibly patched, build and used for the JNI build
# Most problematic issue is that private header H5private.h is used
+ # Thus we have patched and got the few useful definitions in that private header.
cd source/c && \
$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -shared -fPIC -Wl,--exclude-libs,ALL \
-I/usr/lib/jvm/default-java/include/ -I/usr/include/hdf5/serial \
@@ -33,16 +31,8 @@ override_jh_installlibs:
mv targets/gradle/libs/sis-jhdf5-1.jar targets/gradle/libs/sis-jhdf5.jar
jh_installlibs --version-strip='[~pre1]*[+]git[.0-9a-f]*[+]dfsg[.0-9]*'
-_override_dh_auto_test:
+override_dh_auto_test:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
- # FIXME
- # Due to bug #842815 several tests are failing
- # To get at least some installable package these tests are ignored here
- mkdir -p debian/tmptestignore
- for ti in $(TESTIGNORE) ; do \
- mv $${ti} debian/tmptestignore ; \
- done
-
# Run the tests that come with the upstream source.
# The contortions with the CLASSPATH are to try and confirm that the MANIFEST is
# supplying the correct deps automatically - ie. we should not be feeding any
@@ -50,7 +40,7 @@ ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
# The version of testng on trusty does requires us to specifically add jcommander.jar to the
# CLASSPATH when invoking TestNG. This seems to be a bug in the testng package.
# Finally, the tests need to be run in the Zurich timezone.
- export CLASSPATH="sourceTest/java:`readlink -f sis-jhdf5.jar`:$$TESTCLASSPATH" \
+ export CLASSPATH="sourceTest/java:`readlink -f targets/gradle/libs/sis-jhdf5-1.jar`:$$TESTCLASSPATH" \
JNIPATH="`readlink -f source/c`:/usr/lib/jni" \
TZ=Europe/Zurich LC_ALL=C ; \
find sourceTest/java -name '*.java' | env CLASSPATH="$$CLASSPATH:$(CLASSPATH)" xargs javac && \
@@ -59,8 +49,4 @@ ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
#cd sourceTest/java && \
#ln -s test/hdf5lib/h5ex_g_iterate.hdf . && \
#java -Xmx2048M -Djava.library.path="$$JNIPATH" org.junit.runner.JUnitCore test.hdf5lib.TestAll
-
- # Second part of hacking around bug #842815
- mv debian/tmptestignore/* sourceTest/java/test/hdf5lib
- rmdir debian/tmptestignore
endif
=====================================
debian/tests/control
=====================================
@@ -0,0 +1,2 @@
+Tests: providedTests
+Depends: @, build-essential, junit4, testng, libjmock2-java, libjcommander-java, libhdf5-jni
=====================================
debian/tests/providedTests
=====================================
@@ -0,0 +1,25 @@
+#!/bin/sh
+# autopkgtest check: build and run the tests that are provided by upstream.
+# This is a tentative:
+# * compiling with javac outputs a message to stderr because of some ABI
+# deprecation;
+# * some tests that are run fail because the link to native code cannot be
+# done.
+# (C) 2020 Pierre Gruet.
+# Author: Pierre Gruet <pgtdebian at free.fr>
+
+set -e
+
+SOURCEDIR=$(pwd)
+WORKDIR=$(mktemp -d)
+trap "rm -rf $WORKDIR" 0 INT QUIT ABRT PIPE TERM
+cd $WORKDIR
+
+TESTCLASSPATH=/usr/share/java/junit4.jar:/usr/share/java/testng.jar:/usr/share/java/jmock2.jar:/usr/share/java/jcommander.jar
+export CLASSPATH="$SOURCEDIR/sourceTest/java:/usr/share/java/sis-jhdf5.jar:$TESTCLASSPATH" \
+ JNIPATH="`readlink -f source/c`:/usr/lib/jni" \
+ TZ=Europe/Zurich LC_ALL=C
+export COMPILPATH=/usr/share/java/commons-lang3.jar:/usr/share/java/commons-io.jar:/usr/share/java/sis-base.jar:/usr/share/java/jarhdf5.jar
+find $SOURCEDIR/sourceTest/java -name '*.java' | env CLASSPATH="$CLASSPATH:$COMPILPATH" xargs javac && \
+ java -Xmx2048M -Djava.library.path=/usr/lib/jni -Dnative.libpath.jhdf5=/usr/lib/x86_64-linux-gnu/jni/libhdf5_java.so org.testng.TestNG -verbose 2 $SOURCEDIR/sourceTest/java/tests.xml
+
View it on GitLab: https://salsa.debian.org/med-team/libsis-jhdf5-java/-/compare/25013d022c10080d5ea1b5b719ce8a54da92066e...17111b58ca7d77a46ffa3157bd7674298a799f0d
--
View it on GitLab: https://salsa.debian.org/med-team/libsis-jhdf5-java/-/compare/25013d022c10080d5ea1b5b719ce8a54da92066e...17111b58ca7d77a46ffa3157bd7674298a799f0d
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20200428/d97182da/attachment-0001.html>
More information about the debian-med-commit
mailing list