2021-02-16 22:27:31 +00:00
|
|
|
{ lib, stdenv, fetchurl, ant, jdk, nettools, hdf4, hdf5, makeDesktopItem, copyDesktopItems }:
|
2017-08-22 01:59:37 +01:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "hdfview";
|
2021-02-16 22:27:31 +00:00
|
|
|
version = "3.1.2";
|
2017-08-22 01:59:37 +01:00
|
|
|
|
|
|
|
src = fetchurl {
|
2021-02-16 22:27:31 +00:00
|
|
|
url = "https://support.hdfgroup.org/ftp/HDF5/releases/HDF-JAVA/${pname}-${version}/src/${pname}-${version}.tar.gz";
|
|
|
|
sha256 = "0kyw9i3f817z71l0ak7shl0wqxasz9h5fl05mklyapa7cj27637c";
|
2017-08-22 01:59:37 +01:00
|
|
|
};
|
|
|
|
|
2021-02-16 22:27:31 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
ant jdk
|
|
|
|
nettools # "hostname" required
|
|
|
|
copyDesktopItems
|
|
|
|
];
|
2017-08-22 01:59:37 +01:00
|
|
|
|
2021-02-16 22:27:31 +00:00
|
|
|
HDFLIBS = (hdf4.override { javaSupport = true; }).out;
|
|
|
|
HDF5LIBS = (hdf5.override { javaSupport = true; }).out;
|
2017-08-22 01:59:37 +01:00
|
|
|
|
|
|
|
buildPhase = ''
|
2021-02-16 22:27:31 +00:00
|
|
|
runHook preBuild
|
|
|
|
|
|
|
|
ant createJPackage
|
|
|
|
|
|
|
|
runHook postBuild
|
2017-08-22 01:59:37 +01:00
|
|
|
'';
|
|
|
|
|
2021-02-16 22:27:31 +00:00
|
|
|
desktopItem = makeDesktopItem rec {
|
|
|
|
name = "HDFView";
|
|
|
|
desktopName = name;
|
|
|
|
exec = name;
|
|
|
|
icon = name;
|
|
|
|
comment = meta.description;
|
|
|
|
categories = "Science;DataVisualization;";
|
|
|
|
};
|
|
|
|
|
2017-08-22 01:59:37 +01:00
|
|
|
installPhase = ''
|
2021-02-16 22:27:31 +00:00
|
|
|
runHook preInstall
|
|
|
|
|
|
|
|
mkdir -p $out/bin $out/lib
|
|
|
|
cp -a build/dist/HDFView/bin/HDFView $out/bin/
|
|
|
|
cp -a build/dist/HDFView/lib/app $out/lib/
|
|
|
|
ln -s ${jdk}/lib/openjdk $out/lib/runtime
|
|
|
|
|
|
|
|
mkdir -p $out/share/applications $out/share/icons/hicolor/32x32/apps
|
|
|
|
cp src/HDFView.png $out/share/icons/hicolor/32x32/apps/
|
|
|
|
|
|
|
|
runHook postInstall
|
2017-08-22 01:59:37 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "A visual tool for browsing and editing HDF4 and HDF5 files";
|
2021-01-15 09:19:50 +00:00
|
|
|
license = lib.licenses.free; # BSD-like
|
2021-02-16 22:27:31 +00:00
|
|
|
homepage = "https://portal.hdfgroup.org/display/HDFVIEW/HDFView";
|
2021-01-15 09:19:50 +00:00
|
|
|
platforms = lib.platforms.linux;
|
2017-08-22 01:59:37 +01:00
|
|
|
};
|
|
|
|
}
|