[med-svn] [Git][med-team/libsis-jhdf5-java][master] 10 commits: Updating dependencies with nocheck
Pierre Gruet
gitlab at salsa.debian.org
Wed May 6 16:40:26 BST 2020
Pierre Gruet pushed to branch master at Debian Med / libsis-jhdf5-java
Commits:
6c676041 by Pierre Gruet at 2020-05-05T22:49:52+02:00
Updating dependencies with nocheck
- - - - -
f7d9487f by Pierre Gruet at 2020-05-05T22:51:20+02:00
Adding a missing library loading in a java file
- - - - -
5e2388d4 by Pierre Gruet at 2020-05-05T22:52:38+02:00
Updating tests for autopkgtest
- - - - -
dee3aa36 by Pierre Gruet at 2020-05-05T22:56:18+02:00
Removing dependencies on libhdf5-java
- - - - -
7a615825 by Pierre Gruet at 2020-05-05T22:57:13+02:00
Rewriting the override of dh_auto_test so that tests run and pass
- - - - -
c7a78005 by Pierre Gruet at 2020-05-06T14:21:04+02:00
Overriding dh_auto_clean
- - - - -
41d2d457 by Pierre Gruet at 2020-05-06T14:33:06+02:00
Adapting debian/rules to the name of the built jar
- - - - -
a0478a06 by Pierre Gruet at 2020-05-06T17:26:39+02:00
Adding test of Tim Booth and Olivier Sallou for autopkgtest
- - - - -
54b46b45 by Pierre Gruet at 2020-05-06T17:27:12+02:00
Removing useless jar in manifest
- - - - -
14eeddac by Pierre Gruet at 2020-05-06T17:39:44+02:00
New uploader
- - - - -
10 changed files:
- debian/changelog
- debian/control
- debian/libsis-jhdf5-java.manifest
- + debian/patches/loading_jni_in_java_file.patch
- debian/patches/series
- debian/rules
- debian/test/ReadWriteTest.java → debian/tests/ReadWriteTest.java
- debian/tests/control
- debian/tests/providedTests
- + debian/tests/readWriteTest
Changes:
=====================================
debian/changelog
=====================================
@@ -1,5 +1,6 @@
libsis-jhdf5-java (19.04.0+dfsg-1) UNRELEASED; urgency=medium
+ [ Andreas Tille ]
* New upstream version
* Adapt watch file to upstream Gitlab clone tags
* Drop now unneeded get-orig-source target
@@ -7,11 +8,24 @@ libsis-jhdf5-java (19.04.0+dfsg-1) UNRELEASED; urgency=medium
* Use gradle build system
* Build-Depends: ant
* Versioned Build-Depends: libsis-base-java (>= 18.08.0~)
- * New upstream version
* Standards-Version: 4.5.0 (routine-update)
* debhelper-compat 12 (routine-update)
- -- Andreas Tille <tille at debian.org> Sat, 25 Apr 2020 11:04:23 +0200
+ [ Pierre Gruet ]
+ * Refresh patch use_debian_packaged_libs.patch
+ * Providing a patch to get around using private header from hdf5
+ * Fixing omissions linked to prototypes in source/c/jni/h5util.h
+ * Installing the .so file in the -jni package
+ * Writing tests in debian/tests
+ * Updating dependencies with nocheck
+ * Adding a missing library loading in a java file, using a patch
+ from Gilles Filippini
+ * Rewriting the override of dh_auto_test so that upstream tests run
+ and pass
+ * Overriding dh_auto_clean
+ * Adapting debian/rules to the name of the built jar
+
+ -- Pierre Gruet <pgtdebian at free.fr> Wed, 06 May 2020 17:36:16 +0200
libsis-jhdf5-java (14.12.6-2) unstable; urgency=medium
=====================================
debian/control
=====================================
@@ -2,7 +2,8 @@ Source: libsis-jhdf5-java
Maintainer: Debian Med Packaging Team <debian-med-packaging at lists.alioth.debian.org>
Uploaders: Tim Booth <tbooth at ceh.ac.uk>,
Olivier Sallou <osallou at debian.org>,
- Andreas Tille <tille at debian.org>
+ Andreas Tille <tille at debian.org>,
+ Pierre Gruet <pgtdebian at free.fr>
Section: java
Priority: optional
Build-Depends: debhelper-compat (= 12),
@@ -17,12 +18,11 @@ Build-Depends: debhelper-compat (= 12),
libsis-base-java (>= 18.09~pre1),
libhdf5-dev (>> 1.8.13),
libargs4j-java (>= 2.33),
- junit4,
- testng,
+ junit4 <!nocheck>,
+ testng <!nocheck>,
libhamcrest-java,
- libjmock2-java,
- libobjenesis-java,
- libhdf5-java <!nocheck>
+ libjmock2-java <!nocheck>,
+ libobjenesis-java
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 jarhdf5.jar
+ Class-Path: commons-lang3.jar commons-io.jar sis-base.jar args4j.jar
=====================================
debian/patches/loading_jni_in_java_file.patch
=====================================
@@ -0,0 +1,22 @@
+Description: adding loading of jni part in Java code
+Author: Pierre Gruet <pgtdebian at free.fr>
+Last-Update: 2020-05-03
+
+--- a/source/java/ch/systemsx/cisd/hdf5/io/HDF5DataSetRandomAccessFile.java
++++ b/source/java/ch/systemsx/cisd/hdf5/io/HDF5DataSetRandomAccessFile.java
+@@ -95,6 +95,7 @@
+ {
+ this(createHDF5ReaderOrWriter(hdf5File, readOnly), dataSetPath, creationStorageFeature,
+ size, opaqueTagOrNull, true);
++ System.loadLibrary("jhdf5");
+ }
+
+ private static IHDF5Reader createHDF5ReaderOrWriter(File hdf5File, boolean readOnly)
+@@ -127,6 +128,7 @@
+ HDF5GenericStorageFeatures creationStorageFeature, int size, String opaqueTagOrNull,
+ boolean closeReaderOnCloseFile) throws IOExceptionUnchecked
+ {
++ System.loadLibrary("jhdf5");
+ this.closeReaderOnCloseFile = closeReaderOnCloseFile;
+ final boolean readOnly = (reader instanceof IHDF5Writer) == false;
+ try
=====================================
debian/patches/series
=====================================
@@ -2,3 +2,4 @@ use_debian_packaged_libs.patch
use_jaxb.patch
avoid_using_private_hdf5_header.patch
using_h5util_definitions.patch
+loading_jni_in_java_file.patch
=====================================
debian/rules
=====================================
@@ -3,7 +3,7 @@
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
-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 CLASSPATH=/usr/share/java/commons-lang3.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:/usr/share/java/sis-base.jar
DPKG_EXPORT_BUILDFLAGS = 1
@@ -15,6 +15,13 @@ CPPFLAGS += ${jvm_includes} -Ijni
%:
dh $@ --with javahelper
+override_dh_auto_clean:
+ dh_auto_clean
+ -rm -rf debian/libsis-jhdf5-java/ debian/libsis-jhdf5-jni/ debian/tmp/ debian/.debhelper/
+ -rm debian/*debhelper* debian/files debian/*.substvars
+ -rm -rf targets/ test-output/
+ -rm source/c/libjhdf5.so
+
override_dh_auto_build:
dh_auto_build
# Create JNI manually since this is not part of the build system
@@ -25,25 +32,32 @@ override_dh_auto_build:
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 \
- *.c jni/*.c -o libsis-jhdf5.so -lz -lhdf5_serial
+ *.c jni/*.c -o libjhdf5.so -lz -lhdf5_serial
override_jh_installlibs:
- mv targets/gradle/libs/sis-jhdf5-1.jar targets/gradle/libs/sis-jhdf5.jar
+ # The jar that is build is placed in targets/gradle/libs, and its name
+ # corresponds to the regex sis-jhdf5-[0-9]*.jar. We look for it.
+ GENERATEDJARPATH="targets/gradle/libs/$$(ls -l targets/gradle/libs/ | grep 'sis-jhdf5-[0-9]*.jar' | awk '{print $$9}')" ; \
+ mv $$GENERATEDJARPATH targets/gradle/libs/sis-jhdf5.jar
jh_installlibs --version-strip='[~pre1]*[+]git[.0-9a-f]*[+]dfsg[.0-9]*'
override_dh_auto_test:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
# 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
- # extra JARs in order to make the tests pass.
- # 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 targets/gradle/libs/sis-jhdf5-1.jar`:$$TESTCLASSPATH" \
+ # These tests need to be run in the Zurich timezone.
+ # It is necessary to put the test tree in a directory of which path does not
+ # include a '+', else all the tests will be skipped. I don't know why. This
+ # is a problem when the Debian version of the package includes a '+', for
+ # instance if ``+dfsg'' is part of it. mktemp -d returns a path fitting this
+ # requirement.
+ # See above target for the rationale behind GENERATEDJARPATH.
+ TESTSOURCEDIR=$(shell mktemp -d) ; \
+ cp -r sourceTest/ $$TESTSOURCEDIR ; \
+ GENERATEDJARPATH="targets/gradle/libs/$$(ls -l targets/gradle/libs/ | grep 'sis-jhdf5-[0-9]*.jar' | awk '{print $$9}')" ; \
+ export CLASSPATH="$$TESTSOURCEDIR/sourceTest/java:`readlink -f $$GENERATEDJARPATH`:$(TESTCLASSPATH):$(CLASSPATH)" \
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 && \
+ find $$TESTSOURCEDIR/sourceTest/java -name '*.java' | xargs javac && \
java -Xmx2048M -Djava.library.path="$$JNIPATH" org.testng.TestNG -verbose 2 sourceTest/java/tests.xml
# These other tests have 3 failures. I don't think they are expected to pass.
#cd sourceTest/java && \
=====================================
debian/test/ReadWriteTest.java → debian/tests/ReadWriteTest.java
=====================================
@@ -1,7 +1,7 @@
/* Test class based on the sample code at https://wiki-bsse.ethz.ch/pages/viewpage.action?pageId=26609113
- * and amednded for the Deb package by Tim Booth. Running this assures us thet the JNI library can
+ * and amended for the Deb package by Tim Booth. Running this assures us thet the JNI library can
* be loaded and that the code is at least somewhat functional.
- * This is too simple to be worth pulling in any kind of test framework.
+ * This is very simple and therefore serves as a superficial test for autopkgtest.
*/
import ch.systemsx.cisd.hdf5.HDF5Factory;
=====================================
debian/tests/control
=====================================
@@ -1,2 +1,6 @@
Tests: providedTests
-Depends: @, default-jdk, junit4, testng, libjmock2-java, libjcommander-java, libhdf5-jni
+Depends: @, default-jdk, junit4, testng, libjmock2-java, libjcommander-java
+
+Tests: readWriteTest
+Depends: @, default-jdk
+Restrictions: superficial
=====================================
debian/tests/providedTests
=====================================
@@ -1,10 +1,10 @@
#!/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.
+# Run the tests that come with the upstream source.
+# These tests need to be run in the Zurich timezone.
+# The whole folder sourceTest/ is copied into a temporary directory where the
+# tests will be run, as some of them will write into the directory (and fail
+# if they are executed from the original source tree).
# (C) 2020 Pierre Gruet.
# Author: Pierre Gruet <pgtdebian at free.fr>
@@ -13,13 +13,14 @@ set -e
SOURCEDIR=$(pwd)
WORKDIR=$(mktemp -d)
trap "rm -rf $WORKDIR" 0 INT QUIT ABRT PIPE TERM
+cp -r sourceTest/ $WORKDIR
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" \
+export CLASSPATH="sourceTest/java:/usr/share/java/sis-jhdf5.jar:$TESTCLASSPATH" \
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
+# Compiling and running. I redirect stderr to stdout for compilation, as a
+# deprecation warning is launched.
+find sourceTest/java -name '*.java' | xargs javac 2>&1
+java -Xmx2048M -Djava.library.path=/usr/lib/jni org.testng.TestNG -verbose 2 $SOURCEDIR/sourceTest/java/tests.xml
=====================================
debian/tests/readWriteTest
=====================================
@@ -0,0 +1,18 @@
+#!/bin/sh
+# autopkgtest check: build and run ReadWriteTest.java, which calls some
+# classes of sis-jhdf5.jar.
+# (C) 2015 Tim Booth
+# 2015 Olivier Sallou
+# 2020 Pierre Gruet
+# Author: Pierre Gruet <pgtdebian at free.fr>
+
+set -e
+
+WORKDIR=$(mktemp -d)
+trap "rm -rf $WORKDIR" 0 INT QUIT ABRT PIPE TERM
+cp debian/tests/ReadWriteTest.java $WORKDIR
+cd $WORKDIR
+
+javac -cp /usr/share/java/sis-jhdf5.jar ReadWriteTest.java
+java -Xmx2048M -cp /usr/share/java/sis-jhdf5.jar:. ReadWriteTest
+
View it on GitLab: https://salsa.debian.org/med-team/libsis-jhdf5-java/-/compare/e050676036864e8315970de4d9af53dec62ba9f8...14eeddacee83752fa41df86633ca5a0a0a7ce6b2
--
View it on GitLab: https://salsa.debian.org/med-team/libsis-jhdf5-java/-/compare/e050676036864e8315970de4d9af53dec62ba9f8...14eeddacee83752fa41df86633ca5a0a0a7ce6b2
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/20200506/deff98d6/attachment-0001.html>
More information about the debian-med-commit
mailing list