Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1# This derivation should be redundant, now that regular smlnj works on Darwin, 2# and is preserved only for pre-existing direct usage. New use cases should 3# just use the regular smlnj derivation. 4 5{ 6 lib, 7 stdenv, 8 fetchurl, 9 cpio, 10 rsync, 11 xar, 12 makeWrapper, 13}: 14 15stdenv.mkDerivation rec { 16 pname = "smlnj-bootstrap"; 17 18 version = "110.91"; 19 20 src = fetchurl { 21 url = "http://smlnj.cs.uchicago.edu/dist/working/${version}/smlnj-x86-${version}.pkg"; 22 sha256 = "12jn50h5jz0ac1vzld2mb94p1dyc8h0mk0hip2wj5xqk1dbzwxl4"; 23 }; 24 25 nativeBuildInputs = [ makeWrapper ]; 26 buildInputs = [ 27 cpio 28 rsync 29 ]; 30 31 unpackPhase = '' 32 ${xar}/bin/xar -xf $src 33 cd smlnj.pkg 34 ''; 35 36 buildPhase = '' 37 cat Payload | gunzip -dc | cpio -i 38 ''; 39 40 installPhase = '' 41 mkdir -p $out/bin 42 rsync -av bin/ $out/bin/ 43 44 mkdir -p $out/lib 45 rsync -av lib/ $out/lib/ 46 ''; 47 48 postInstall = '' 49 wrapProgram "$out/bin/sml" --set "SMLNJ_HOME" "$out" 50 ''; 51 52 meta = { 53 description = "Compiler for the Standard ML '97 programming language"; 54 homepage = "http://www.smlnj.org"; 55 license = lib.licenses.free; 56 platforms = lib.platforms.darwin; 57 maintainers = [ lib.maintainers.jwiegley ]; 58 mainProgram = "sml"; 59 }; 60}