Author: tbooth-guest
Date: 2015-08-13 09:24:15 +0000 (Thu, 13 Aug 2015)
New Revision: 19933

Added:
   trunk/packages/libsis-jhdf5-java/trunk/debian/README.source
   trunk/packages/libsis-jhdf5-java/trunk/debian/changelog
   trunk/packages/libsis-jhdf5-java/trunk/debian/compat
   trunk/packages/libsis-jhdf5-java/trunk/debian/control
   trunk/packages/libsis-jhdf5-java/trunk/debian/copyright
   trunk/packages/libsis-jhdf5-java/trunk/debian/i_hate_java.perl
   trunk/packages/libsis-jhdf5-java/trunk/debian/jlibs
   trunk/packages/libsis-jhdf5-java/trunk/debian/manifest
   trunk/packages/libsis-jhdf5-java/trunk/debian/patches/
   trunk/packages/libsis-jhdf5-java/trunk/debian/patches/fix_dodgy_cast.patch
   trunk/packages/libsis-jhdf5-java/trunk/debian/patches/fix_link_error.patch
   
trunk/packages/libsis-jhdf5-java/trunk/debian/patches/remove_ch_rinn_imports.patch
   trunk/packages/libsis-jhdf5-java/trunk/debian/patches/series
   trunk/packages/libsis-jhdf5-java/trunk/debian/patches/sort_exceptions.patch
   trunk/packages/libsis-jhdf5-java/trunk/debian/rules
   trunk/packages/libsis-jhdf5-java/trunk/debian/source/
   trunk/packages/libsis-jhdf5-java/trunk/debian/source/format
   trunk/packages/libsis-jhdf5-java/trunk/debian/test/
   trunk/packages/libsis-jhdf5-java/trunk/debian/test/ReadWriteTest.java
   trunk/packages/libsis-jhdf5-java/trunk/debian/watch
Log:
This is very broken because of missing source.
If the patches look wrong it's because they are wrong.
The file under debian/test is, however, functional and useful for testing.


Added: trunk/packages/libsis-jhdf5-java/trunk/debian/README.source
===================================================================
--- trunk/packages/libsis-jhdf5-java/trunk/debian/README.source                 
        (rev 0)
+++ trunk/packages/libsis-jhdf5-java/trunk/debian/README.source 2015-08-13 
09:24:15 UTC (rev 19933)
@@ -0,0 +1,59 @@
+We have 2 Free Java libraries for HDF5:
+
+1) The "NCSA" lib distributed by hdfgroup.org with classes in namespace
+ncsa.hdf.hdf5lib, packaged on Debian as libjhdf5-java.
+
+2) The "CISD" aka. "SIS" lib distributed by ethz.ch with classes in the
+namespace ch.systemsx, not currently packaged on Debian.
+
+The SIS library forks some Java code from the ncsa.hdf namespace, and
+also needs to link against the NCSA native library (via JNI) at runtime.
+
+So, trying to package sis-jhdf5:
+
+wget
+'https://wiki-bsse.ethz.ch/download/attachments/26609237/sis-jhdf5-14.12.1-r33502.zip?version=1&modificationDate=1424599261225&api=v2'
+# The source is in a zip within the zip...
+unzip sis-*
+mkdir sis-jhdf5-14.12.1
+cd !$
+unzip ../sis-jhdf5/src/sis-jhdf5-src.zip
+
+For compilation to succeed, we also need sis-base, not to be confused
+with the entirely separate project at sis.apache.org!
+
+wget
+http://bs-svn01.ethz.ch/repos/cisd/libraries/trunk/sis-base/sis-base-src.zip
+
+The code also depends on their own args4j library, but only for the CLI
+under ch/systemsx/cisd/hdf5/h5ar/HDF5ArchiverMain.java which we can
+simply leave out just now.  I delete it from src/ before compiling and
+also leave out the h5ar.sh script which invokes it.  If args4j is packaged
+this can be reinstated and the h5ar command can be added to /usr/bin
+( http://bs-svn01.ethz.ch/repos/cisd/libraries/trunk/cisd-args4j/ )
+
+
+So - can we exclude the ncsa.hdf.hdf5lib.* classes from sis-jhdf5 and
+compile it against the existing classes in /usr/share/java/jhdf5.jar?
+My conclusion is not, because...
+
+The version of ncsa/hdf/hdf5lib/exceptions/HDF5Exception.java supplied
+with the sis-jhdf5 code subclasses RuntimeException but the version in
+libhdf5-java does not.  The result is that the code here does not need
+to declare the exceptions being thrown, and thus simply ignores them
+all.  One can go through and add all "throws" declarations (there are a
+_lot_ of them!!), but then any client code using the library will also
+break unless it is likewise patched or the code is modified to handle
+the exceptions internally. I think we'd best just admit defeat here and
+use the code supplied with sis-jhdf5.
+
+So, I'm going to try rolling two new packages, and see if that allows me
+to compile the latest FastQC:
+
+libsis-base-java (should be simple)
+libsis-jhdf5-java (depends on libsis-base-java + existing libjhdf5-jni)
+
+-- Tim Booth on 12th Aug 2015
+
+A further note - the dependency on libjhdf5-jni (>> 2.9-3) is there because
+2.9-3 on Trusty is buggy and fails "ldd -r /usr/lib/jni/libjhdf5.so".

Added: trunk/packages/libsis-jhdf5-java/trunk/debian/changelog
===================================================================
--- trunk/packages/libsis-jhdf5-java/trunk/debian/changelog                     
        (rev 0)
+++ trunk/packages/libsis-jhdf5-java/trunk/debian/changelog     2015-08-13 
09:24:15 UTC (rev 19933)
@@ -0,0 +1,8 @@
+This build is totally broken.  If you attempt to make it work without reading
+the README.source you are wasting your time.
+
+libsis-jhdf5-java (14.12.1-0biolinux1) trusty; urgency=medium
+
+  * Build for Trusty
+
+ -- Tim Booth <[email protected]>  Wed, 12 Aug 2015 12:15:17 +0100

Added: trunk/packages/libsis-jhdf5-java/trunk/debian/compat
===================================================================
--- trunk/packages/libsis-jhdf5-java/trunk/debian/compat                        
        (rev 0)
+++ trunk/packages/libsis-jhdf5-java/trunk/debian/compat        2015-08-13 
09:24:15 UTC (rev 19933)
@@ -0,0 +1 @@
+9

Added: trunk/packages/libsis-jhdf5-java/trunk/debian/control
===================================================================
--- trunk/packages/libsis-jhdf5-java/trunk/debian/control                       
        (rev 0)
+++ trunk/packages/libsis-jhdf5-java/trunk/debian/control       2015-08-13 
09:24:15 UTC (rev 19933)
@@ -0,0 +1,19 @@
+Source: libsis-jhdf5-java
+Section: java
+Priority: extra
+Maintainer: Tim Booth <[email protected]>
+Build-Depends: debhelper (>= 9), default-jdk, javahelper,
+               libcommons-lang-java,
+               libcommons-io-java,
+               libsis-base-java,
+               libjhdf5-jni ( >> 2.9-3 )
+Standards-Version: 3.9.5
+
+Package: libsis-base-java
+Architecture: all
+Depends: ${misc:Depends}, ${java:Depends}, libjhdf5-jni
+Description: easy-to-use HDF library for Java
+ JHDF5 is a Java binding to the HDF Group library for HDF5 focusing on
+ ease-of-use, which was developed by CISD and is now maintained by ETH SIS.
+ The library uses HDF5 1.8 from the HDF Group and files created with
+ JHDF5 are fully compatible with HDF5 1.6/1.8 (as you choose).

Added: trunk/packages/libsis-jhdf5-java/trunk/debian/copyright
===================================================================
--- trunk/packages/libsis-jhdf5-java/trunk/debian/copyright                     
        (rev 0)
+++ trunk/packages/libsis-jhdf5-java/trunk/debian/copyright     2015-08-13 
09:24:15 UTC (rev 19933)
@@ -0,0 +1,21 @@
+Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Upstream-Name: JHDF5 (HDF5 for Java)
+Upstream-Contact: 
https://wiki-bsse.ethz.ch/pages/viewpage.action?pageId=26609113
+Source: https://wiki-bsse.ethz.ch/display/JHDF5/Download+Page
+
+Files: ch/*
+Copyright: Copyright (C) Copyright 2007-2015 ETH Zuerich, CISD
+License: Apache
+ On Debian systems, you can read the full text of the Apache
+ License in ‘/usr/share/common-licenses/Apache-2.0’.
+
+Files: ncsa/*
+Copyright: Copyright (C) The HDF Group.
+           Copyright (C) the Board of Trustees of the University of Illinois
+License: Apache
+ On Debian systems, you can read the full text of the Apache
+ License in ‘/usr/share/common-licenses/Apache-2.0’.
+
+Files: debian/*
+Copyright: © Tim Booth <[email protected]>
+License: Whatever

Added: trunk/packages/libsis-jhdf5-java/trunk/debian/i_hate_java.perl
===================================================================
--- trunk/packages/libsis-jhdf5-java/trunk/debian/i_hate_java.perl              
                (rev 0)
+++ trunk/packages/libsis-jhdf5-java/trunk/debian/i_hate_java.perl      
2015-08-13 09:24:15 UTC (rev 19933)
@@ -0,0 +1,31 @@
+#!/usr/bin/perl
+#debian/i_hate_java.perl - created Wed Aug 12 18:11:25 BST 2015
+
+use strict;
+use warnings;
+
+while (<>)
+{
+    if(/^\s*public static native ([a-z]* .*)/)
+    {
+       until(/;\s*$/) {
+           chomp();
+           s/$/' '.<>/e;
+       }
+       /^(\s*public static) native ([a-z]* (\w+)\((.*)\)(.*));/
+           or die "Failed match on $_";
+
+       my $firstbit = "$1 $2";
+       my $func = "ncsa.hdf.hdf5lib.H5.$3";
+
+       my @args = map { (split())[-1] } split(/,/, $4);
+
+       my $secondbit = "{ return $func(" . join(',',@args) . "); }";
+
+       print "$firstbit $secondbit\n";
+    }
+    else
+    {
+       print $_;
+    }
+}


Property changes on: 
trunk/packages/libsis-jhdf5-java/trunk/debian/i_hate_java.perl
___________________________________________________________________
Added: svn:executable
   + *

Added: trunk/packages/libsis-jhdf5-java/trunk/debian/jlibs
===================================================================
--- trunk/packages/libsis-jhdf5-java/trunk/debian/jlibs                         
(rev 0)
+++ trunk/packages/libsis-jhdf5-java/trunk/debian/jlibs 2015-08-13 09:24:15 UTC 
(rev 19933)
@@ -0,0 +1 @@
+*.jar

Added: trunk/packages/libsis-jhdf5-java/trunk/debian/manifest
===================================================================
--- trunk/packages/libsis-jhdf5-java/trunk/debian/manifest                      
        (rev 0)
+++ trunk/packages/libsis-jhdf5-java/trunk/debian/manifest      2015-08-13 
09:24:15 UTC (rev 19933)
@@ -0,0 +1,2 @@
+usr/share/java/sis-jhdf5.jar:
+         Class-Path: commons-lang.jar commons-io.jar sis-base.jar

Added: 
trunk/packages/libsis-jhdf5-java/trunk/debian/patches/fix_dodgy_cast.patch
===================================================================
--- trunk/packages/libsis-jhdf5-java/trunk/debian/patches/fix_dodgy_cast.patch  
                        (rev 0)
+++ trunk/packages/libsis-jhdf5-java/trunk/debian/patches/fix_dodgy_cast.patch  
2015-08-13 09:24:15 UTC (rev 19933)
@@ -0,0 +1,13 @@
+This is why I don't program Java any more.  Templated classes are nasty, 
nasty, nasty.
+
+--- a/ch/systemsx/cisd/hdf5/HDF5CompoundMemberByteifyerEnumArrayFactory.java
++++ b/ch/systemsx/cisd/hdf5/HDF5CompoundMemberByteifyerEnumArrayFactory.java
+@@ -438,7 +438,7 @@
+         { "unchecked", "rawtypes" })
+     private static Enum<?> getValue(Class<? extends Enum<?>> enumClass, 
String value)
+     {
+-        return Enum.valueOf((Class<Enum>) enumClass, value);
++        return Enum.valueOf((Class) enumClass, value);
+     }
+ 
+ }

Added: 
trunk/packages/libsis-jhdf5-java/trunk/debian/patches/fix_link_error.patch
===================================================================
--- trunk/packages/libsis-jhdf5-java/trunk/debian/patches/fix_link_error.patch  
                        (rev 0)
+++ trunk/packages/libsis-jhdf5-java/trunk/debian/patches/fix_link_error.patch  
2015-08-13 09:24:15 UTC (rev 19933)
@@ -0,0 +1,52 @@
+--- a/ch/systemsx/cisd/hdf5/hdf5lib/H5.java
++++ b/ch/systemsx/cisd/hdf5/hdf5lib/H5.java
+@@ -14,9 +14,11 @@
+ import ncsa.hdf.hdf5lib.exceptions.HDF5Exception;
+ import ncsa.hdf.hdf5lib.exceptions.HDF5JavaException;
+ import ncsa.hdf.hdf5lib.exceptions.HDF5LibraryException;
++import ncsa.hdf.hdf5lib.H5.*;
+ 
+ import ch.systemsx.cisd.base.utilities.NativeLibraryUtilities;
+ 
++
+ /**
+  * The low-level C function wrappers. These functions are <i>not</i> 
thread-safe and need to be used
+  * through thread-safe wrappers.
+@@ -159,7 +161,7 @@
+      * @return a non-negative value if successful
+      * @exception HDF5LibraryException - Error from the HDF-5 Library.
+      */
+-    private static native int H5dont_atexit() throws HDF5LibraryException;
++    public static native int H5dont_atexit() throws HDF5LibraryException;
+ 
+     /**
+      * H5get_libversion retrieves the major, minor, and release numbers of 
the version of the HDF
+@@ -1946,7 +1948,7 @@
+     // //
+     // ////////////////////////////////////////////////////////////
+ 
+-    private static native int H5Rcreate(byte[] ref, int loc_id, String name, 
int ref_type,
++    public static native int H5Rcreate(byte[] ref, int loc_id, String name, 
int ref_type,
+             int space_id) throws HDF5LibraryException, NullPointerException,
+             IllegalArgumentException;
+ 
+--- a/ncsa/hdf/hdf5lib/H5.java
++++ b/ncsa/hdf/hdf5lib/H5.java
+@@ -356,7 +356,7 @@
+  * @exception HDF5LibraryException
+  *                - Error from the HDF-5 Library.
+  **/
+-private synchronized static native int H5dont_atexit()
++public synchronized static native int H5dont_atexit()
+         throws HDF5LibraryException;
+ 
+ /**
+@@ -6861,7 +6861,7 @@
+ ////
+ //////////////////////////////////////////////////////////////
+ 
+-private synchronized static native int H5Rcreate(byte[] ref, int loc_id,
++public synchronized static native int H5Rcreate(byte[] ref, int loc_id,
+         String name, int ref_type, int space_id)
+         throws HDF5LibraryException, NullPointerException, 
IllegalArgumentException;
+ 

Added: 
trunk/packages/libsis-jhdf5-java/trunk/debian/patches/remove_ch_rinn_imports.patch
===================================================================
--- 
trunk/packages/libsis-jhdf5-java/trunk/debian/patches/remove_ch_rinn_imports.patch
                          (rev 0)
+++ 
trunk/packages/libsis-jhdf5-java/trunk/debian/patches/remove_ch_rinn_imports.patch
  2015-08-13 09:24:15 UTC (rev 19933)
@@ -0,0 +1,38 @@
+I can't find a definition of this decorator, and we hopefully don't need it at 
all.
+
+--- a/ch/systemsx/cisd/hdf5/BitSetConversionUtils.java
++++ b/ch/systemsx/cisd/hdf5/BitSetConversionUtils.java
+@@ -23,7 +23,6 @@
+ 
+ import org.apache.commons.lang.SystemUtils;
+ 
+-import ch.rinn.restrictions.Private;
+ import ch.systemsx.cisd.base.mdarray.MDLongArray;
+ 
+ /**
+@@ -122,7 +121,6 @@
+         }
+     }
+ 
+-    @Private
+     static BitSet fromStorageFormGeneric(final long[] serializedWordArray, 
int start, int length)
+     {
+         final BitSet result = new BitSet();
+--- a/ch/systemsx/cisd/hdf5/HDF5Utils.java
++++ b/ch/systemsx/cisd/hdf5/HDF5Utils.java
+@@ -22,7 +22,6 @@
+ 
+ import ncsa.hdf.hdf5lib.exceptions.HDF5JavaException;
+ 
+-import ch.rinn.restrictions.Private;
+ 
+ /**
+  * Some utility methods used by {@link HDF5Reader} and {@link HDF5Writer}.
+@@ -43,7 +42,6 @@
+     static final String TYPE_VARIANT_ATTRIBUTE_NAME = "TYPE_VARIANT";
+ 
+     /** The minimal size of a chunk. */
+-    @Private
+     static final int MIN_CHUNK_SIZE = 1;
+ 
+     /** The minimal size of a data set in order to allow for chunking. */

Added: trunk/packages/libsis-jhdf5-java/trunk/debian/patches/series
===================================================================
--- trunk/packages/libsis-jhdf5-java/trunk/debian/patches/series                
                (rev 0)
+++ trunk/packages/libsis-jhdf5-java/trunk/debian/patches/series        
2015-08-13 09:24:15 UTC (rev 19933)
@@ -0,0 +1,3 @@
+fix_dodgy_cast.patch
+remove_ch_rinn_imports.patch
+fix_link_error.patch

Added: 
trunk/packages/libsis-jhdf5-java/trunk/debian/patches/sort_exceptions.patch
===================================================================
--- trunk/packages/libsis-jhdf5-java/trunk/debian/patches/sort_exceptions.patch 
                        (rev 0)
+++ trunk/packages/libsis-jhdf5-java/trunk/debian/patches/sort_exceptions.patch 
2015-08-13 09:24:15 UTC (rev 19933)
@@ -0,0 +1,364 @@
+This is my initial attempt to get the code to compile against 
/usr/share/java/jhdf5.jar that is
+in /usr/share/java/jhdf5.jar, but I realised the amount of pacthing was 
getting silly.
+
+I'm leaving this partial patch in the package for info.
+
+Index: sis-jhdf5-14.12.1/ch/systemsx/cisd/hdf5/HDF5Utils.java
+===================================================================
+--- sis-jhdf5-14.12.1.orig/ch/systemsx/cisd/hdf5/HDF5Utils.java        
2015-08-10 17:27:59.874762864 +0100
++++ sis-jhdf5-14.12.1/ch/systemsx/cisd/hdf5/HDF5Utils.java     2015-08-10 
17:27:59.866762864 +0100
+@@ -344,7 +344,7 @@
+      * 
+      * @throws HDF5JavaException If <var>dimensions</var> do not define a 
one-dimensional array.
+      */
+-    static int getOneDimensionalArraySize(final int[] dimensions)
++    static int getOneDimensionalArraySize(final int[] dimensions) throws 
HDF5JavaException
+     {
+         assert dimensions != null;
+ 
+@@ -366,7 +366,7 @@
+      * @throws HDF5JavaException If <var>dimensions</var> do not define a 
one-dimensional array or
+      *             if <code>dimensions[0]</code> overflows the 
<code>int</code> type.
+      */
+-    static int getOneDimensionalArraySize(final long[] dimensions)
++    static int getOneDimensionalArraySize(final long[] dimensions) throws 
HDF5JavaException
+     {
+         assert dimensions != null;
+ 
+Index: sis-jhdf5-14.12.1/ch/systemsx/cisd/hdf5/HDF5BaseReader.java
+===================================================================
+--- sis-jhdf5-14.12.1.orig/ch/systemsx/cisd/hdf5/HDF5BaseReader.java   
2015-08-10 17:27:59.874762864 +0100
++++ sis-jhdf5-14.12.1/ch/systemsx/cisd/hdf5/HDF5BaseReader.java        
2015-08-10 17:48:16.774795452 +0100
+@@ -114,7 +114,7 @@
+     final CharacterEncoding encodingForNewDataSets;
+ 
+     HDF5BaseReader(File hdf5File, boolean performNumericConversions, boolean 
autoDereference,
+-            FileFormat fileFormat, boolean overwrite, String 
preferredHouseKeepingNameSuffix)
++            FileFormat fileFormat, boolean overwrite, String 
preferredHouseKeepingNameSuffix) throws HDF5FileNotFoundException
+     {
+         this(hdf5File, performNumericConversions, false, autoDereference, 
fileFormat, overwrite,
+                 preferredHouseKeepingNameSuffix);
+@@ -122,7 +122,7 @@
+ 
+     HDF5BaseReader(File hdf5File, boolean performNumericConversions, boolean 
useUTF8CharEncoding,
+             boolean autoDereference, FileFormat fileFormat, boolean overwrite,
+-            String preferredHouseKeepingNameSuffix)
++            String preferredHouseKeepingNameSuffix) throws 
HDF5FileNotFoundException
+     {
+         assert hdf5File != null;
+         assert preferredHouseKeepingNameSuffix != null;
+@@ -176,7 +176,7 @@
+         }
+     }
+ 
+-    int openFile(FileFormat fileFormat, boolean overwrite)
++    int openFile(FileFormat fileFormat, boolean overwrite) throws 
HDF5FileNotFoundException
+     {
+         if (hdf5File.exists() == false)
+         {
+@@ -465,7 +465,7 @@
+      * <code>nullWhenOutside == true</code>.
+      */
+     DataSpaceParameters tryGetSpaceParameters(final int dataSetId, final long 
offset,
+-            final int blockSize, boolean nullWhenOutside, ICleanUpRegistry 
registry)
++            final int blockSize, boolean nullWhenOutside, ICleanUpRegistry 
registry) throws HDF5JavaException
+     {
+         return tryGetSpaceParameters(dataSetId, 0, offset, blockSize, 
nullWhenOutside, registry);
+     }
+@@ -474,7 +474,7 @@
+      * Returns the {@link DataSpaceParameters} for a 1d block of the given 
<var>dataSetId</var>.
+      */
+     DataSpaceParameters getSpaceParameters(final int dataSetId, final long 
offset,
+-            final int blockSize, ICleanUpRegistry registry)
++            final int blockSize, ICleanUpRegistry registry) throws 
HDF5JavaException
+     {
+         return tryGetSpaceParameters(dataSetId, 0, offset, blockSize, false, 
registry);
+     }
+@@ -483,7 +483,7 @@
+      * Returns the {@link DataSpaceParameters} for a 1d block of the given 
<var>dataSetId</var>.
+      */
+     DataSpaceParameters getSpaceParameters(final int dataSetId, final long 
memoryOffset,
+-            final long offset, final int blockSize, ICleanUpRegistry registry)
++            final long offset, final int blockSize, ICleanUpRegistry 
registry) throws HDF5JavaException
+     {
+         return tryGetSpaceParameters(dataSetId, memoryOffset, offset, 
blockSize, false, registry);
+     }
+@@ -493,7 +493,7 @@
+      */
+     DataSpaceParameters tryGetSpaceParameters(final int dataSetId, final long 
memoryOffset,
+             final long offset, final int blockSize, boolean nullWhenOutside,
+-            ICleanUpRegistry registry)
++            ICleanUpRegistry registry) throws HDF5JavaException
+     {
+         final int memorySpaceId;
+         final int dataSpaceId;
+@@ -551,7 +551,7 @@
+      * <var>dataSetId</var>.
+      */
+     DataSpaceParameters getSpaceParameters(final int dataSetId, final long[] 
offset,
+-            final int[] blockDimensionsOrNull, ICleanUpRegistry registry)
++            final int[] blockDimensionsOrNull, ICleanUpRegistry registry) 
throws HDF5JavaException
+     {
+         return tryGetSpaceParameters(dataSetId, offset, 
blockDimensionsOrNull, false, registry);
+     }
+@@ -561,7 +561,7 @@
+      * <var>dataSetId</var>.
+      */
+     DataSpaceParameters tryGetSpaceParameters(final int dataSetId, final 
long[] offset,
+-            final int[] blockDimensionsOrNull, boolean nullWhenOutside, 
ICleanUpRegistry registry)
++            final int[] blockDimensionsOrNull, boolean nullWhenOutside, 
ICleanUpRegistry registry) throws HDF5JavaException
+     {
+         final int memorySpaceId;
+         final int dataSpaceId;
+@@ -610,7 +610,7 @@
+      * mapped to a block in memory.
+      */
+     DataSpaceParameters getBlockSpaceParameters(final int dataSetId, final 
int[] memoryOffset,
+-            final int[] memoryDimensions, ICleanUpRegistry registry)
++            final int[] memoryDimensions, ICleanUpRegistry registry) throws 
HDF5JavaException
+     {
+         return tryGetBlockSpaceParameters(dataSetId, memoryOffset, 
memoryDimensions, false,
+                 registry);
+@@ -621,7 +621,7 @@
+      * mapped to a block in memory.
+      */
+     DataSpaceParameters tryGetBlockSpaceParameters(final int dataSetId, final 
int[] memoryOffset,
+-            final int[] memoryDimensions, final boolean nullWhenOutside, 
ICleanUpRegistry registry)
++            final int[] memoryDimensions, final boolean nullWhenOutside, 
ICleanUpRegistry registry) throws HDF5JavaException
+     {
+         assert memoryOffset != null;
+         assert memoryDimensions != null;
+@@ -653,7 +653,7 @@
+      */
+     DataSpaceParameters getBlockSpaceParameters(final int dataSetId, final 
int[] memoryOffset,
+             final int[] memoryDimensions, final long[] offset, final int[] 
blockDimensions,
+-            ICleanUpRegistry registry)
++            ICleanUpRegistry registry) throws HDF5JavaException
+     {
+         return tryGetBlockSpaceParameters(dataSetId, memoryOffset, 
memoryDimensions, offset,
+                 blockDimensions, false, registry);
+@@ -665,7 +665,7 @@
+      */
+     DataSpaceParameters tryGetBlockSpaceParameters(final int dataSetId, final 
int[] memoryOffset,
+             final int[] memoryDimensions, final long[] offset, final int[] 
blockDimensions,
+-            final boolean nullWhenOutside, ICleanUpRegistry registry)
++            final boolean nullWhenOutside, ICleanUpRegistry registry) throws 
HDF5JavaException
+     {
+         assert memoryOffset != null;
+         assert memoryDimensions != null;
+@@ -790,7 +790,7 @@
+      * @param dataSetPath The name (including path information) of the data 
set to return
+      *            information about.
+      */
+-    HDF5DataSetInformation getDataSetInformation(final String dataSetPath)
++    HDF5DataSetInformation getDataSetInformation(final String dataSetPath) 
throws HDF5JavaException
+     {
+         return getDataSetInformation(dataSetPath, 
DataTypeInfoOptions.DEFAULT, true);
+     }
+@@ -806,7 +806,7 @@
+      * @param fillDimensions If <code>true</code>, fill in the dimensions of 
the dataset
+      */
+     HDF5DataSetInformation getDataSetInformation(final String dataSetPath,
+-            final DataTypeInfoOptions options, final boolean fillDimensions)
++            final DataTypeInfoOptions options, final boolean fillDimensions) 
throws HDF5JavaException
+     {
+         assert dataSetPath != null;
+ 
+@@ -814,7 +814,7 @@
+                 new ICallableWithCleanUp<HDF5DataSetInformation>()
+                     {
+                         @Override
+-                        public HDF5DataSetInformation call(ICleanUpRegistry 
registry)
++                        public HDF5DataSetInformation call(ICleanUpRegistry 
registry) throws HDF5JavaException
+                         {
+                             final int dataSetId = h5.openDataSet(fileId, 
dataSetPath, registry);
+                             final int dataTypeId = 
h5.getDataTypeForDataSet(dataSetId, registry);
+@@ -872,7 +872,7 @@
+      * the array rank into one rank. It is a failure condition if the 
<var>objectPath</var> does not
+      * exist or does not identify a data set. This method follows symbolic 
links.
+      */
+-    int getRank(String dataSetPath)
++    int getRank(String dataSetPath) throws HDF5JavaException
+     {
+         final HDF5DataSetInformation info =
+                 getDataSetInformation(dataSetPath, 
DataTypeInfoOptions.MINIMAL, true);
+@@ -885,7 +885,7 @@
+      * space). It is a failure condition if the <var>objectPath</var> does 
not exist or does not
+      * identify a data set. This method follows symbolic links.
+      */
+-    long[] getDimensions(String dataSetPath)
++    long[] getDimensions(String dataSetPath) throws HDF5JavaException
+     {
+         assert dataSetPath != null;
+ 
+@@ -918,7 +918,7 @@
+         return runner.call(informationDeterminationRunnable);
+     }
+ 
+-    HDF5DataTypeVariant tryGetTypeVariant(final String objectPath)
++    HDF5DataTypeVariant tryGetTypeVariant(final String objectPath) throws 
HDF5JavaException
+     {
+         assert objectPath != null;
+ 
+@@ -926,7 +926,7 @@
+                 new ICallableWithCleanUp<HDF5DataTypeVariant>()
+                     {
+                         @Override
+-                        public HDF5DataTypeVariant call(ICleanUpRegistry 
registry)
++                        public HDF5DataTypeVariant call(ICleanUpRegistry 
registry) throws HDF5JavaException
+                         {
+                             final int objectId = h5.openObject(fileId, 
objectPath, registry);
+                             return tryGetTypeVariant(objectId, registry);
+@@ -936,7 +936,7 @@
+         return runner.call(readRunnable);
+     }
+ 
+-    HDF5DataTypeVariant tryGetTypeVariant(final String objectPath, final 
String attributeName)
++    HDF5DataTypeVariant tryGetTypeVariant(final String objectPath, final 
String attributeName) throws HDF5JavaException
+     {
+         assert objectPath != null;
+ 
+@@ -944,7 +944,7 @@
+                 new ICallableWithCleanUp<HDF5DataTypeVariant>()
+                     {
+                         @Override
+-                        public HDF5DataTypeVariant call(ICleanUpRegistry 
registry)
++                        public HDF5DataTypeVariant call(ICleanUpRegistry 
registry) throws HDF5JavaException
+                         {
+                             final int objectId = h5.openObject(fileId, 
objectPath, registry);
+                             return tryGetTypeVariant(objectId, attributeName, 
registry);
+@@ -955,7 +955,7 @@
+     }
+ 
+     HDF5EnumerationValueArray getEnumValueArray(final int attributeId, final 
String objectPath,
+-            final String attributeName, ICleanUpRegistry registry)
++            final String attributeName, ICleanUpRegistry registry) throws 
HDF5JavaException
+     {
+         final int storageDataTypeId = h5.getDataTypeForAttribute(attributeId, 
registry);
+         final int nativeDataTypeId = h5.getNativeDataType(storageDataTypeId, 
registry);
+@@ -1000,7 +1000,7 @@
+     }
+ 
+     HDF5EnumerationValueMDArray getEnumValueMDArray(final int attributeId, 
final String objectPath,
+-            final String attributeName, ICleanUpRegistry registry)
++            final String attributeName, ICleanUpRegistry registry) throws 
HDF5JavaException
+     {
+         final int storageDataTypeId = h5.getDataTypeForAttribute(attributeId, 
registry);
+         final int nativeDataTypeId = h5.getNativeDataType(storageDataTypeId, 
registry);
+@@ -1054,7 +1054,7 @@
+     }
+ 
+     HDF5DataTypeVariant[] tryGetTypeVariantForCompoundMembers(String 
dataTypePathOrNull,
+-            ICleanUpRegistry registry)
++            ICleanUpRegistry registry) throws HDF5JavaException
+     {
+         if (dataTypePathOrNull == null)
+         {
+@@ -1089,14 +1089,14 @@
+         }
+     }
+ 
+-    HDF5DataTypeVariant tryGetTypeVariant(final int objectId, 
ICleanUpRegistry registry)
++    HDF5DataTypeVariant tryGetTypeVariant(final int objectId, 
ICleanUpRegistry registry) throws HDF5JavaException
+     {
+         final int typeVariantOrdinal = getAttributeTypeVariant(objectId, 
registry);
+         return typeVariantOrdinal < 0 ? null : 
HDF5DataTypeVariant.values()[typeVariantOrdinal];
+     }
+ 
+     HDF5DataTypeVariant tryGetTypeVariant(final int objectId, String 
attributeName,
+-            ICleanUpRegistry registry)
++            ICleanUpRegistry registry) throws HDF5JavaException
+     {
+         final int typeVariantOrdinal = getAttributeTypeVariant(objectId, 
attributeName, registry);
+         return typeVariantOrdinal < 0 ? null : 
HDF5DataTypeVariant.values()[typeVariantOrdinal];
+@@ -1109,7 +1109,7 @@
+      * @param objectId The id of the data set object in the file.
+      * @return The ordinal of the type variant or <code>null</code>.
+      */
+-    int getAttributeTypeVariant(final int objectId, ICleanUpRegistry registry)
++    int getAttributeTypeVariant(final int objectId, ICleanUpRegistry 
registry) throws HDF5JavaException
+     {
+         checkOpen();
+         final String dataTypeVariantAttributeName =
+@@ -1130,7 +1130,7 @@
+      * @param attributeName The name of the attribute to get the type variant 
for.
+      * @return The ordinal of the type variant or <code>null</code>.
+      */
+-    int getAttributeTypeVariant(final int objectId, String attributeName, 
ICleanUpRegistry registry)
++    int getAttributeTypeVariant(final int objectId, String attributeName, 
ICleanUpRegistry registry) throws HDF5JavaException
+     {
+         checkOpen();
+         final String typeVariantAttrName =
+@@ -1380,7 +1380,7 @@
+ 
+     HDF5EnumerationType getEnumTypeForStorageDataType(final String nameOrNull,
+             final int storageDataTypeId, final boolean resolveName, final 
String objectPathOrNull,
+-            final String attributeNameOrNull, final ICleanUpRegistry registry)
++            final String attributeNameOrNull, final ICleanUpRegistry 
registry) throws HDF5JavaException
+     {
+         int classType = h5.getClassType(storageDataTypeId);
+         final boolean isArray = (classType == H5T_ARRAY);
+@@ -1423,7 +1423,7 @@
+                 values, this);
+     }
+ 
+-    void checkEnumValues(int dataTypeId, final String[] values, final String 
nameOrNull)
++    void checkEnumValues(int dataTypeId, final String[] values, final String 
nameOrNull) throws HDF5JavaException
+     {
+         final String[] valuesStored = 
h5.getNamesForEnumOrCompoundMembers(dataTypeId);
+         if (valuesStored.length != values.length)
+@@ -1462,13 +1462,13 @@
+         }
+     }
+ 
+-    boolean isScaledEnum(final int objectId, final ICleanUpRegistry registry)
++    boolean isScaledEnum(final int objectId, final ICleanUpRegistry registry) 
throws HDF5JavaException
+     {
+         final HDF5DataTypeVariant typeVariantOrNull = 
tryGetTypeVariant(objectId, registry);
+         return (HDF5DataTypeVariant.ENUM == typeVariantOrNull);
+     }
+ 
+-    boolean isScaledBitField(final int objectId, final ICleanUpRegistry 
registry)
++    boolean isScaledBitField(final int objectId, final ICleanUpRegistry 
registry) throws HDF5JavaException
+     {
+         final HDF5DataTypeVariant typeVariantOrNull = 
tryGetTypeVariant(objectId, registry);
+         return (HDF5DataTypeVariant.BITFIELD == typeVariantOrNull);
+@@ -1518,7 +1518,7 @@
+     }
+ 
+     String[] getStringArrayAttribute(final int objectId, final String 
objectPath,
+-            final String attributeName, final boolean readRaw, final 
ICleanUpRegistry registry)
++            final String attributeName, final boolean readRaw, final 
ICleanUpRegistry registry) throws HDF5JavaException
+     {
+         final int attributeId = h5.openAttribute(objectId, attributeName, 
registry);
+         final int stringArrayDataTypeId = 
h5.getDataTypeForAttribute(attributeId, registry);
+@@ -1568,7 +1568,7 @@
+     }
+ 
+     MDArray<String> getStringMDArrayAttribute(final int objectId, final 
String objectPath,
+-            final String attributeName, final boolean readRaw, final 
ICleanUpRegistry registry)
++            final String attributeName, final boolean readRaw, final 
ICleanUpRegistry registry) throws HDF5JavaException
+     {
+         final int attributeId = h5.openAttribute(objectId, attributeName, 
registry);
+         final int stringArrayDataTypeId = 
h5.getDataTypeForAttribute(attributeId, registry);
+Index: 
sis-jhdf5-14.12.1/ch/systemsx/cisd/hdf5/cleanup/ICallableWithCleanUp.java
+===================================================================
+--- 
sis-jhdf5-14.12.1.orig/ch/systemsx/cisd/hdf5/cleanup/ICallableWithCleanUp.java  
   2015-02-22 10:46:50.000000000 +0000
++++ sis-jhdf5-14.12.1/ch/systemsx/cisd/hdf5/cleanup/ICallableWithCleanUp.java  
2015-08-10 17:42:56.198786867 +0100
+@@ -16,6 +16,8 @@
+ 
+ package ch.systemsx.cisd.hdf5.cleanup;
+ 
++import ncsa.hdf.hdf5lib.exceptions.HDF5JavaException;
++
+ /**
+  * A role that calls a method which requires one or more clean-up steps that 
need to be run reliably
+  * at the end of the method regardless of whether the method is finished 
normally or whether it
+@@ -29,6 +31,6 @@
+ {
+ 
+     /** Calls the method requiring clean-up. */
+-    public T call(ICleanUpRegistry registry);
++    public T call(ICleanUpRegistry registry) throws HDF5JavaException;
+ 
+ }

Added: trunk/packages/libsis-jhdf5-java/trunk/debian/rules
===================================================================
--- trunk/packages/libsis-jhdf5-java/trunk/debian/rules                         
(rev 0)
+++ trunk/packages/libsis-jhdf5-java/trunk/debian/rules 2015-08-13 09:24:15 UTC 
(rev 19933)
@@ -0,0 +1,24 @@
+#!/usr/bin/make -f
+
+# 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
+
+%:
+       dh $@ --with javahelper
+
+override_dh_auto_clean:
+       rm -rf src lib build *.jar
+       #find test -name '*.class' -delete
+
+override_dh_auto_build:
+       # Avoids jh_build thinking that files in .svn or .pc are things it
+       # needs to compile.
+       mkdir src ; cp -r ch ncsa src
+       # See README.source about this file being removed
+       rm src/ch/systemsx/cisd/hdf5/h5ar/HDF5ArchiverMain.java
+       # This I cannot adequately explain:
+#      perl debian/i_hate_java.perl < ch/systemsx/cisd/hdf5/hdf5lib/H5.java \
+#          > src/ch/systemsx/cisd/hdf5/hdf5lib/H5.java
+       jh_build sis-jhdf5.jar src


Property changes on: trunk/packages/libsis-jhdf5-java/trunk/debian/rules
___________________________________________________________________
Added: svn:executable
   + *

Added: trunk/packages/libsis-jhdf5-java/trunk/debian/source/format
===================================================================
--- trunk/packages/libsis-jhdf5-java/trunk/debian/source/format                 
        (rev 0)
+++ trunk/packages/libsis-jhdf5-java/trunk/debian/source/format 2015-08-13 
09:24:15 UTC (rev 19933)
@@ -0,0 +1 @@
+3.0 (quilt)

Added: trunk/packages/libsis-jhdf5-java/trunk/debian/test/ReadWriteTest.java
===================================================================
--- trunk/packages/libsis-jhdf5-java/trunk/debian/test/ReadWriteTest.java       
                        (rev 0)
+++ trunk/packages/libsis-jhdf5-java/trunk/debian/test/ReadWriteTest.java       
2015-08-13 09:24:15 UTC (rev 19933)
@@ -0,0 +1,50 @@
+/* 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
+ * 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.
+ */
+
+import ch.systemsx.cisd.hdf5.HDF5Factory;
+import ch.systemsx.cisd.hdf5.IHDF5SimpleWriter;
+import ch.systemsx.cisd.hdf5.IHDF5SimpleReader;
+
+public class ReadWriteTest {
+
+    public static void main(String[] args) {
+
+       System.loadLibrary("jhdf5");
+
+       //Make an array
+       double[] mydata = new double[1000];
+       for (int nn=0 ; nn < mydata.length ; nn++) {
+           mydata[nn] = Math.cos(nn);
+       }
+
+       //Write it
+       IHDF5SimpleWriter writer = HDF5Factory.open("out.h5");
+       writer.writeDoubleArray("cosines", mydata);
+       writer.close();
+
+       //Read it back
+       IHDF5SimpleReader reader = HDF5Factory.openForReading("out.h5");
+       double[] readdata = reader.readDoubleArray("cosines");
+       reader.close();
+
+       //Inspect it
+       if(readdata.length != mydata.length) {
+           System.out.println("Array length is not 1000 as expected");
+           System.exit(1);
+       }
+
+       for (int nn=0 ; nn < mydata.length ; nn++ ) {
+           if(readdata[nn] != mydata[nn]) {
+               System.out.println("Data mismatch at index " + nn);
+               System.exit(1);
+           }
+       }
+
+       //Happy!
+       System.out.println("OK");
+       //exit(0);
+    }
+}

Added: trunk/packages/libsis-jhdf5-java/trunk/debian/watch
===================================================================
--- trunk/packages/libsis-jhdf5-java/trunk/debian/watch                         
(rev 0)
+++ trunk/packages/libsis-jhdf5-java/trunk/debian/watch 2015-08-13 09:24:15 UTC 
(rev 19933)
@@ -0,0 +1,6 @@
+# The source is packed into a .zip within the binary distribution.
+#
+# TODO - make a get_orig_source script to extract it, or work out how to
+# pull it from the SVN.
+
+# see: https://wiki-bsse.ethz.ch/display/JHDF5/Download+Page


_______________________________________________
debian-med-commit mailing list
[email protected]
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/debian-med-commit

Reply via email to