Unverified Commit 0424cf5f authored by Michael Hoang's avatar Michael Hoang Committed by GitHub
Browse files

arq: 7.35.1 -> 7.38.1 (#495009)

parents b0e06d09 ad768ac5
Loading
Loading
Loading
Loading
+18 −2
Original line number Diff line number Diff line
@@ -4,15 +4,16 @@
  fetchurl,
  cpio,
  xar,
  writeScript,
}:

stdenvNoCC.mkDerivation (finalAttrs: {
  pname = "arq";
  version = "7.35.1";
  version = "7.38.1";

  src = fetchurl {
    url = "https://www.arqbackup.com/download/arqbackup/Arq${finalAttrs.version}.pkg";
    hash = "sha256-xkrWH2r3DaxsBBdyu0Wj/qzjJaa9DTZCzEaB/nb2WyY=";
    hash = "sha256-RzG1eQybZxXbgWVkeCdIkEE6qaxzDIZ0kaR35sYUv0o=";
  };

  nativeBuildInputs = [
@@ -39,6 +40,21 @@ stdenvNoCC.mkDerivation (finalAttrs: {
  # Arq is notarized
  dontFixup = true;

  passthru.updateScript = writeScript "update.sh" ''
    #!/usr/bin/env nix-shell
    #!nix-shell -i bash -p curl coreutils common-updater-scripts
    set -eu -o pipefail

    url="https://www.arqbackup.com/download/arqbackup/arq${lib.versions.major finalAttrs.version}_release_notes.html"
    release_notes="$(curl -sSL "$url")"
    version="$(echo "$release_notes" | grep -oP "Version\s+v?\K(\d+(?:\.\d+)+)" -m 1)"

    hash_base16="$(echo "$release_notes" | grep -oP "SHA(2-)?256\(\S+\)\= \K[0-9a-f]{64}" -m 1)"
    hash="$(nix-hash --to-sri --type sha256 "$hash_base16")"

    update-source-version ${finalAttrs.pname} "$version" "$hash" --print-changes
  '';

  meta = {
    changelog = "https://www.arqbackup.com/download/arqbackup/arq7_release_notes.html";
    description = "Multi-cloud backup software for your Macs";