From fcbb16841aa036d029a7336bca9afcda9081bdee Mon Sep 17 00:00:00 2001 From: Théo Zimmermann Date: Mon, 2 Jul 2018 13:43:17 +0200 Subject: Adapt default.nix to allow nix-build to run the test-suite. --- default.nix | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) (limited to 'default.nix') diff --git a/default.nix b/default.nix index a2645f4fc..e4834ae3a 100644 --- a/default.nix +++ b/default.nix @@ -9,14 +9,14 @@ # nix-shell supports the --arg option (see Nix doc) that allows you for # instance to do this: -# $ nix-shell --arg ocamlPackages "(import {}).ocamlPackages_latest" --arg buildIde false +# $ nix-shell --arg ocamlPackages "(import {}).ocaml-ng.ocamlPackages_4_05" --arg buildIde false # You can also compile Coq and "install" it by running: # $ make clean # (only needed if you have left-over compilation files) # $ nix-build # at the root of the Coq repository. # nix-build also supports the --arg option, so you will be able to do: -# $ nix-build --arg doCheck false +# $ nix-build --arg doInstallCheck false # if you want to speed up things by not running the test-suite. # Once the build is finished, you will find, in the current directory, # a symlink to where Coq was installed. @@ -25,7 +25,7 @@ , ocamlPackages ? pkgs.ocaml-ng.ocamlPackages_4_06 , buildIde ? true , buildDoc ? true -, doCheck ? true +, doInstallCheck ? true }: with pkgs; @@ -58,13 +58,13 @@ stdenv.mkDerivation rec { ps.antlr4-python3-runtime ps.sphinxcontrib-bibtex ])) antlr4 - ] else []) ++ (if doCheck then + ] else []) ++ (if doInstallCheck then # Test-suite dependencies # ncurses is required to build an OCaml REPL optional (!versionAtLeast ocaml.version "4.07") ncurses ++ [ - python + python2 rsync which ocamlPackages.ounit @@ -90,10 +90,18 @@ stdenv.mkDerivation rec { prefixKey = "-prefix "; - buildFlags = [ "world" ] ++ optional buildDoc "doc-html"; + buildFlags = [ "world" "byte" ] ++ optional buildDoc "doc-html"; - installTargets = [ "install" ] ++ optional buildDoc "install-doc-html"; + installTargets = + [ "install" "install-byte" ] ++ optional buildDoc "install-doc-html"; - inherit doCheck; + inherit doInstallCheck; + + preInstallCheck = '' + patchShebangs tools/ + patchShebangs test-suite/ + ''; + + installCheckTarget = [ "check" ]; } -- cgit v1.2.3