From 5907564df065fd0e63cd0b6070a48fa9829ed0b3 Mon Sep 17 00:00:00 2001 From: Tom Cumming Date: Mon, 15 May 2023 23:33:36 +0100 Subject: [PATCH] purescript: Add aarch64-darwin target --- .../compilers/purescript/purescript/default.nix | 17 ++++++++++++----- .../compilers/purescript/purescript/update.sh | 5 +++++ 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/pkgs/development/compilers/purescript/purescript/default.nix b/pkgs/development/compilers/purescript/purescript/default.nix index 2e0eb9534f4f..d7c8394a57b1 100644 --- a/pkgs/development/compilers/purescript/purescript/default.nix +++ b/pkgs/development/compilers/purescript/purescript/default.nix @@ -24,10 +24,17 @@ in stdenv.mkDerivation rec { src = if stdenv.isDarwin then - fetchurl { - url = "https://github.com/${pname}/${pname}/releases/download/v${version}/macos.tar.gz"; - sha256 = "1xxg79rlf7li9f73wdbwif1dyy4hnzpypy6wx4zbnvap53habq9f"; - } + (if stdenv.isAarch64 + then + fetchurl { + url = "https://github.com/${pname}/${pname}/releases/download/v${version}/macos-arm64.tar.gz"; + sha256 = "16ci26pgrw0zmnyn1zj129y9624cqwzrhqglc8mgfg4k7rxvqy2a"; + } + else + fetchurl { + url = "https://123.github.com/${pname}/${pname}/releases/download/v${version}/macos.tar.gz"; + sha256 = "1xxg79rlf7li9f73wdbwif1dyy4hnzpypy6wx4zbnvap53habq9f"; + }) else fetchurl { url = "https://github.com/${pname}/${pname}/releases/download/v${version}/linux64.tar.gz"; @@ -63,7 +70,7 @@ in stdenv.mkDerivation rec { license = licenses.bsd3; sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ]; maintainers = with maintainers; [ justinwoo mbbx6spp cdepillabout ]; - platforms = [ "x86_64-linux" "x86_64-darwin" ]; + platforms = [ "x86_64-linux" "x86_64-darwin" "aarch64-darwin" ]; mainProgram = "purs"; changelog = "https://github.com/purescript/purescript/releases/tag/v${version}"; }; diff --git a/pkgs/development/compilers/purescript/purescript/update.sh b/pkgs/development/compilers/purescript/purescript/update.sh index 1dfb4607affb..259fb8aa5610 100755 --- a/pkgs/development/compilers/purescript/purescript/update.sh +++ b/pkgs/development/compilers/purescript/purescript/update.sh @@ -29,11 +29,16 @@ old_darwin_version_hash="$(nix-prefetch-url "https://github.com/purescript/pures echo "v${old_version} darwin tarball hash (current version): $old_darwin_version_hash" new_darwin_version_hash="$(nix-prefetch-url "https://github.com/purescript/purescript/releases/download/v${new_version}/macos.tar.gz")" echo "v${new_version} darwin tarball hash: $new_darwin_version_hash" +old_darwin_arm_version_hash="$(nix-prefetch-url "https://github.com/purescript/purescript/releases/download/v${old_version}/macos-arm64.tar.gz")" +echo "v${old_version} darwin arm tarball hash (current version): $old_darwin_arm_version_hash" +new_darwin_arm_version_hash="$(nix-prefetch-url "https://github.com/purescript/purescript/releases/download/v${new_version}/macos-arm64.tar.gz")" +echo "v${new_version} darwin arm tarball hash: $new_darwin_arm_version_hash" echo echo "Replacing version and hashes in ${purescript_derivation_file}." sed -i -e "s/${old_linux_version_hash}/${new_linux_version_hash}/" "$purescript_derivation_file" sed -i -e "s/${old_darwin_version_hash}/${new_darwin_version_hash}/" "$purescript_derivation_file" +sed -i -e "s/${old_darwin_arm_version_hash}/${new_darwin_arm_version_hash}/" "$purescript_derivation_file" sed -i -e "s/${old_version}/${new_version}/" "$purescript_derivation_file" echo