lol
1{ stdenv, fetchurl, cmake, ant, javac, hdf_java }:
2
3stdenv.mkDerivation rec {
4 name = "hdfview-${version}";
5 version = "2.14";
6
7 src = fetchurl {
8 url = "http://support.hdfgroup.org/ftp/HDF5/hdf-java/current/src/${name}.tar.gz";
9 sha256 = "0lv9djfm7hnp14mcyzbiax3xjb8vkbzhh7bdl6cvgy53pc08784p";
10 };
11
12 nativeBuildInputs = [ ant javac ];
13
14 HDFLIBS = hdf_java;
15
16 buildPhase = ''
17 ant run
18 ant package
19 '';
20
21 installPhase = ''
22 mkdir $out
23 # exclude jre
24 cp -r build/HDF_Group/HDFView/*/{lib,share} $out/
25 mkdir $out/bin
26 cp -r build/HDF_Group/HDFView/*/hdfview.sh $out/bin/hdfview
27 chmod +x $out/bin/hdfview
28 substituteInPlace $out/bin/hdfview \
29 --replace "@JAVABIN@" "${javac}/bin/" \
30 --replace "@INSTALLDIR@" "$out"
31 '';
32
33 meta = {
34 description = "A visual tool for browsing and editing HDF4 and HDF5 files";
35 license = stdenv.lib.licenses.free; # BSD-like
36 homepage = https://support.hdfgroup.org/products/java/index.html;
37 platforms = stdenv.lib.platforms.linux;
38 };
39}