Unverified Commit e50a003f authored by Weijia Wang's avatar Weijia Wang Committed by GitHub
Browse files

Merge pull request #264678 from paumr/archi_binary_5.1.0

archi: 4.7.1 -> 5.2.0
parents cd5199d3 25c6f35a
Loading
Loading
Loading
Loading
+25 −16
Original line number Diff line number Diff line
{ 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