Merge pull request #180613 from jiegec/hdfview

Fix hdfview issue 179793 and bump hdfview to 3.1.4

authored by Robert Scott and committed by GitHub 2a0c7fc3 4a9060f8

+58 -9
+38
pkgs/tools/misc/hdfview/0001-Hardcode-isUbuntu-false-to-avoid-hostname-dependency.patch
···
··· 1 + From e5eb394458e19ce8f8a231e8b2005c80c64fd426 Mon Sep 17 00:00:00 2001 2 + From: Jiajie Chen <c@jia.je> 3 + Date: Fri, 15 Jul 2022 10:13:23 +0800 4 + Subject: [PATCH] Hardcode isUbuntu=false to avoid hostname dependency. 5 + 6 + The original build.xml detects whether the system is ubuntu based on its 7 + hostname, which is useless in nixpkgs and brings additional dependency. 8 + 9 + As suggested by @risicle in #180613, we can simply hardcode isUbuntu to 10 + false. 11 + 12 + Signed-off-by: Jiajie Chen <c@jia.je> 13 + --- 14 + build.xml | 8 +++----- 15 + 1 file changed, 3 insertions(+), 5 deletions(-) 16 + 17 + diff --git a/build.xml b/build.xml 18 + index c4f0974..15a6078 100644 19 + --- a/build.xml 20 + +++ b/build.xml 21 + @@ -143,11 +143,9 @@ 22 + </and> 23 + </condition> 24 + 25 + - <exec executable="hostname" outputproperty="computer.hostname"/> 26 + - 27 + - <condition property="isUbuntu"> 28 + - <contains string="${computer.hostname}" substring="ubuntu" /> 29 + - </condition> 30 + + <!-- Since we do not package .deb nor .rpm files, we can safely 31 + + hardcode isUbuntu = false. --> 32 + + <property name="isUbuntu" value="false" /> 33 + 34 + <!-- Build 64-bit binary. 35 + Note: os.arch gives the architecture of the JVM, NOT the OS; 36 + -- 37 + 2.36.1 38 +
+20 -9
pkgs/tools/misc/hdfview/default.nix
··· 2 3 stdenv.mkDerivation rec { 4 pname = "hdfview"; 5 - version = "3.1.3"; 6 7 src = fetchurl { 8 url = "https://support.hdfgroup.org/ftp/HDF5/releases/HDF-JAVA/${pname}-${version}/src/${pname}-${version}.tar.gz"; 9 - sha256 = "sha256-VmgHSVMFoy09plU5pSnyaPz8N15toy7QfCtXI7mqDGY="; 10 }; 11 12 nativeBuildInputs = [ 13 - ant jdk 14 - nettools # "hostname" required 15 copyDesktopItems 16 ]; 17 18 HDFLIBS = (hdf4.override { javaSupport = true; }).out; 19 HDF5LIBS = (hdf5.override { javaSupport = true; }).out; 20 21 - buildPhase = '' 22 - runHook preBuild 23 24 - ant createJPackage 25 26 - runHook postBuild 27 - ''; 28 29 desktopItem = makeDesktopItem rec { 30 name = "HDFView"; ··· 41 mkdir -p $out/bin $out/lib 42 cp -a build/dist/HDFView/bin/HDFView $out/bin/ 43 cp -a build/dist/HDFView/lib/app $out/lib/ 44 ln -s ${jdk}/lib/openjdk $out/lib/runtime 45 46 mkdir -p $out/share/applications $out/share/icons/hicolor/32x32/apps ··· 57 license = lib.licenses.free; # BSD-like 58 homepage = "https://portal.hdfgroup.org/display/HDFVIEW/HDFView"; 59 platforms = lib.platforms.linux ++ lib.platforms.darwin; 60 }; 61 }
··· 2 3 stdenv.mkDerivation rec { 4 pname = "hdfview"; 5 + version = "3.1.4"; 6 7 src = fetchurl { 8 url = "https://support.hdfgroup.org/ftp/HDF5/releases/HDF-JAVA/${pname}-${version}/src/${pname}-${version}.tar.gz"; 9 + sha256 = "sha256-iY/NUifU57aX795eWpaUBflrclF/nfvb3OKZEpD9VqA="; 10 }; 11 12 + patches = [ 13 + # Hardcode isUbuntu=false to avoid calling hostname to detect os 14 + ./0001-Hardcode-isUbuntu-false-to-avoid-hostname-dependency.patch 15 + ]; 16 + 17 nativeBuildInputs = [ 18 + ant 19 + jdk 20 copyDesktopItems 21 ]; 22 23 HDFLIBS = (hdf4.override { javaSupport = true; }).out; 24 HDF5LIBS = (hdf5.override { javaSupport = true; }).out; 25 26 + buildPhase = 27 + let 28 + arch = if stdenv.isx86_64 then "x86_64" else "aarch64"; 29 + in 30 + '' 31 + runHook preBuild 32 33 + ant createJPackage -Dmachine.arch=${arch} 34 35 + runHook postBuild 36 + ''; 37 38 desktopItem = makeDesktopItem rec { 39 name = "HDFView"; ··· 50 mkdir -p $out/bin $out/lib 51 cp -a build/dist/HDFView/bin/HDFView $out/bin/ 52 cp -a build/dist/HDFView/lib/app $out/lib/ 53 + cp -a build/dist/HDFView/lib/libapplauncher.so $out/lib/ 54 ln -s ${jdk}/lib/openjdk $out/lib/runtime 55 56 mkdir -p $out/share/applications $out/share/icons/hicolor/32x32/apps ··· 67 license = lib.licenses.free; # BSD-like 68 homepage = "https://portal.hdfgroup.org/display/HDFVIEW/HDFView"; 69 platforms = lib.platforms.linux ++ lib.platforms.darwin; 70 + maintainers = with lib.maintainers; [ jiegec ]; 71 }; 72 }