12 stripJavaArchivesHook,
15 stdenv.mkDerivation (finalAttrs: {
19 src = fetchFromGitHub {
22 rev = "refs/tags/v${finalAttrs.version}";
23 sha256 = "sha256-aJHeknkF38qDH9l+vuzdKFZZTcs/XMjtlHuu/LTF124=";
27 # Hardcode isUbuntu=false to avoid calling hostname to detect os
28 ./0001-Hardcode-isUbuntu-false-to-avoid-hostname-dependency.patch
29 # Disable signing on macOS
30 ./disable-mac-signing.patch
31 # Remove timestamp comment from generated versions.properties file
32 ./remove-properties-timestamp.patch
43 HDFLIBS = (hdf4.override { javaSupport = true; }).out;
44 HDF5LIBS = (hdf5.override { javaSupport = true; }).out;
48 arch = if stdenv.hostPlatform.isx86_64 then "x86_64" else "aarch64";
53 ant createJPackage -Dmachine.arch=${arch}
58 desktopItem = makeDesktopItem rec {
63 comment = finalAttrs.finalPackage.meta.description;
74 + lib.optionalString stdenv.hostPlatform.isLinux ''
75 mkdir -p $out/bin $out/lib
76 cp -a build/dist/HDFView/bin/HDFView $out/bin/
77 cp -a build/dist/HDFView/lib/app $out/lib/
78 cp -a build/dist/HDFView/lib/libapplauncher.so $out/lib/
79 ln -s ${jdk}/lib/openjdk $out/lib/runtime
81 mkdir -p $out/share/applications $out/share/icons/hicolor/32x32/apps
82 cp src/HDFView.png $out/share/icons/hicolor/32x32/apps/
84 + lib.optionalString stdenv.hostPlatform.isDarwin ''
85 mkdir -p $out/Applications
86 cp -a build/dist/HDFView.app $out/Applications/
93 # Remove build timestamp from javadoc files
94 find $out/lib/app{,/mods}/doc/javadocs -name "*.html" -exec strip-nondeterminism --type javadoc {} +
98 description = "A visual tool for browsing and editing HDF4 and HDF5 files";
99 license = lib.licenses.free; # BSD-like
100 homepage = "https://www.hdfgroup.org/downloads/hdfview";
101 downloadPage = "https://github.com/HDFGroup/hdfview";
102 platforms = lib.platforms.unix;
103 maintainers = with lib.maintainers; [ jiegec ];
104 mainProgram = "HDFView";
105 # Startup issue is described here:
106 # https://github.com/NixOS/nixpkgs/issues/340048 A possible solution is
108 # https://forum.hdfgroup.org/t/building-hdfview-3-1-0-on-centos-6-swt-library-not-found/5698
109 # But it requires us to update swt, which is a bit hard, the swt update is tracked here:
110 # https://github.com/NixOS/nixpkgs/issues/219771