nixpkgs/pkgs/development/compilers/smlnj/bootstrap.nix

45 lines
1003 B
Nix
Raw Normal View History

{ lib, stdenv, fetchurl, cpio, rsync, xar, makeWrapper }:
stdenv.mkDerivation rec {
pname = "smlnj-bootstrap";
2019-03-19 20:32:01 +00:00
version = "110.91";
src = fetchurl {
url = "http://smlnj.cs.uchicago.edu/dist/working/${version}/smlnj-x86-${version}.pkg";
2019-03-19 20:32:01 +00:00
sha256 = "12jn50h5jz0ac1vzld2mb94p1dyc8h0mk0hip2wj5xqk1dbzwxl4";
};
nativeBuildInputs = [ makeWrapper ];
buildInputs = [ cpio rsync ];
unpackPhase = ''
2019-03-19 20:32:01 +00:00
${xar}/bin/xar -xf $src
cd smlnj.pkg
'';
buildPhase = ''
cat Payload | gunzip -dc | cpio -i
'';
installPhase = ''
2014-07-22 09:01:32 +00:00
mkdir -p $out/bin
rsync -av bin/ $out/bin/
2014-07-22 09:01:32 +00:00
mkdir -p $out/lib
rsync -av lib/ $out/lib/
'';
postInstall = ''
wrapProgram "$out/bin/sml" --set "SMLNJ_HOME" "$out"
'';
meta = {
description = "Compiler for the Standard ML '97 programming language";
homepage = "http://www.smlnj.org";
license = lib.licenses.free;
platforms = lib.platforms.darwin;
maintainers = [ lib.maintainers.jwiegley ];
};
}