summary refs log tree commit diff
path: root/pkgs/applications/science/logic
diff options
context:
space:
mode:
authorRussell O'Connor <roconnor@theorem.ca>2012-05-28 20:53:17 +0000
committerRussell O'Connor <roconnor@theorem.ca>2012-05-28 20:53:17 +0000
commit417a07a0e92e5d3e368193b7cfbf8cfe956e1e34 (patch)
treec71652082ead5cd4af692c0b83366e048eab1fe9 /pkgs/applications/science/logic
parentf02a71103a7edb19d950622ff1970d9e878141e5 (diff)
downloadnixlib-417a07a0e92e5d3e368193b7cfbf8cfe956e1e34.tar
nixlib-417a07a0e92e5d3e368193b7cfbf8cfe956e1e34.tar.gz
nixlib-417a07a0e92e5d3e368193b7cfbf8cfe956e1e34.tar.bz2
nixlib-417a07a0e92e5d3e368193b7cfbf8cfe956e1e34.tar.lz
nixlib-417a07a0e92e5d3e368193b7cfbf8cfe956e1e34.tar.xz
nixlib-417a07a0e92e5d3e368193b7cfbf8cfe956e1e34.tar.zst
nixlib-417a07a0e92e5d3e368193b7cfbf8cfe956e1e34.zip
Updatings ssreflect to depend on camlp5 version 6.
svn path=/nixpkgs/trunk/; revision=34263
Diffstat (limited to 'pkgs/applications/science/logic')
-rw-r--r--pkgs/applications/science/logic/coq/default.nix26
1 files changed, 16 insertions, 10 deletions
diff --git a/pkgs/applications/science/logic/coq/default.nix b/pkgs/applications/science/logic/coq/default.nix
index cfd769fa6a2c..bf759a4a3260 100644
--- a/pkgs/applications/science/logic/coq/default.nix
+++ b/pkgs/applications/science/logic/coq/default.nix
@@ -1,10 +1,16 @@
-# TODO:
-# - coqide compilation should be optional or (better) separate;
+# - coqide compilation can be disabled by setting lablgtk to null;
 
-{stdenv, fetchurl, ocaml, findlib, camlp5, lablgtk, ncurses}:
+{stdenv, fetchurl, ocaml, findlib, camlp5, ncurses, lablgtk ? null}:
 
-let
+let 
   version = "8.3pl4";
+  buildIde = lablgtk != null;
+  ideFlags = if buildIde then "-lablgtkdir ${lablgtk}/lib/ocaml/*/site-lib/lablgtk2 -coqide opt" else "";
+  idePatch = if buildIde then ''
+    substituteInPlace scripts/coqmktop.ml --replace \
+    "\"-I\"; \"+lablgtk2\"" \
+    "\"-I\"; \"$(echo "${lablgtk}"/lib/ocaml/*/site-lib/lablgtk2)\"; \"-I\"; \"$(echo "${lablgtk}"/lib/ocaml/*/site-lib/stublibs)\""
+  '' else "";
 in
 
 stdenv.mkDerivation {
@@ -21,9 +27,10 @@ stdenv.mkDerivation {
 
   preConfigure = ''
     configureFlagsArray=(
+      -opt
       -camldir ${ocaml}/bin
       -camlp5dir $(ocamlfind query camlp5)
-      -lablgtkdir ${lablgtk}/lib/ocaml/*/site-lib/lablgtk2 -opt -coqide opt
+      ${ideFlags}
     )
   '';
 
@@ -36,17 +43,16 @@ stdenv.mkDerivation {
     RM=$(type -tp rm)
     substituteInPlace configure --replace "/bin/uname" "$UNAME"
     substituteInPlace tools/beautify-archive --replace "/bin/rm" "$RM"
-    substituteInPlace scripts/coqmktop.ml --replace \
-      "\"-I\"; \"+lablgtk2\"" \
-      "\"-I\"; \"$(echo "${lablgtk}"/lib/ocaml/*/site-lib/lablgtk2)\"; \"-I\"; \"$(echo "${lablgtk}"/lib/ocaml/*/site-lib/stublibs)\""
+    ${idePatch}
   '';
 
   # This post install step is needed to build ssrcoqide from the ssreflect package
   # It could be made optional, but I see little harm in including it in the default
   # distribution -- roconnor
-  postInstall = ''
+  # This will likely no longer be necessary for coq >= 8.4. -- roconnor
+  postInstall = if buildIde then ''
    cp ide/*.cmi ide/ide.*a $out/lib/coq/ide/
-  '';
+  '' else "";
 
   meta = {
     description = "Coq proof assistant";