fermyon-spin: 2.2.0 -> 2.4.2

Signed-off-by: Danielle Lancashire <dani@builds.terrible.systems>

authored by Danielle Lancashire and committed by Maxine Aubrey cd851f54 3b11cc57

+44 -9
+13 -9
pkgs/development/tools/fermyon-spin/default.nix
··· 1 { lib 2 , stdenv 3 - , fetchzip 4 , autoPatchelfHook 5 , gcc-unwrapped 6 , zlib ··· 17 }.${system} or (throw "Unsupported system: ${system}"); 18 19 packageHash = { 20 - x86_64-linux = "sha256-Y0Inew0PncpnEpdLWtl/85t93eGSRewKh5mvGnn+yck="; 21 - aarch64-linux = "sha256-HEm3TaLeaws8G73CU9BmxeplQdeF9nQbBSnbctaVhqI="; 22 - x86_64-darwin = "sha256-mlshpN/4Od4qrXiqIEYo7G84Dtb+tp2nK2VnrRG2rto="; 23 - aarch64-darwin = "sha256-aJH/vOidj0vbkttGDgelaAC/dMYguQPLjxl+V3pOVzI="; 24 }.${system} or (throw "Unsupported system: ${system}"); 25 26 in stdenv.mkDerivation rec { 27 pname = "fermyon-spin"; 28 - version = "2.2.0"; 29 30 - src = fetchzip { 31 url = "https://github.com/fermyon/spin/releases/download/v${version}/spin-v${version}-${platform}.tar.gz"; 32 - stripRoot = false; 33 hash = packageHash; 34 }; 35 36 nativeBuildInputs = lib.optionals stdenv.isLinux [ 37 autoPatchelfHook ··· 46 runHook preInstall 47 48 mkdir -p $out/bin 49 - cp $src/* $out/bin 50 51 runHook postInstall 52 '';
··· 1 { lib 2 , stdenv 3 + , fetchurl 4 , autoPatchelfHook 5 , gcc-unwrapped 6 , zlib ··· 17 }.${system} or (throw "Unsupported system: ${system}"); 18 19 packageHash = { 20 + x86_64-linux = "sha256-LHiLkZ+VN+wPnq6OukXozQWKh7ewNaFor1ndCUlCBtU="; 21 + aarch64-linux = "sha256-1+rLGnm+LhbYigYUcmuLICLFXUk3wjOkmxuCuuI+Xqc="; 22 + x86_64-darwin = "sha256-mJA3VXfNr6578Q2xw0xOZccloQpeCIsjn3dVdlsnTVs="; 23 + aarch64-darwin = "sha256-FNl3UefJWA8yJ2B44GUEK6py7DLikJrygIwsqdIjW9c="; 24 }.${system} or (throw "Unsupported system: ${system}"); 25 26 in stdenv.mkDerivation rec { 27 pname = "fermyon-spin"; 28 + version = "2.4.2"; 29 30 + # Use fetchurl rather than fetchzip as these tarballs are built by the project 31 + # and not by GitHub (and thus are stable) - this simplifies the update script 32 + # by allowing it to use the output of `nix store prefetch-file`. 33 + src = fetchurl { 34 url = "https://github.com/fermyon/spin/releases/download/v${version}/spin-v${version}-${platform}.tar.gz"; 35 hash = packageHash; 36 }; 37 + 38 + sourceRoot = "."; 39 40 nativeBuildInputs = lib.optionals stdenv.isLinux [ 41 autoPatchelfHook ··· 50 runHook preInstall 51 52 mkdir -p $out/bin 53 + cp ./spin $out/bin 54 55 runHook postInstall 56 '';
+31
pkgs/development/tools/fermyon-spin/update.sh
···
··· 1 + #!/usr/bin/env nix-shell 2 + #!nix-shell -i bash -p jq 3 + #shellcheck shell=bash 4 + 5 + CURRENT_HASH="" 6 + 7 + print_hash() { 8 + OS="$1" 9 + ARCH="$2" 10 + VERSION="$3" 11 + 12 + URL="https://github.com/fermyon/spin/releases/download/v${VERSION}/spin-v${VERSION}-${OS}-${ARCH}.tar.gz" 13 + echo 14 + CURRENT_HASH=$(nix store prefetch-file "$URL" --json | jq -r '.hash') 15 + 16 + echo "${ARCH}-${OS}: $CURRENT_HASH" 17 + } 18 + 19 + if [[ -z "$VER" && -n "$1" ]]; then 20 + VER="$1" 21 + fi 22 + 23 + if [[ -z "$VER" ]]; then 24 + echo "No 'VER' environment variable provided, skipping" 25 + else 26 + print_hash "linux" "amd64" "$VER" 27 + print_hash "linux" "aarch64" "$VER" 28 + print_hash "macos" "amd64" "$VER" 29 + print_hash "macos" "aarch64" "$VER" 30 + fi 31 +