From da2f05037163868a5fb09b96143719ab799b5f69 Mon Sep 17 00:00:00 2001 From: Franck Cuny Date: Sat, 21 Dec 2024 10:40:38 -0800 Subject: support multiple architectures for sapi --- packages/sapi/default.nix | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) (limited to 'packages/sapi') diff --git a/packages/sapi/default.nix b/packages/sapi/default.nix index 8a7adbd..a939685 100644 --- a/packages/sapi/default.nix +++ b/packages/sapi/default.nix @@ -4,13 +4,28 @@ lib, ... }: - +let + version = "1.2.4"; + sources = { + x86_64-darwin = { + url = "https://artifactory.rbx.com:443/artifactory/generic-rbx-local/sapi-cli/darwin-amd64/v${version}/sapi"; + sha256 = "sha256-Il/aqGzxtI84TdUAz4Fvw8RbAgGBZQPN3MZrOitrpVk="; + }; + aarch64-darwin = { + url = "https://artifactory.rbx.com:443/artifactory/generic-rbx-local/sapi-cli/darwin-arm64/v${version}/sapi"; + sha256 = "sha256-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx="; # Replace with actual SHA + }; + }; +in stdenv.mkDerivation rec { pname = "sapi"; - version = "1.2.4"; + inherit version; + src = fetchurl { - url = "https://artifactory.rbx.com:443/artifactory/generic-rbx-local/sapi-cli/darwin-amd64/v${version}/sapi"; - sha256 = "sha256-Il/aqGzxtI84TdUAz4Fvw8RbAgGBZQPN3MZrOitrpVk="; + inherit (sources.${stdenv.hostPlatform.system}) + url + sha256 + ; }; installPhase = '' @@ -26,6 +41,9 @@ stdenv.mkDerivation rec { description = "sapi command-line tool"; homepage = "https://go/sapi"; license = licenses.unfree; - platforms = [ "x86_64-darwin" ]; + platforms = [ + "x86_64-darwin" + "aarch64-darwin" + ]; }; } -- cgit 1.4.1