From 25c6f35a32a313589ceeffcc8bf7b46673a1829a Mon Sep 17 00:00:00 2001 From: paumr Date: Tue, 31 Oct 2023 22:49:15 +0100 Subject: [PATCH] archi: 4.7.1 -> 5.2.0 upgraded binary release of archi to 5.2.0 The .dmg couldn't be extracted since undmg only supports HFS and not APFS. To work arround this issue it was replaced by 7zz. --- pkgs/tools/misc/archi/default.nix | 41 +++++++++++++++++++------------ 1 file changed, 25 insertions(+), 16 deletions(-) diff --git a/pkgs/tools/misc/archi/default.nix b/pkgs/tools/misc/archi/default.nix index f74d1a8c803a..cf9055c78c6a 100644 --- a/pkgs/tools/misc/archi/default.nix +++ b/pkgs/tools/misc/archi/default.nix @@ -1,31 +1,32 @@ { lib, stdenv , fetchurl -, fetchzip , autoPatchelfHook , makeWrapper , jdk , libsecret , webkitgtk , wrapGAppsHook +, _7zz }: stdenv.mkDerivation rec { pname = "Archi"; - version = "4.7.1"; + version = "5.2.0"; - src = - if stdenv.hostPlatform.system == "x86_64-linux" then - fetchurl { - url = "https://www.archimatetool.com/downloads/archi/Archi-Linux64-${version}.tgz"; - sha256 = "0sd57cfnh5q2p17sd86c8wgmqyipg29rz6iaa5brq8mwn8ps2fdw"; - } - else if stdenv.hostPlatform.system == "x86_64-darwin" then - fetchzip { - url = "https://www.archimatetool.com/downloads/archi/Archi-Mac-${version}.zip"; - sha256 = "1h05lal5jnjwm30dbqvd6gisgrmf1an8xf34f01gs9pwqvqfvmxc"; - } - else - throw "Unsupported system"; + src = { + "x86_64-linux" = fetchurl { + url = "https://www.archimatetool.com/downloads/archi_5.php?/${version}/Archi-Linux64-${version}.tgz"; + hash = "sha256-uGW4Wl3E71ZCgWzPHkmXv/PluegDF8C64FUQ7C5/SDA="; + }; + "x86_64-darwin" = fetchurl { + url = "https://www.archimatetool.com/downloads/archi_5.php?/${version}/Archi-Mac-${version}.dmg"; + hash = "sha256-GI9aIAYwu60RdjN0Y3O94sVMzJR1+nX4txVcvqn1r58="; + }; + "aarch64-darwin" = fetchurl { + url = "https://www.archimatetool.com/downloads/archi_5.php?/${version}/Archi-Mac-Silicon-${version}.dmg"; + hash = "sha256-Jg+tl902OWSm4GHxF7QXbRU5nxX4/5q6LTGubHWQ08E="; + }; + }.${stdenv.hostPlatform.system} or (throw "Unsupported system"); buildInputs = [ libsecret @@ -34,7 +35,15 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ makeWrapper wrapGAppsHook - ] ++ lib.optional stdenv.hostPlatform.isLinux autoPatchelfHook; + ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ + _7zz + ] ++ lib.optionals stdenv.hostPlatform.isLinux [ + autoPatchelfHook + ]; + + unpackPhase = if stdenv.hostPlatform.isDarwin then '' + 7zz x $src + '' else null; installPhase = if stdenv.hostPlatform.system == "x86_64-linux" then