fermyon-spin: 2.2.0 -> 2.4.2
Signed-off-by: Danielle Lancashire <dani@builds.terrible.systems>
This commit is contained in:
parent
3b11cc5766
commit
cd851f5499
|
@ -1,6 +1,6 @@
|
||||||
{ lib
|
{ lib
|
||||||
, stdenv
|
, stdenv
|
||||||
, fetchzip
|
, fetchurl
|
||||||
, autoPatchelfHook
|
, autoPatchelfHook
|
||||||
, gcc-unwrapped
|
, gcc-unwrapped
|
||||||
, zlib
|
, zlib
|
||||||
|
@ -17,22 +17,26 @@ let
|
||||||
}.${system} or (throw "Unsupported system: ${system}");
|
}.${system} or (throw "Unsupported system: ${system}");
|
||||||
|
|
||||||
packageHash = {
|
packageHash = {
|
||||||
x86_64-linux = "sha256-Y0Inew0PncpnEpdLWtl/85t93eGSRewKh5mvGnn+yck=";
|
x86_64-linux = "sha256-LHiLkZ+VN+wPnq6OukXozQWKh7ewNaFor1ndCUlCBtU=";
|
||||||
aarch64-linux = "sha256-HEm3TaLeaws8G73CU9BmxeplQdeF9nQbBSnbctaVhqI=";
|
aarch64-linux = "sha256-1+rLGnm+LhbYigYUcmuLICLFXUk3wjOkmxuCuuI+Xqc=";
|
||||||
x86_64-darwin = "sha256-mlshpN/4Od4qrXiqIEYo7G84Dtb+tp2nK2VnrRG2rto=";
|
x86_64-darwin = "sha256-mJA3VXfNr6578Q2xw0xOZccloQpeCIsjn3dVdlsnTVs=";
|
||||||
aarch64-darwin = "sha256-aJH/vOidj0vbkttGDgelaAC/dMYguQPLjxl+V3pOVzI=";
|
aarch64-darwin = "sha256-FNl3UefJWA8yJ2B44GUEK6py7DLikJrygIwsqdIjW9c=";
|
||||||
}.${system} or (throw "Unsupported system: ${system}");
|
}.${system} or (throw "Unsupported system: ${system}");
|
||||||
|
|
||||||
in stdenv.mkDerivation rec {
|
in stdenv.mkDerivation rec {
|
||||||
pname = "fermyon-spin";
|
pname = "fermyon-spin";
|
||||||
version = "2.2.0";
|
version = "2.4.2";
|
||||||
|
|
||||||
src = fetchzip {
|
# Use fetchurl rather than fetchzip as these tarballs are built by the project
|
||||||
|
# and not by GitHub (and thus are stable) - this simplifies the update script
|
||||||
|
# by allowing it to use the output of `nix store prefetch-file`.
|
||||||
|
src = fetchurl {
|
||||||
url = "https://github.com/fermyon/spin/releases/download/v${version}/spin-v${version}-${platform}.tar.gz";
|
url = "https://github.com/fermyon/spin/releases/download/v${version}/spin-v${version}-${platform}.tar.gz";
|
||||||
stripRoot = false;
|
|
||||||
hash = packageHash;
|
hash = packageHash;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
sourceRoot = ".";
|
||||||
|
|
||||||
nativeBuildInputs = lib.optionals stdenv.isLinux [
|
nativeBuildInputs = lib.optionals stdenv.isLinux [
|
||||||
autoPatchelfHook
|
autoPatchelfHook
|
||||||
];
|
];
|
||||||
|
@ -46,7 +50,7 @@ in stdenv.mkDerivation rec {
|
||||||
runHook preInstall
|
runHook preInstall
|
||||||
|
|
||||||
mkdir -p $out/bin
|
mkdir -p $out/bin
|
||||||
cp $src/* $out/bin
|
cp ./spin $out/bin
|
||||||
|
|
||||||
runHook postInstall
|
runHook postInstall
|
||||||
'';
|
'';
|
||||||
|
|
31
pkgs/development/tools/fermyon-spin/update.sh
Executable file
31
pkgs/development/tools/fermyon-spin/update.sh
Executable file
|
@ -0,0 +1,31 @@
|
||||||
|
#!/usr/bin/env nix-shell
|
||||||
|
#!nix-shell -i bash -p jq
|
||||||
|
#shellcheck shell=bash
|
||||||
|
|
||||||
|
CURRENT_HASH=""
|
||||||
|
|
||||||
|
print_hash() {
|
||||||
|
OS="$1"
|
||||||
|
ARCH="$2"
|
||||||
|
VERSION="$3"
|
||||||
|
|
||||||
|
URL="https://github.com/fermyon/spin/releases/download/v${VERSION}/spin-v${VERSION}-${OS}-${ARCH}.tar.gz"
|
||||||
|
echo
|
||||||
|
CURRENT_HASH=$(nix store prefetch-file "$URL" --json | jq -r '.hash')
|
||||||
|
|
||||||
|
echo "${ARCH}-${OS}: $CURRENT_HASH"
|
||||||
|
}
|
||||||
|
|
||||||
|
if [[ -z "$VER" && -n "$1" ]]; then
|
||||||
|
VER="$1"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ -z "$VER" ]]; then
|
||||||
|
echo "No 'VER' environment variable provided, skipping"
|
||||||
|
else
|
||||||
|
print_hash "linux" "amd64" "$VER"
|
||||||
|
print_hash "linux" "aarch64" "$VER"
|
||||||
|
print_hash "macos" "amd64" "$VER"
|
||||||
|
print_hash "macos" "aarch64" "$VER"
|
||||||
|
fi
|
||||||
|
|
Loading…
Reference in New Issue
Block a user