purescript: Add aarch64-darwin target

This commit is contained in:
Tom Cumming 2023-05-15 23:33:36 +01:00
parent 89fad28e1f
commit 5907564df0
2 changed files with 17 additions and 5 deletions

@ -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}";
};

@ -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