Merge pull request #176677 from toastal/mlton-20210107
mlton: 20180207 → 20210107
This commit is contained in:
commit
188ca099b7
3 changed files with 75 additions and 5 deletions
60
pkgs/development/compilers/mlton/20210107-binary.nix
Normal file
60
pkgs/development/compilers/mlton/20210107-binary.nix
Normal file
|
@ -0,0 +1,60 @@
|
||||||
|
{ lib, stdenv, fetchurl, patchelf, gmp }:
|
||||||
|
let
|
||||||
|
dynamic-linker = stdenv.cc.bintools.dynamicLinker;
|
||||||
|
in
|
||||||
|
stdenv.mkDerivation rec {
|
||||||
|
pname = "mlton";
|
||||||
|
version = "20210107";
|
||||||
|
|
||||||
|
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";
|
||||||
|
})
|
||||||
|
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";
|
||||||
|
})
|
||||||
|
else
|
||||||
|
throw "Architecture not supported";
|
||||||
|
|
||||||
|
buildInputs = [ gmp ];
|
||||||
|
nativeBuildInputs = lib.optional stdenv.isLinux patchelf;
|
||||||
|
|
||||||
|
buildPhase = ''
|
||||||
|
make update \
|
||||||
|
CC="$(type -p cc)" \
|
||||||
|
WITH_GMP_INC_DIR="${gmp.dev}/include" \
|
||||||
|
WITH_GMP_LIB_DIR="${gmp}/lib"
|
||||||
|
'';
|
||||||
|
|
||||||
|
installPhase = ''
|
||||||
|
make install PREFIX=$out
|
||||||
|
'';
|
||||||
|
|
||||||
|
postFixup = lib.optionalString stdenv.isLinux ''
|
||||||
|
patchelf --set-interpreter ${dynamic-linker} $out/lib/mlton/mlton-compile
|
||||||
|
patchelf --set-rpath ${gmp}/lib $out/lib/mlton/mlton-compile
|
||||||
|
|
||||||
|
for e in mllex mlnlffigen mlprof mlyacc; do
|
||||||
|
patchelf --set-interpreter ${dynamic-linker} $out/bin/$e
|
||||||
|
patchelf --set-rpath ${gmp}/lib $out/bin/$e
|
||||||
|
done
|
||||||
|
'' + lib.optionalString stdenv.isDarwin ''
|
||||||
|
install_name_tool -change \
|
||||||
|
/opt/local/lib/libgmp.10.dylib \
|
||||||
|
${gmp}/lib/libgmp.10.dylib \
|
||||||
|
$out/lib/mlton/mlton-compile
|
||||||
|
|
||||||
|
for e in mllex mlnlffigen mlprof mlyacc; do
|
||||||
|
install_name_tool -change \
|
||||||
|
/opt/local/lib/libgmp.10.dylib \
|
||||||
|
${gmp}/lib/libgmp.10.dylib \
|
||||||
|
$out/bin/$e
|
||||||
|
done
|
||||||
|
'';
|
||||||
|
|
||||||
|
meta = import ./meta.nix;
|
||||||
|
}
|
|
@ -1,9 +1,9 @@
|
||||||
{ callPackage }:
|
{ callPackage }:
|
||||||
|
|
||||||
rec {
|
rec {
|
||||||
mlton20130715 = callPackage ./20130715.nix {};
|
mlton20130715 = callPackage ./20130715.nix { };
|
||||||
|
|
||||||
mlton20180207Binary = callPackage ./20180207-binary.nix {};
|
mlton20180207Binary = callPackage ./20180207-binary.nix { };
|
||||||
|
|
||||||
mlton20180207 = callPackage ./from-git-source.nix {
|
mlton20180207 = callPackage ./from-git-source.nix {
|
||||||
mltonBootstrap = mlton20180207Binary;
|
mltonBootstrap = mlton20180207Binary;
|
||||||
|
@ -12,10 +12,19 @@ rec {
|
||||||
sha256 = "00rdd2di5x1dzac64il9z05m3fdzicjd3226wwjyynv631jj3q2a";
|
sha256 = "00rdd2di5x1dzac64il9z05m3fdzicjd3226wwjyynv631jj3q2a";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
mlton20210107Binary = callPackage ./20210107-binary.nix { };
|
||||||
|
|
||||||
|
mlton20210107 = callPackage ./from-git-source.nix {
|
||||||
|
mltonBootstrap = mlton20180207Binary;
|
||||||
|
version = "20210107";
|
||||||
|
rev = "on-20210117-release";
|
||||||
|
sha256 = "sha256-rqL8lnzVVR+5Hc7sWXK8dCXN92dU76qSoii3/4StODM=";
|
||||||
|
};
|
||||||
|
|
||||||
mltonHEAD = callPackage ./from-git-source.nix {
|
mltonHEAD = callPackage ./from-git-source.nix {
|
||||||
mltonBootstrap = mlton20180207Binary;
|
mltonBootstrap = mlton20180207Binary;
|
||||||
version = "HEAD";
|
version = "HEAD";
|
||||||
rev = "e149c9917cfbfe6aba5c986a958ed76d5cc6cfde";
|
rev = "875f7912a0b135a9a7e86a04ecac9cacf0bfe5e5";
|
||||||
sha256 = "0a0j1i0f0fxw2my1309srq5j3vz0kawrrln01gxms2m5hy5dl50d";
|
sha256 = "sha256-/MIoVqqv8qrJPehU7VRFpXtAAo8UUzE3waEvB7WnS9A=";
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -13599,9 +13599,10 @@ with pkgs;
|
||||||
mlton20130715
|
mlton20130715
|
||||||
mlton20180207Binary
|
mlton20180207Binary
|
||||||
mlton20180207
|
mlton20180207
|
||||||
|
mlton20210107
|
||||||
mltonHEAD;
|
mltonHEAD;
|
||||||
|
|
||||||
mlton = mlton20180207;
|
mlton = mlton20210107;
|
||||||
|
|
||||||
mono = mono6;
|
mono = mono6;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue