about summary refs log tree commit diff
path: root/pkgs/development/compilers
diff options
context:
space:
mode:
authorGabriel Ebner <gebner@gebner.org>2017-10-02 12:19:41 +0200
committerGabriel Ebner <gebner@gebner.org>2017-10-02 12:21:47 +0200
commite10bb692c4db2a94c3c6e03b269390f011ef3841 (patch)
treef0893b26d10a27949299ab0f812fde08d27a6434 /pkgs/development/compilers
parent7049172d7280c3df5ba2d5ce3f2fce7ef268a2cb (diff)
downloadnixlib-e10bb692c4db2a94c3c6e03b269390f011ef3841.tar
nixlib-e10bb692c4db2a94c3c6e03b269390f011ef3841.tar.gz
nixlib-e10bb692c4db2a94c3c6e03b269390f011ef3841.tar.bz2
nixlib-e10bb692c4db2a94c3c6e03b269390f011ef3841.tar.lz
nixlib-e10bb692c4db2a94c3c6e03b269390f011ef3841.tar.xz
nixlib-e10bb692c4db2a94c3c6e03b269390f011ef3841.tar.zst
nixlib-e10bb692c4db2a94c3c6e03b269390f011ef3841.zip
fstar: 0.9.4.0 -> 0.9.5.0
This builds fstar from the included ocaml sources instead of
bootstrapping from fsharp.
Diffstat (limited to 'pkgs/development/compilers')
-rw-r--r--pkgs/development/compilers/fstar/default.nix65
1 files changed, 9 insertions, 56 deletions
diff --git a/pkgs/development/compilers/fstar/default.nix b/pkgs/development/compilers/fstar/default.nix
index 0887dd992526..3aef4e3ba89d 100644
--- a/pkgs/development/compilers/fstar/default.nix
+++ b/pkgs/development/compilers/fstar/default.nix
@@ -1,78 +1,30 @@
-{ stdenv, fetchFromGitHub, mono, fsharp, dotnetPackages, z3, ocamlPackages, openssl, makeWrapper, pkgconfig, file }:
+{ stdenv, fetchFromGitHub, z3, ocamlPackages, makeWrapper }:
 
 stdenv.mkDerivation rec {
   name = "fstar-${version}";
-  version = "0.9.4.0";
+  version = "0.9.5.0";
 
   src = fetchFromGitHub {
     owner = "FStarLang";
     repo = "FStar";
     rev = "v${version}";
-    sha256 = "130779p5plsgvz0dkcqycns3vwrvyfl138nq2xdhd3rkdsbyyvb7";
+    sha256 = "1pi2ny3kpmvm85x8w98anhjf0hp0wccc51m7v697qypn5cl4ydqk";
   };
 
   nativeBuildInputs = [ makeWrapper ];
 
   buildInputs = with ocamlPackages; [
-    mono fsharp z3 dotnetPackages.FsLexYacc ocaml findlib ocaml_batteries
-    zarith camlp4 yojson pprint openssl pkgconfig file
+    z3 ocaml findlib ocaml_batteries menhir stdint
+    zarith camlp4 yojson pprint
   ];
 
-  preBuild = ''
-    substituteInPlace src/Makefile --replace "\$(RUNTIME) VS/.nuget/NuGet.exe" "true" \
-      --replace Darwin xyz
-    substituteInPlace src/VS/.nuget/NuGet.targets --replace "mono" "true"
+  makeFlags = [ "PREFIX=$(out)" ];
 
-    # Fails with bad interpreter otherwise
+  preBuild = ''
     patchShebangs src/tools
     patchShebangs bin
-
-    export FSharpTargetsPath="$(dirname $(pkg-config FSharp.Core --variable=Libraries))/Microsoft.FSharp.Targets"
-    # remove hardcoded windows paths
-    sed -i '/<FSharpTargetsPath/d' src/*/*.fsproj
-
-    mkdir -p src/VS/packages/FsLexYacc.6.1.0
-    ln -s ${dotnetPackages.FsLexYacc}/lib/dotnet/FsLexYacc src/VS/packages/FsLexYacc.6.1.0/build
-  '';
-
-  makeFlags = [
-    "FSYACC=${dotnetPackages.FsLexYacc}/bin/fsyacc"
-    "FSLEX=${dotnetPackages.FsLexYacc}/bin/fslex"
-    "NUGET=true"
-    "PREFIX=$(out)"
-  ];
-
-  buildFlags = "-C src";
-
-  # Now that the .NET fstar.exe is built, use it to build the native OCaml binary
-  postBuild = ''
-    patchShebangs bin/fstar.exe
-
-    # Workaround for fsharp/fsharp#419
-    cp ${fsharp}/lib/mono/4.5/FSharp.Core.dll bin/
-
-    # Use the built .NET binary to extract the sources of itself from F* to OCaml
-    make ''${enableParallelBuilding:+-j''${NIX_BUILD_CORES} -l''${NIX_BUILD_CORES}} \
-        $makeFlags "''${makeFlagsArray[@]}" \
-        ocaml -C src
-
-    # Build the extracted OCaml sources
-    make ''${enableParallelBuilding:+-j''${NIX_BUILD_CORES} -l''${NIX_BUILD_CORES}} \
-        $makeFlags "''${makeFlagsArray[@]}" \
-        -C src/ocaml-output
   '';
-
-  # https://github.com/FStarLang/FStar/issues/676
-  doCheck = false;
-
-  preCheck = "ulimit -s unlimited";
-
-  # Basic test suite:
-  #checkFlags = "VERBOSE=y -C examples";
-
-  # Complete, but heavyweight test suite:
-  checkTarget = "regressions";
-  checkFlags = "VERBOSE=y -C src";
+  buildFlags = "-C src/ocaml-output";
 
   installFlags = "-C src/ocaml-output";
 
@@ -85,5 +37,6 @@ stdenv.mkDerivation rec {
     homepage = https://www.fstar-lang.org;
     license = licenses.asl20;
     platforms = with platforms; darwin ++ linux;
+    maintainers = with maintainers; [ gebner ];
   };
 }