Skip to content

Commit

Permalink
Merge pull request #394 from ckoparkar/master
Browse files Browse the repository at this point in the history
Add a Nix build script
  • Loading branch information
MatthewFluet authored Jul 16, 2020
2 parents a37c7e1 + 7d75728 commit c1bef0d
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions package/nix/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{ pkgs ? import <nixpkgs> {},
stdenv ? pkgs.stdenv,
gcc ? pkgs.gcc,
gmp ? pkgs.gmp,
git ? pkgs.git,
gnumake ? pkgs.gnumake,
binutils ? pkgs.binutils-unwrapped,
bash ? pkgs.bash,
mlton ? pkgs.mlton
}:

stdenv.mkDerivation rec {
name = "mlton";

# The root "mlton" directory.
src = ../../.;

buildInputs = [ gcc gmp git gnumake binutils bash mlton ];

doCheck = true;

buildPhase = ''
find . -type f | grep -v -e '\.tgz''$' | xargs sed -i "s@/usr/bin/env bash@$(type -p bash)@"
make
'';

installPhase = ''
make install PREFIX=$out
'';

}

0 comments on commit c1bef0d

Please sign in to comment.