summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulius-Plehn <Julius-Plehn@users.noreply.github.com>2020-08-06 16:02:40 +0200
committerGitHub <noreply@github.com>2020-08-06 09:02:40 -0500
commitf3ec1d445d929dac6a001d3a1231985a198d16ae (patch)
tree686967131ec31673c671494af58bf13a206b6e8b
parent9dbe1d77761eb9f98d9f18f8ff7919053c0a2b0c (diff)
downloadspack-f3ec1d445d929dac6a001d3a1231985a198d16ae.tar.gz
spack-f3ec1d445d929dac6a001d3a1231985a198d16ae.tar.bz2
spack-f3ec1d445d929dac6a001d3a1231985a198d16ae.tar.xz
spack-f3ec1d445d929dac6a001d3a1231985a198d16ae.zip
New package: HDFView (#17707)
* HDFView * adds support for version 3.1.1
-rw-r--r--var/spack/repos/builtin/packages/hdf5/package.py3
-rw-r--r--var/spack/repos/builtin/packages/hdfview/fix_build.patch12
-rw-r--r--var/spack/repos/builtin/packages/hdfview/package.py49
3 files changed, 64 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/hdf5/package.py b/var/spack/repos/builtin/packages/hdf5/package.py
index c81ffb74dc..ba02bda8e0 100644
--- a/var/spack/repos/builtin/packages/hdf5/package.py
+++ b/var/spack/repos/builtin/packages/hdf5/package.py
@@ -57,6 +57,7 @@ class Hdf5(AutotoolsPackage):
variant('hl', default=False, description='Enable the high-level library')
variant('cxx', default=False, description='Enable C++ support')
variant('fortran', default=False, description='Enable Fortran support')
+ variant('java', default=False, description='Enable Java support')
variant('threadsafe', default=False,
description='Enable thread-safe capabilities')
@@ -78,6 +79,7 @@ class Hdf5(AutotoolsPackage):
depends_on('m4', type='build', when='@develop')
depends_on('mpi', when='+mpi')
+ depends_on('java', when='+java')
# numactl does not currently build on darwin
if sys.platform != 'darwin':
depends_on('numactl', when='+mpi+fortran')
@@ -237,6 +239,7 @@ class Hdf5(AutotoolsPackage):
extra_args += self.enable_or_disable('cxx')
extra_args += self.enable_or_disable('hl')
extra_args += self.enable_or_disable('fortran')
+ extra_args += self.enable_or_disable('java')
api = self.spec.variants['api'].value
if api != 'none':
diff --git a/var/spack/repos/builtin/packages/hdfview/fix_build.patch b/var/spack/repos/builtin/packages/hdfview/fix_build.patch
new file mode 100644
index 0000000000..d4e3ce7480
--- /dev/null
+++ b/var/spack/repos/builtin/packages/hdfview/fix_build.patch
@@ -0,0 +1,12 @@
+diff --git a/build.xml b/build_fixed.xml
+index f0f2c3f..c486cbb 100644
+--- a/build.xml
++++ b/build_fixed.xml
+@@ -943,7 +943,6 @@
+ <!-- Generate list of needed Java modules by using `jdeps` on all JAR files in the release directory -->
+ <apply executable="@{java.bindir}/jdeps" output="${build.dir}/jdeps.pre" append="true" >
+ <arg value="--print-module-deps" />
+- <arg value="--ignore-missing-deps" />
+ <fileset dir="${release.dir}/lib" includes="**/*.jar" />
+ </apply>
+
diff --git a/var/spack/repos/builtin/packages/hdfview/package.py b/var/spack/repos/builtin/packages/hdfview/package.py
new file mode 100644
index 0000000000..fd21cb9dca
--- /dev/null
+++ b/var/spack/repos/builtin/packages/hdfview/package.py
@@ -0,0 +1,49 @@
+# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
+# Spack Project Developers. See the top-level COPYRIGHT file for details.
+#
+# SPDX-License-Identifier: (Apache-2.0 OR MIT)
+
+from spack import *
+import os
+
+
+class Hdfview(Package):
+ """HDFView is a visual tool written in Java for browsing
+ and editing HDF (HDF5 and HDF4) files."""
+
+ homepage = "https://www.hdfgroup.org/downloads/hdfview/"
+ url = "https://s3.amazonaws.com/hdf-wordpress-1/wp-content/uploads/manual/HDFView/hdfview-3.0.tar.gz"
+
+ version('3.1.1', sha256='1cfd127ebb4c3b0ab1cfe54649a410fc7a1c2d73f45564697d3729f4aa6b0ba3',
+ url='https://support.hdfgroup.org/ftp/HDF5/releases/HDF-JAVA/hdfview-3.1.1/src/hdfview-3.1.1.tar.gz')
+ version('3.0', sha256='e2a16d3842d8947f3d4f154ee9f48a106c7f445914a9e626a53976d678a0e934')
+
+ # unknown flag: --ignore-missing-deps
+ patch('fix_build.patch', when='@3.1.1')
+
+ depends_on('ant', type='build')
+ depends_on('hdf5 +java')
+ depends_on('hdf +java -external-xdr +shared')
+
+ def install(self, spec, prefix):
+ env['HDF5LIBS'] = spec['hdf5'].prefix
+ env['HDFLIBS'] = spec['hdf'].prefix
+
+ ant = which('ant')
+ ant('-Dbuild.debug=false', 'deploy')
+
+ dir_version = os.listdir('build/HDF_Group/HDFView/')[0]
+ path = 'build/HDF_Group/HDFView/{0}/'.format(dir_version)
+ hdfview = '{0}/{1}'.format(path, 'hdfview.sh')
+
+ filter_file(
+ r'\$dir',
+ prefix,
+ hdfview
+ )
+
+ mkdirp(prefix.bin)
+ install(hdfview, prefix.bin.hdfview)
+ chmod = which('chmod')
+ chmod('+x', self.prefix.bin.hdfview)
+ install_tree(path, prefix)