aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--dev-java/hdf-java/ChangeLog6
-rw-r--r--dev-java/hdf-java/files/hdf-java-2.8-shared.patch107
-rw-r--r--dev-java/hdf-java/files/hdfview.xml13
-rw-r--r--dev-java/hdf-java/hdf-java-2.8.ebuild124
-rw-r--r--dev-java/hdf-java/metadata.xml8
5 files changed, 254 insertions, 4 deletions
diff --git a/dev-java/hdf-java/ChangeLog b/dev-java/hdf-java/ChangeLog
index e71847eae..9bf992684 100644
--- a/dev-java/hdf-java/ChangeLog
+++ b/dev-java/hdf-java/ChangeLog
@@ -2,6 +2,12 @@
# Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2
# $Header: $
+*hdf-java-2.8 (14 May 2012)
+
+ 14 May 2012; SĂ©bastien Fabbro <bicatali@gentoo.org> +hdf-java-2.8.ebuild,
+ +files/hdf-java-2.8-shared.patch, +files/hdfview.xml, metadata.xml:
+ Version bump. Added use flag hdfview. Adapted from the wtk overlay
+
10 Apr 2012; Guillaume Horel <guillaume.horel@gmail.com> hdf-java-2.7.ebuild:
Updates SRC_URI (fixes #396437) and fixes USE flag dependencies
diff --git a/dev-java/hdf-java/files/hdf-java-2.8-shared.patch b/dev-java/hdf-java/files/hdf-java-2.8-shared.patch
new file mode 100644
index 000000000..2375fb580
--- /dev/null
+++ b/dev-java/hdf-java/files/hdf-java-2.8-shared.patch
@@ -0,0 +1,107 @@
+--- a/configure.in.orig 2011-11-29 20:19:58.000000000 +0000
++++ b/configure.in 2012-04-14 22:06:05.000000000 +0100
+@@ -177,7 +177,7 @@
+ *)
+ if test -n "$withval" ; then
+ z_lib="`echo $withval |cut -f2 -d, -s`"
+- ZLIB=$z_lib"/libz."$LLEXT
++ ZLIB="-L$z_lib -lz"
+ HAVE_ZLIB="yes"
+ else
+ ZLIB=""
+@@ -211,7 +211,7 @@
+ *)
+ if test -n "$withval" ; then
+ jpeg_lib="`echo $withval |cut -f2 -d, -s`"
+- JPEGLIB=$jpeg_lib"/libjpeg."$LLEXT
++ JPEGLIB="-L$jpeg_lib -ljpeg"
+ dnl AC_MSG_RESULT([jpeg found: $JPEGLIB]);
+ HAVE_JPEG="yes"
+ else
+@@ -246,7 +246,7 @@
+ *)
+ if test -n "$withval" ; then
+ sz_lib="`echo $withval |cut -f2 -d, -s`"
+- SZLIB=$sz_lib"/libszip."$LLEXT
++ SZLIB="-L$sz_lib -lsz"
+ dnl AC_MSG_RESULT([szlib found: $SZLIB]);
+ HAVE_SZIP="yes"
+ else
+@@ -302,7 +302,7 @@
+ ;;
+ esac
+ if test -n "$HDF4LIB"; then
+- LIBS="$HDF4LIB/libdf.$LLEXT $HDF4LIB/libmfhdf.$LLEXT $LIBS"
++ LIBS="-L$HDF4LIB -ldf -lmfhdf $LIBS"
+ HAVE_HDF4="yes"
+ fi
+ AC_MSG_RESULT([$HAVE_HDF4])
+@@ -363,7 +363,7 @@
+ *)
+ if test -n "$withval" ; then
+ hdf5_lib="`echo $withval |cut -f2 -d, -s`"
+- HDF5LIB=$hdf5_lib"/libhdf.$LLEXT"
++ HDF5LIB="-L$hdf5_lib -lhdf"
+ hdf5_inc="`echo $withval |cut -f1 -d,`"
+ if test -n "$hdf5_inc"; then
+ HDF5INC="$hdf5_inc"
+@@ -380,7 +380,7 @@
+ ;;
+ esac
+ if test -n "$HDF5LIB"; then
+- LIBS="$HDF5LIB/libhdf5.$LLEXT $LIBS"
++ LIBS="-L$HDF5LIB -lhdf5 $LIBS"
+ HAVE_HDF5="yes"
+ fi
+ AC_MSG_RESULT([$HAVE_HDF5])
+@@ -637,10 +637,6 @@
+ if test \( ! -d "$JH45INST" \); then
+ JH45INST_FOUND=0
+ fi
+- if test \( ! -w "$JH45INST" \); then
+- AC_MSG_ERROR( [ $JAVINST : not writable ])
+- JH45INST_FOUND=0
+- fi
+ fi
+ until test $JH45INST_FOUND -eq 1; do
+ echo "Please type the directory in which to install the JH45"
+--- a/native/hdf5lib/Makefile.in
++++ b/native/hdf5lib/Makefile.in
+@@ -35,7 +35,7 @@
+
+ CFLAGS = -D_FILE_OFFSET_BITS=64 $(DEFS) -I. -I$(HDF5INC) -I$(JAVAINC1) -I$(JAVAINC2)
+
+-LIBS = $(HDF5LIB)/libhdf5.$(LLEXT) $(ZLIB) $(SZLIB) -lm
++LIBS = -L$(HDF5LIB) -lhdf5 $(ZLIB) $(SZLIB) -lm
+
+ # Macro def: object filename used
+ OBJECTS = exceptionImp.o h5Constants.o h5Imp.o h5aImp.o h5dImp.o h5eImp.o h5fImp.o h5gImp.o h5iImp.o h5lImp.o h5oImp.o h5pImp.o h5rImp.o h5sImp.o h5tImp.o nativeData.o h5util.o h5zImp.o
+@@ -47,7 +47,7 @@
+
+ libjhdf5: $(OBJECTS)
+ -mkdir -p $(LIBDIR);
+- $(LD) $(LDOPT) -o $(LIBDIR)/libjhdf5.$(JSLEXT) $(LDOPT2) $(OBJECTS) $(LIBS)
++ $(LD) $(LDOPT) $(LDFLAGS) -o $(LIBDIR)/libjhdf5.$(JSLEXT) $(LDOPT2) $(OBJECTS) $(LIBS)
+
+ clean:
+ $(RM) -f *.o so_locations $(LIBDIR)/libjhdf5.$(JSLEXT)
+--- a/native/hdflib/Makefile.in
++++ b/native/hdflib/Makefile.in
+@@ -41,7 +41,7 @@
+ CFLAGS = $(DEFS) -I. -I$(JAVAINC1) -I$(JAVAINC2) -I$(HDFINC)
+
+ # Be sure to add -lbsd if compiling in a SYSV environment
+-LIBS = $(HDFLIB)/libmfhdf.$(LLEXT) $(HDFLIB)/libdf.$(LLEXT) $(SZLIB) $(ZLIB) $(JPEGLIB) -lm
++LIBS = -L$(HDFLIB) -lmfhdf -ldf $(SZLIB) $(ZLIB) $(JPEGLIB) -lm
+
+ # Macro def: object filename used
+ OBJECTS = hdfstructsutil.o \
+@@ -60,7 +60,7 @@
+
+ libjhdf: $(OBJECTS)
+ -mkdir -p $(LIBDIR);
+- $(LD) $(LDOPT) -o $(LIBDIR)/libjhdf.$(JSLEXT) $(LDOPT2) $(OBJECTS) $(LIBS)
++ $(LD) $(LDOPT) $(LDFLAGS) -o $(LIBDIR)/libjhdf.$(JSLEXT) $(LDOPT2) $(OBJECTS) $(LIBS)
+
+ clean:
+ $(RM) -f *.o so_locations $(LIBDIR)/libjhdf.$(JSLEXT)
diff --git a/dev-java/hdf-java/files/hdfview.xml b/dev-java/hdf-java/files/hdfview.xml
new file mode 100644
index 000000000..dd9ab396c
--- /dev/null
+++ b/dev-java/hdf-java/files/hdfview.xml
@@ -0,0 +1,13 @@
+<mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info">
+ <mime-type type="application/x-hdf">
+ <comment xml:lang="en">HDF files</comment>
+ <glob pattern="*.hdf"/>
+ <glob pattern="*.h4"/>
+ <glob pattern="*.hdf4"/>
+ </mime-type>
+ <mime-type type="application/x-hdf5">
+ <comment xml:lang="en">HDF5 files</comment>
+ <glob pattern="*.h5"/>
+ <glob pattern="*.hdf5"/>
+ </mime-type>
+</mime-info>
diff --git a/dev-java/hdf-java/hdf-java-2.8.ebuild b/dev-java/hdf-java/hdf-java-2.8.ebuild
new file mode 100644
index 000000000..6ab41e571
--- /dev/null
+++ b/dev-java/hdf-java/hdf-java-2.8.ebuild
@@ -0,0 +1,124 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+EAPI=4
+JAVA_PKG_IUSE="doc examples"
+inherit eutils java-pkg-2 autotools fdo-mime
+
+DESCRIPTION="Java interface to the HDF5 library"
+HOMEPAGE="http://www.hdfgroup.org/hdf-java-html/inxodex.html"
+SRC_URI="http://www.hdfgroup.org/ftp/HDF5/hdf-java/src/${P}-src.tar"
+
+LICENSE="NCSA-HDF"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="hdf hdfview szip test zlib"
+
+CDEPEND=">=sci-libs/hdf5-1.8[szip=,zlib=]
+ hdf? ( sci-libs/hdf virtual/jpeg )
+ hdfview? ( dev-java/fits dev-java/netcdf )"
+
+RDEPEND="${CDEPEND}
+ >=virtual/jre-1.5"
+
+DEPEND="${CDEPEND}
+ >=virtual/jdk-1.5
+ test? ( >=dev-java/junit-4 )"
+
+REQUIRED_USE="hdfview? ( hdf )"
+
+# buggy test with incompatible hdf5 library versions
+RESTRICT="test"
+
+S="${WORKDIR}/${PN}"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-shared.patch
+ eautoreconf
+ rm lib/*.jar
+ if hdfview; then
+ java-pkg_jar-from --into lib fits fits.jar
+ java-pkg_jar-from --into lib netcdf netcdf.jar
+ fi
+ use test && java-pkg_jar-from --into lib junit-4 junit.jar
+}
+
+src_configure() {
+ local stdpath="${EPREFIX}/usr/include,${EPREFIX}/usr/$(get_libdir)"
+ local myconf="--with-hdf4=no --with-libjpeg=no"
+ use hdf && \
+ myconf="--with-libjpeg=${stdpath} --with-hdf4=${stdpath}"
+ use zlib && myconf="${myconf} --with-libz=\"${stdpath}\""
+ use szip && myconf="${myconf} --with-libsz=\"${stdpath}\""
+
+ econf \
+ ${myconf} \
+ --with-hdf5="${stdpath}" \
+ --with-jdk="$(java-config -o)/include,$(java-config -o)/jre/lib"
+}
+
+src_compile() {
+ # parallel needs work. anyone?
+ emake -j1 ncsa just-hdf5
+
+ if use hdf; then
+ sed -i \
+ -e "s/MAX_VAR_DIMS/H4_MAX_VAR_DIMS/" \
+ native/hdflib/hdfstructsutil.c || die
+ sed -i \
+ -e "s/MAX_NC_NAME/H4_MAX_NC_NAME/" \
+ native/hdflib/hdf{vdata,sds}Imp.c || die
+ emake -j1 just-hdf4
+ fi
+
+ use hdfview && emake -j1
+ use examples && emake -j1 do-examples
+ use doc && emake -j1 javadocs
+}
+
+src_test() {
+ emake -j1 check
+}
+
+src_install() {
+ java-pkg_dojar lib/jhdf5.jar
+ java-pkg_doso lib/linux/libjhdf5.so
+
+ if use hdf; then
+ java-pkg_dojar lib/jhdf.jar
+ java-pkg_doso lib/linux/libjhdf.so
+ fi
+
+ if use hdfview; then
+ java-pkg_dojar lib/jhdf5obj.jar
+ java-pkg_dojar lib/jhdfobj.jar
+ java-pkg_dojar lib/ext/nc2obj.jar
+ java-pkg_dojar lib/ext/fitsobj.jar
+ java-pkg_dojar lib/jhdfview.jar
+ cat <<-EOF > hdfview
+ export CLASSPATH=\$(java-config --classpath hdf-java)
+ \$(java-config --java) \
+ -Xmx1000m \
+ -Djava.library.path=\"\$(java-config --library hdf-java)\" \
+ ncsa.hdf.view.HDFView \
+ -root "${EROOT}" \$*
+ EOF
+ dobin hdfview
+ insinto /usr/share/mime/packages
+ doins "${FILESDIR}"/hdfview.xml
+ newicon ncsa/hdf/view/icons/hdf_large.gif hdfview.gif
+ make_desktop_entry hdfview "HDF Viewer" hdfview
+ fi
+
+ use doc && java-pkg_dojavadoc docs/javadocs
+ use examples && java-pkg_doexamples examples
+}
+
+pkg_postinst() {
+ use hdfview && fdo-mime_desktop_database_update
+}
+
+pkg_postrm() {
+ use hdfview && fdo-mime_desktop_database_update
+}
diff --git a/dev-java/hdf-java/metadata.xml b/dev-java/hdf-java/metadata.xml
index 379252764..865bc49d7 100644
--- a/dev-java/hdf-java/metadata.xml
+++ b/dev-java/hdf-java/metadata.xml
@@ -6,12 +6,12 @@
HDF is a versatile data model that can represent very complex data
objects and a wide variety of metadata. It is a completely portable
file format with no limit on the number or size of data objects in
- the collection.
- 1;2202;0c This Java package implements HDF4/HDF5 data objects in an object-oriented
+ the collection.
+ This Java package implements HDF4/HDF5 data objects in an object-oriented
form. It provides a common Java API for accessing HDF files.
</longdescription>
<use>
- <flag name='hdf'>Add support for the Hierarchical Data Format v.4
- (<pkg>sci-libs/hdf</pkg>)</flag>
+ <flag name='hdf'>Add support for the Hierarchical Data Format v.4 (<pkg>sci-libs/hdf</pkg>)</flag>
+ <flag name='hdfview'>Build a GUI viewer for all files supported in <pkg>dev-java/hdf-java</pkg></flag>
</use>
</pkgmetadata>