diff --git a/pkgs/tools/misc/hdfview/default.nix b/pkgs/tools/misc/hdfview/default.nix index 83597d45004e..3274762d87c3 100644 --- a/pkgs/tools/misc/hdfview/default.nix +++ b/pkgs/tools/misc/hdfview/default.nix @@ -1,12 +1,26 @@ -{ lib, stdenv, fetchurl, ant, jdk, hdf4, hdf5, makeDesktopItem, copyDesktopItems, strip-nondeterminism, stripJavaArchivesHook }: +{ + lib, + stdenv, + fetchFromGitHub, + ant, + jdk, + hdf4, + hdf5, + makeDesktopItem, + copyDesktopItems, + strip-nondeterminism, + stripJavaArchivesHook, +}: -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { pname = "hdfview"; - version = "3.3.1"; + version = "3.3.2"; - src = fetchurl { - url = "https://support.hdfgroup.org/ftp/HDF5/releases/HDF-JAVA/hdfview-${version}/src/hdfview-${version}.tar.gz"; - sha256 = "sha256-WcGYceMOB8gCycJSW4KdApy2gIBgTnE/d0PxGZClUqg="; + src = fetchFromGitHub { + owner = "HDFGroup"; + repo = "hdfview"; + rev = "refs/tags/v${finalAttrs.version}"; + sha256 = "sha256-aJHeknkF38qDH9l+vuzdKFZZTcs/XMjtlHuu/LTF124="; }; patches = [ @@ -46,27 +60,34 @@ stdenv.mkDerivation rec { desktopName = name; exec = name; icon = name; - comment = meta.description; - categories = [ "Science" "DataVisualization" ]; + comment = finalAttrs.finalPackage.meta.description; + categories = [ + "Science" + "DataVisualization" + ]; }; - installPhase = '' - runHook preInstall - '' + lib.optionalString stdenv.hostPlatform.isLinux '' - mkdir -p $out/bin $out/lib - cp -a build/dist/HDFView/bin/HDFView $out/bin/ - cp -a build/dist/HDFView/lib/app $out/lib/ - cp -a build/dist/HDFView/lib/libapplauncher.so $out/lib/ - ln -s ${jdk}/lib/openjdk $out/lib/runtime + installPhase = + '' + runHook preInstall + '' + + lib.optionalString stdenv.hostPlatform.isLinux '' + mkdir -p $out/bin $out/lib + cp -a build/dist/HDFView/bin/HDFView $out/bin/ + cp -a build/dist/HDFView/lib/app $out/lib/ + cp -a build/dist/HDFView/lib/libapplauncher.so $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/ - '' + lib.optionalString stdenv.hostPlatform.isDarwin '' - mkdir -p $out/Applications - cp -a build/dist/HDFView.app $out/Applications/ - '' + '' - runHook postInstall - ''; + mkdir -p $out/share/applications $out/share/icons/hicolor/32x32/apps + cp src/HDFView.png $out/share/icons/hicolor/32x32/apps/ + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + mkdir -p $out/Applications + cp -a build/dist/HDFView.app $out/Applications/ + '' + + '' + runHook postInstall + ''; preFixup = '' # Remove build timestamp from javadoc files @@ -77,8 +98,16 @@ stdenv.mkDerivation rec { description = "A visual tool for browsing and editing HDF4 and HDF5 files"; license = lib.licenses.free; # BSD-like homepage = "https://www.hdfgroup.org/downloads/hdfview"; - platforms = lib.platforms.linux ++ lib.platforms.darwin; + downloadPage = "https://github.com/HDFGroup/hdfview"; + platforms = lib.platforms.unix; maintainers = with lib.maintainers; [ jiegec ]; mainProgram = "HDFView"; + # Startup issue is described here: + # https://github.com/NixOS/nixpkgs/issues/340048 A possible solution is + # suggested here: + # https://forum.hdfgroup.org/t/building-hdfview-3-1-0-on-centos-6-swt-library-not-found/5698 + # But it requires us to update swt, which is a bit hard, the swt update is tracked here: + # https://github.com/NixOS/nixpkgs/issues/219771 + broken = true; }; -} +}) diff --git a/pkgs/tools/misc/hdfview/disable-mac-signing.patch b/pkgs/tools/misc/hdfview/disable-mac-signing.patch index d7d67f7ac608..f72c1c4c3928 100644 --- a/pkgs/tools/misc/hdfview/disable-mac-signing.patch +++ b/pkgs/tools/misc/hdfview/disable-mac-signing.patch @@ -1,8 +1,31 @@ -diff --git a/build.xml b/build.xml -index 70ab3e2..9460321 100644 ---- a/build.xml -+++ b/build.xml -@@ -1802,13 +1802,6 @@ +diff --git i/build.xml w/build.xml +index 3bbd89b..5834e7c 100644 +--- i/build.xml ++++ w/build.xml +@@ -1607,14 +1607,6 @@ + + + +- +- +- +- +- +- +- +- + JXPackage the mac application + + +@@ -1680,7 +1672,6 @@ + + + +- + + + +@@ -2054,13 +2045,6 @@ description="Create the final package for distribution" /> @@ -10,13 +33,13 @@ index 70ab3e2..9460321 100644 - - - -- -- +- +- - Create the mac jpackage -@@ -1864,7 +1857,6 @@ +@@ -2116,7 +2100,6 @@