diff options
| author | Maxime Dénès | 2017-11-23 10:27:53 +0100 |
|---|---|---|
| committer | Maxime Dénès | 2017-11-23 10:27:53 +0100 |
| commit | 4bdde23f9544400a8d1b7ea7fc27f7b160524090 (patch) | |
| tree | 974b28360809dd71a0c650145936fdc5d1f872cc /default.nix | |
| parent | 6f8aabaed476c2d47f3ed7c3eccd0e77295d5465 (diff) | |
| parent | 25904a7915c7586d4e39416d6cc87d433ff8f95e (diff) | |
Merge PR #6123: Nix file
Diffstat (limited to 'default.nix')
| -rw-r--r-- | default.nix | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/default.nix b/default.nix new file mode 100644 index 0000000000..9efabdbc2d --- /dev/null +++ b/default.nix @@ -0,0 +1,64 @@ +# How to use? + +# If you have Nix installed, you can get in an environment with everything +# needed to compile Coq and CoqIDE by running: +# $ nix-shell +# at the root of the Coq repository. + +# How to tweak default arguments? + +# nix-shell supports the --arg option (see Nix doc) that allows you for +# instance to do this: +# $ nix-shell --arg ocamlPackages "(import <nixpkgs> {}).ocamlPackages_latest" --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 +# 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. + +{ pkgs ? (import <nixpkgs> {}), ocamlPackages ? pkgs.ocamlPackages, + buildIde ? true, doCheck ? true }: + +with pkgs; + +stdenv.mkDerivation rec { + + name = "coq"; + + buildInputs = (with ocamlPackages; [ + + # Coq dependencies + ocaml + findlib + camlp5_strict + + ]) ++ (if buildIde then [ + + # CoqIDE dependencies + ocamlPackages.lablgtk + + ] else []) ++ (if doCheck then [ + + # Test-suite dependencies + python + rsync + which + + ] else []); + + src = + if lib.inNixShell then null + else + with builtins; filterSource + (path: _: !elem (baseNameOf path) [".git" "result" "bin"]) ./.; + + prefixKey = "-prefix "; + + inherit doCheck; + +} |
