From cb8d3762a6b0f65e08dd848f54bc48bc8966e9a3 Mon Sep 17 00:00:00 2001 From: Adam Goode Date: Sun, 31 Mar 2024 00:26:52 -0400 Subject: [PATCH 1/2] mlton: bootstrap with 20210117 version This includes fixes for the incorrect hashes copied from 20180207-binary.nix. --- .../compilers/mlton/20210117-binary.nix | 17 +++++++++++++---- pkgs/development/compilers/mlton/default.nix | 4 ++-- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/pkgs/development/compilers/mlton/20210117-binary.nix b/pkgs/development/compilers/mlton/20210117-binary.nix index d4e55d47b94c..60bd31f0fda8 100644 --- a/pkgs/development/compilers/mlton/20210117-binary.nix +++ b/pkgs/development/compilers/mlton/20210117-binary.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetchurl, patchelf, gmp }: +{ lib, stdenv, fetchpatch, fetchurl, patchelf, gmp }: let dynamic-linker = stdenv.cc.bintools.dynamicLinker; in @@ -9,17 +9,26 @@ stdenv.mkDerivation rec { src = if stdenv.hostPlatform.system == "x86_64-linux" then (fetchurl { - url = "https://github.com/MLton/mlton/releases/download/on-${version}-release/${pname}-${version}-1.amd64-linux-glibc2.31.tgz.tgz"; - sha256 = "0f4q575yfm5dpg4a2wsnqn4l2zrar96p6rlsk0dw10ggyfwvsjlf"; + url = "https://github.com/MLton/mlton/releases/download/on-${version}-release/${pname}-${version}-1.amd64-linux-glibc2.31.tgz"; + sha256 = "1lj51xg9p75qj1x5036lvjvd4a2j21kfi6vh8d0n9kdcdffvb73l"; }) else if stdenv.hostPlatform.system == "x86_64-darwin" then (fetchurl { url = "https://github.com/MLton/mlton/releases/download/on-${version}-release/${pname}-${version}-1.amd64-darwin-19.6.gmp-static.tgz"; - sha256 = "1cw7yhw48qp12q0adwf8srpjzrgkp84kmlkqw3pz8vkxz4p9hbdv"; + sha256 = "0xndr2awlxdqr81j6snl9zqjx8r6f5fy9x65j1w899kf2dh9zsjv"; }) else throw "Architecture not supported"; + patches = [ + (fetchpatch { + name = "remove-duplicate-if.patch"; + url = "https://github.com/MLton/mlton/commit/22002cd0a53a1ab84491d74cb8dc6a4e50c1f7b7.patch"; + decode = "sed -e 's|Makefile\.binary|Makefile|g'"; + hash = "sha256-Gtmc+OIh+m7ordSn74fpOKVDQDtYyLHe6Le2snNCBYQ="; + }) + ]; + buildInputs = [ gmp ]; nativeBuildInputs = lib.optional stdenv.isLinux patchelf; diff --git a/pkgs/development/compilers/mlton/default.nix b/pkgs/development/compilers/mlton/default.nix index d2704a4093d0..a74d1d85455b 100644 --- a/pkgs/development/compilers/mlton/default.nix +++ b/pkgs/development/compilers/mlton/default.nix @@ -15,14 +15,14 @@ rec { mlton20210117Binary = callPackage ./20210117-binary.nix { }; mlton20210117 = callPackage ./from-git-source.nix { - mltonBootstrap = mlton20180207Binary; + mltonBootstrap = mlton20210117Binary; version = "20210117"; rev = "on-20210117-release"; sha256 = "sha256-rqL8lnzVVR+5Hc7sWXK8dCXN92dU76qSoii3/4StODM="; }; mltonHEAD = callPackage ./from-git-source.nix { - mltonBootstrap = mlton20180207Binary; + mltonBootstrap = mlton20210117Binary; version = "HEAD"; rev = "875f7912a0b135a9a7e86a04ecac9cacf0bfe5e5"; sha256 = "sha256-/MIoVqqv8qrJPehU7VRFpXtAAo8UUzE3waEvB7WnS9A="; From 83280493512a550f3d44f226573c4c8da043faab Mon Sep 17 00:00:00 2001 From: Adam Goode Date: Sun, 31 Mar 2024 22:13:28 -0400 Subject: [PATCH 2/2] mlton: enable aarch64-darwin --- pkgs/development/compilers/mlton/20210117-binary.nix | 5 +++++ pkgs/development/compilers/mlton/meta.nix | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/pkgs/development/compilers/mlton/20210117-binary.nix b/pkgs/development/compilers/mlton/20210117-binary.nix index 60bd31f0fda8..810974e61ac4 100644 --- a/pkgs/development/compilers/mlton/20210117-binary.nix +++ b/pkgs/development/compilers/mlton/20210117-binary.nix @@ -17,6 +17,11 @@ stdenv.mkDerivation rec { url = "https://github.com/MLton/mlton/releases/download/on-${version}-release/${pname}-${version}-1.amd64-darwin-19.6.gmp-static.tgz"; sha256 = "0xndr2awlxdqr81j6snl9zqjx8r6f5fy9x65j1w899kf2dh9zsjv"; }) + else if stdenv.hostPlatform.system == "aarch64-darwin" then + (fetchurl { + url = "https://projects.laas.fr/tina/software/mlton-${version}-1.arm64-darwin-21.6-gmp-static.tgz"; + sha256 = "1s61ayk3yj2xw8ilqk3fhb03x5x1wcakkmbhhvcsfb2hdw2c932x"; + }) else throw "Architecture not supported"; diff --git a/pkgs/development/compilers/mlton/meta.nix b/pkgs/development/compilers/mlton/meta.nix index 1e4c0aacfc3c..afb11847adb6 100644 --- a/pkgs/development/compilers/mlton/meta.nix +++ b/pkgs/development/compilers/mlton/meta.nix @@ -11,5 +11,5 @@ homepage = "http://mlton.org/"; license = "bsd"; - platforms = [ "i686-linux" "x86_64-linux" "x86_64-darwin"]; + platforms = [ "i686-linux" "x86_64-linux" "x86_64-darwin" "aarch64-darwin"]; }