Package: libinsighttoolkit3-dev
Version: 3.16.0-1j
Severity: normal

Attaching a patch that seems to work for me.

It hardcodes the /usr/lib/jni path so it might fail on multilib
systems when itk is installed for the non-default arch.

I could run one of tha Java examples with patched InsightToolkit.jar

Please consider applying the patch.

Rebuilding insighttoolkit is quite time-consuming and the java bindings
are justs small part of the build.

Thanks

Michal
diff -ur insighttoolkit-3.16.0/debian/changelog insighttoolkit-3.16.0.j/debian/changelog
--- insighttoolkit-3.16.0/debian/changelog	2010-03-01 20:54:41.000000000 +0100
+++ insighttoolkit-3.16.0.j/debian/changelog	2010-03-02 01:13:53.000000000 +0100
@@ -1,3 +1,9 @@
+insighttoolkit (3.16.0-1j) unstable; urgency=low
+
+  * enable Java
+
+ -- Michal Suchanek <[email protected]> <[email protected]>  Mon, 01 Mar 2010 00:34:37 +0100
+
 insighttoolkit (3.16.0-1) unstable; urgency=low
 
   * New upstream.
Only in insighttoolkit-3.16.0.j/debian/: changelog~
diff -ur insighttoolkit-3.16.0/debian/CMakeCache.txt.debian insighttoolkit-3.16.0.j/debian/CMakeCache.txt.debian
--- insighttoolkit-3.16.0/debian/CMakeCache.txt.debian	2010-03-01 20:54:41.000000000 +0100
+++ insighttoolkit-3.16.0.j/debian/CMakeCache.txt.debian	2010-03-01 00:34:32.000000000 +0100
@@ -34,7 +34,7 @@
 CMAKE_SKIP_RPATH:BOOL=ON
 
 //Build cswig Java wrapper support
-ITK_CSWIG_JAVA:BOOL=OFF
+ITK_CSWIG_JAVA:BOOL=ON
 
 //Build cswig Python wrapper support (requires CableSwig).
 ITK_CSWIG_PYTHON:BOOL=ON
diff -ur insighttoolkit-3.16.0/debian/control insighttoolkit-3.16.0.j/debian/control
--- insighttoolkit-3.16.0/debian/control	2010-03-01 20:54:41.000000000 +0100
+++ insighttoolkit-3.16.0.j/debian/control	2010-03-02 00:51:17.000000000 +0100
@@ -10,7 +10,8 @@
  python-support (>= 0.6.4), python-dev, libfftw3-dev,
  tcl8.4-dev, tk8.4-dev, uuid-dev, libgdcm2-dev, libjpeg62-dev,
  libfreetype6-dev, libopenjpeg-dev, graphviz,
- libxext-dev, libxss-dev, libxft-dev, libpoppler-dev, libssl-dev
+ libxext-dev, libxss-dev, libxft-dev, libpoppler-dev, libssl-dev,
+ default-jdk (>= 1.6-34)
 XS-Python-Version: current
 Standards-Version: 3.8.0
 Vcs-Browser: http://svn.debian.org/wsvn/debian-med/trunk/packages/insighttoolkit/trunk/?rev=0&sc=0
@@ -33,6 +35,23 @@
  .
  This package contains the libraries needed to run ITK applications.
 
+Package: insighttoolkit3-java
+Section: java
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: Image processing toolkit for registration and segmentation - Java bindings
+ ITK is an open-source software toolkit for performing registration and
+ segmentation. Segmentation is the process of identifying and
+ classifying data found in a digitally sampled
+ representation. Typically the sampled representation is an image
+ acquired from such medical instrumentation as CT or MRI
+ scanners. Registration is the task of aligning or developing
+ correspondences between data. For example, in the medical
+ environment, a CT scan may be aligned with a MRI scan in order to
+ combine the information contained in both.
+ .
+ This package contains the Java language bindings for ITK.
+
 Package: python-insighttoolkit3
 Section: python
 Architecture: any
@@ -53,7 +72,7 @@
  .
  This package contains the Python language bindings for ITK.
 
-Package: tcl8.4-insighttoolkit3
+Package: insighttoolkit3-tcl
 Section: interpreters
 Architecture: any
 Depends: ${shlibs:Depends}, ${misc:Depends}, tcl8.4, tk8.4
Only in insighttoolkit-3.16.0.j/debian/: control~
diff -ur insighttoolkit-3.16.0/debian/control.in insighttoolkit-3.16.0.j/debian/control.in
--- insighttoolkit-3.16.0/debian/control.in	2010-03-01 20:54:41.000000000 +0100
+++ insighttoolkit-3.16.0.j/debian/control.in	2010-03-02 00:50:56.000000000 +0100
@@ -10,7 +10,8 @@
  python-support (>= 0.6.4), python-dev, libfftw3-dev,
  tcl8.4-dev, tk8.4-dev, uuid-dev, libgdcm2-dev, libjpeg62-dev,
  libfreetype6-dev, libopenjpeg-dev, graphviz,
- libxext-dev, libxss-dev, libxft-dev, libpoppler-dev, libssl-dev
+ libxext-dev, libxss-dev, libxft-dev, libpoppler-dev, libssl-dev,
+ default-jdk (>= 1.6-34)
 XS-Python-Version: current
 Standards-Version: 3.8.0
 Vcs-Browser: http://svn.debian.org/wsvn/debian-med/trunk/packages/insighttoolkit/trunk/?rev=0&sc=0
@@ -33,6 +35,23 @@
  .
  This package contains the libraries needed to run ITK applications.
 
+Package: insighttool...@ver_major@S-java
+Section: java
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: Image processing toolkit for registration and segmentation - Java bindings
+ ITK is an open-source software toolkit for performing registration and
+ segmentation. Segmentation is the process of identifying and
+ classifying data found in a digitally sampled
+ representation. Typically the sampled representation is an image
+ acquired from such medical instrumentation as CT or MRI
+ scanners. Registration is the task of aligning or developing
+ correspondences between data. For example, in the medical
+ environment, a CT scan may be aligned with a MRI scan in order to
+ combine the information contained in both.
+ .
+ This package contains the Java language bindings for ITK.
+
 Package: python-insighttool...@ver_major@
 Section: python
 Architecture: any
@@ -53,7 +72,7 @@
  .
  This package contains the Python language bindings for ITK.
 
-Package: tcl8.4-insighttool...@ver_major@
+Package: insighttool...@ver_major@-tcl
 Section: interpreters
 Architecture: any
 Depends: ${shlibs:Depends}, ${misc:Depends}, tcl8.4, tk8.4
Only in insighttoolkit-3.16.0.j/debian/: control.in~
Only in insighttoolkit-3.16.0.j/debian/: java-insighttoolkit3
Only in insighttoolkit-3.16.0.j/debian/: java-insighttoolkit3.debhelper.log
Only in insighttoolkit-3.16.0.j/debian/: libinsighttoolkit3.16.lintian-overrides
Only in insighttoolkit-3.16.0.j/debian/: python-insighttoolkit3.lintian-overrides
diff -ur insighttoolkit-3.16.0/debian/rules insighttoolkit-3.16.0.j/debian/rules
--- insighttoolkit-3.16.0/debian/rules	2010-03-01 20:54:41.000000000 +0100
+++ insighttoolkit-3.16.0.j/debian/rules	2010-03-02 00:46:25.000000000 +0100
@@ -17,10 +17,13 @@
 
 pkg_lib = libinsighttoolkit$(SOVERSION)
 pkg_dev = libinsighttoolkit$(VER_MAJOR)-dev
+pkg_java = insighttoolkit$(VER_MAJOR)-java
 pkg_python = python-insighttoolkit$(VER_MAJOR)
-pkg_tcl = tcl8.4-insighttoolkit$(VER_MAJOR)
+pkg_tcl = insighttoolkit$(VER_MAJOR)-tcl
 pkg_examples = insighttoolkit$(VER_MAJOR)-examples
 
+export JAVA_HOME=/usr/lib/jvm/default-java
+
 PYVERS = $(shell pyversions -r debian/control)
 PYMODDIR = usr/lib/$(PYVERS)/site-packages
 PYEXTDIR = $(PYMODDIR)
@@ -68,15 +71,19 @@
 	dh_lintian
 
 install/$(pkg_lib)::
-	dh_install -p$(pkg_lib) -XPython -XTcl debian/tmp/usr/lib/InsightToolkit/lib*.so.* usr/lib
+	dh_install -p$(pkg_lib) -XJava -XPython -XTcl debian/tmp/usr/lib/InsightToolkit/lib*.so.* usr/lib
 
 install/$(pkg_dev)::
 	dh_installman -p$(pkg_dev) debian/insighttoolkit.3
 	dh_installdocs -p$(pkg_dev) Documentation/*
-	dh_install -p$(pkg_dev) -XPython -XTcl debian/tmp/usr/lib/InsightToolkit/lib*.so usr/lib
+	dh_install -p$(pkg_dev) -XJava -XPython -XTcl debian/tmp/usr/lib/InsightToolkit/lib*.so usr/lib
 	dh_install -p$(pkg_dev) --autodest debian/tmp/usr/include/InsightToolkit/*
 	dh_install -p$(pkg_dev) --autodest debian/tmp/usr/lib/InsightToolkit/*.cmake 
 
+install/$(pkg_java)::
+	dh_install -p$(pkg_java) debian/tmp/usr/lib/InsightToolkit/*Java.so* usr/lib/jni
+	dh_install -p$(pkg_java) debian/tmp/usr/lib/InsightToolkit/*.jar usr/share/java
+
 install/$(pkg_python)::
 	dh_install -p$(pkg_python) -XlibSwig debian/tmp/usr/lib/InsightToolkit/*Python.so* $(PYEXTDIR)
 	dh_install -p$(pkg_python) debian/tmp/usr/lib/InsightToolkit/libSwigRuntimePython.so* usr/lib
--- insighttoolkit-3.16.0/Wrapping/CSwig/Java/itkbase.java.in.orig	2005-04-27 16:45:25.000000000 +0200
+++ insighttoolkit-3.16.0/Wrapping/CSwig/Java/itkbase.java.in	2010-03-02 10:57:58.000000000 +0100
@@ -25,7 +25,7 @@
 {
   private static String buildDir = "@ITK_JAVA_BUILD_DIR@";
   private static String installDir = "@ITK_JAVA_INSTALL_DIR@";
-  private static String libDir = "/InsightToolkit.jar must be in CLASSPATH";
+  private static String libDir = "/usr/lib/jni";
 
   static
     {
@@ -48,7 +48,7 @@
           }
         else
           {
-          libDir = dir.substring(0, index-1)+installDir;
+          //libDir = dir.substring(0, index-1)+installDir;
           break;
           }
         }

Reply via email to