2021-02-16 22:27:31 +00:00
|
|
|
{ lib, stdenv, fetchurl, ant, jdk, nettools, hdf4, hdf5, makeDesktopItem, copyDesktopItems }:
|
2017-08-22 00:59:37 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "hdfview";
|
2022-07-18 19:09:53 +00:00
|
|
|
version = "3.2.0";
|
2017-08-22 00:59:37 +00: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";
|
2022-07-18 19:09:53 +00:00
|
|
|
sha256 = "sha256-08De/yy9lZUIxNqccS2nL7IE/2gYo0NPAKcHH46M8rg=";
|
2017-08-22 00:59:37 +00:00
|
|
|
};
|
|
|
|
|
2022-07-15 02:22:02 +00:00
|
|
|
patches = [
|
|
|
|
# Hardcode isUbuntu=false to avoid calling hostname to detect os
|
|
|
|
./0001-Hardcode-isUbuntu-false-to-avoid-hostname-dependency.patch
|
|
|
|
];
|
|
|
|
|
2021-02-16 22:27:31 +00:00
|
|
|
nativeBuildInputs = [
|
2022-07-11 00:36:40 +00:00
|
|
|
ant
|
|
|
|
jdk
|
2021-02-16 22:27:31 +00:00
|
|
|
copyDesktopItems
|
|
|
|
];
|
2017-08-22 00:59:37 +00:00
|
|
|
|
2021-02-16 22:27:31 +00:00
|
|
|
HDFLIBS = (hdf4.override { javaSupport = true; }).out;
|
|
|
|
HDF5LIBS = (hdf5.override { javaSupport = true; }).out;
|
2017-08-22 00:59:37 +00:00
|
|
|
|
2022-07-11 00:36:40 +00:00
|
|
|
buildPhase =
|
|
|
|
let
|
|
|
|
arch = if stdenv.isx86_64 then "x86_64" else "aarch64";
|
|
|
|
in
|
|
|
|
''
|
|
|
|
runHook preBuild
|
2021-02-16 22:27:31 +00:00
|
|
|
|
2022-07-11 00:36:40 +00:00
|
|
|
ant createJPackage -Dmachine.arch=${arch}
|
2021-02-16 22:27:31 +00:00
|
|
|
|
2022-07-11 00:36:40 +00:00
|
|
|
runHook postBuild
|
|
|
|
'';
|
2017-08-22 00:59:37 +00:00
|
|
|
|
2021-02-16 22:27:31 +00:00
|
|
|
desktopItem = makeDesktopItem rec {
|
|
|
|
name = "HDFView";
|
|
|
|
desktopName = name;
|
|
|
|
exec = name;
|
|
|
|
icon = name;
|
|
|
|
comment = meta.description;
|
2022-02-22 14:56:15 +00:00
|
|
|
categories = [ "Science" "DataVisualization" ];
|
2021-02-16 22:27:31 +00:00
|
|
|
};
|
|
|
|
|
2017-08-22 00:59:37 +00:00
|
|
|
installPhase = ''
|
2021-02-16 22:27:31 +00:00
|
|
|
runHook preInstall
|
2022-07-04 06:01:23 +00:00
|
|
|
'' + lib.optionalString stdenv.isLinux ''
|
2021-02-16 22:27:31 +00:00
|
|
|
mkdir -p $out/bin $out/lib
|
|
|
|
cp -a build/dist/HDFView/bin/HDFView $out/bin/
|
|
|
|
cp -a build/dist/HDFView/lib/app $out/lib/
|
2022-07-08 03:13:12 +00:00
|
|
|
cp -a build/dist/HDFView/lib/libapplauncher.so $out/lib/
|
2021-02-16 22:27:31 +00:00
|
|
|
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/
|
2022-07-04 06:01:23 +00:00
|
|
|
'' + lib.optionalString stdenv.isDarwin ''
|
|
|
|
mkdir -p $out/Applications
|
|
|
|
cp -a build/dist/HDFView.app $out/Applications/
|
|
|
|
'' + ''
|
2021-02-16 22:27:31 +00:00
|
|
|
runHook postInstall
|
2017-08-22 00:59:37 +00: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";
|
2022-07-04 06:01:23 +00:00
|
|
|
platforms = lib.platforms.linux ++ lib.platforms.darwin;
|
2022-07-12 02:13:32 +00:00
|
|
|
maintainers = with lib.maintainers; [ jiegec ];
|
2017-08-22 00:59:37 +00:00
|
|
|
};
|
|
|
|
}
|