hdfview: avoid hostname dependency

Signed-off-by: Jiajie Chen <c@jia.je>

+43 -1
+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 +
+5 -1
pkgs/tools/misc/hdfview/default.nix
··· 9 9 sha256 = "sha256-iY/NUifU57aX795eWpaUBflrclF/nfvb3OKZEpD9VqA="; 10 10 }; 11 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 + 12 17 nativeBuildInputs = [ 13 18 ant 14 19 jdk 15 - nettools # "hostname" required 16 20 copyDesktopItems 17 21 ]; 18 22