2018-10-12 04:30:48 +00:00
|
|
|
{ fetchgit
|
|
|
|
, gmp
|
|
|
|
, mltonBootstrap
|
|
|
|
, url ? "https://github.com/mlton/mlton"
|
|
|
|
, rev
|
|
|
|
, sha256
|
|
|
|
, stdenv
|
|
|
|
, version
|
2020-09-09 17:29:57 +00:00
|
|
|
, which
|
2018-10-12 04:30:48 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
2019-08-13 21:52:01 +00:00
|
|
|
pname = "mlton";
|
|
|
|
inherit version;
|
2018-10-12 04:30:48 +00:00
|
|
|
|
|
|
|
src = fetchgit {
|
|
|
|
inherit url rev sha256;
|
|
|
|
};
|
|
|
|
|
2020-09-09 17:29:57 +00:00
|
|
|
nativeBuildInputs = [ which ];
|
|
|
|
|
2018-10-12 04:30:48 +00:00
|
|
|
buildInputs = [mltonBootstrap gmp];
|
|
|
|
|
2022-02-02 11:19:55 +00:00
|
|
|
# build fails otherwise
|
|
|
|
enableParallelBuilding = false;
|
|
|
|
|
2018-10-12 04:30:48 +00:00
|
|
|
preBuild = ''
|
2018-10-12 04:36:07 +00:00
|
|
|
find . -type f | grep -v -e '\.tgz''$' | xargs sed -i "s@/usr/bin/env bash@$(type -p bash)@"
|
2020-09-10 15:11:26 +00:00
|
|
|
sed -i "s|/tmp|$TMPDIR|" bin/regression
|
2018-10-12 04:36:07 +00:00
|
|
|
|
2018-10-12 04:30:48 +00:00
|
|
|
makeFlagsArray=(
|
|
|
|
MLTON_VERSION="${version} ${rev}"
|
|
|
|
CC="$(type -p cc)"
|
|
|
|
PREFIX="$out"
|
|
|
|
WITH_GMP_INC_DIR="${gmp.dev}/include"
|
|
|
|
WITH_GMP_LIB_DIR="${gmp}/lib"
|
|
|
|
)
|
|
|
|
'';
|
|
|
|
|
|
|
|
doCheck = true;
|
|
|
|
|
|
|
|
meta = import ./meta.nix;
|
|
|
|
}
|