aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--default.nix64
-rw-r--r--test-suite/Makefile4
2 files changed, 66 insertions, 2 deletions
diff --git a/default.nix b/default.nix
new file mode 100644
index 000000000..9efabdbc2
--- /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;
+
+}
diff --git a/test-suite/Makefile b/test-suite/Makefile
index 61e75fa5d..bfba94072 100644
--- a/test-suite/Makefile
+++ b/test-suite/Makefile
@@ -174,7 +174,7 @@ summary.log:
# if not on travis we can get the log files (they're just there for a
# local build, and downloadable on GitLab)
report: summary.log
- $(HIDE)./save-logs.sh
+ $(HIDE)bash save-logs.sh
$(HIDE)if [ -n "${TRAVIS}" ]; then find logs/ -name '*.log' -not -name 'summary.log' -exec 'bash' '-c' 'echo "travis_fold:start:coq.logs.$$(echo '{}' | sed s,/,.,g)"' ';' -exec cat '{}' ';' -exec 'bash' '-c' 'echo "travis_fold:end:coq.logs.$$(echo '{}' | sed s,/,.,g)"' ';'; fi
$(HIDE)if [ -n "${APPVEYOR}" ]; then find logs/ -name '*.log' -not -name 'summary.log' -exec 'bash' '-c' 'echo {}' ';' -exec cat '{}' ';' -exec 'bash' '-c' 'echo' ';'; fi
$(HIDE)if grep -q -F 'Error!' summary.log ; then echo FAILURES; grep -F 'Error!' summary.log; false; else echo NO FAILURES; fi
@@ -528,7 +528,7 @@ coq-makefile/%.log : coq-makefile/%/run.sh
$(HIDE)(\
export COQBIN=$(BIN);\
cd coq-makefile/$* && \
- ./run.sh 2>&1; \
+ bash run.sh 2>&1; \
if [ $$? = 0 ]; then \
echo $(log_success); \
echo " $<...Ok"; \