nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 fetchgit,
4 gmp,
5 mltonBootstrap,
6 url ? "https://github.com/mlton/mlton",
7 rev,
8 sha256,
9 stdenv,
10 version,
11 which,
12 doCheck ? true,
13}:
14
15stdenv.mkDerivation {
16 pname = "mlton";
17 inherit version doCheck;
18
19 src = fetchgit {
20 inherit url rev sha256;
21 };
22
23 nativeBuildInputs = [
24 which
25 mltonBootstrap
26 ];
27
28 buildInputs = [ gmp ];
29
30 strictDeps = true;
31
32 # build fails otherwise
33 enableParallelBuilding = false;
34
35 preBuild = ''
36 find . -type f | grep -v -e '\.tgz''$' | xargs sed -i "s@/usr/bin/env bash@$(type -p bash)@"
37 sed -i "s|/tmp|$TMPDIR|" bin/regression
38
39 makeFlagsArray=(
40 MLTON_VERSION="${version} ${rev}"
41 CC="$(type -p cc)"
42 PREFIX="$out"
43 WITH_GMP_INC_DIR="${gmp.dev}/include"
44 WITH_GMP_LIB_DIR="${gmp}/lib"
45 )
46 '';
47
48 meta = import ./meta.nix { inherit lib; };
49}