about summary refs log tree commit diff
path: root/doc/language-support.xml
diff options
context:
space:
mode:
authorVincent Laporte <Vincent.Laporte@gmail.com>2014-09-28 22:02:36 +0100
committerVincent Laporte <Vincent.Laporte@gmail.com>2014-09-28 22:02:36 +0100
commita65767a0b42e91f711e655820d6b76bd51265847 (patch)
tree2144b86225dccd5ddc04da957a275152c9990c4a /doc/language-support.xml
parent94828070ed293043eefcde0ad179145c803eb6ef (diff)
downloadnixlib-a65767a0b42e91f711e655820d6b76bd51265847.tar
nixlib-a65767a0b42e91f711e655820d6b76bd51265847.tar.gz
nixlib-a65767a0b42e91f711e655820d6b76bd51265847.tar.bz2
nixlib-a65767a0b42e91f711e655820d6b76bd51265847.tar.lz
nixlib-a65767a0b42e91f711e655820d6b76bd51265847.tar.xz
nixlib-a65767a0b42e91f711e655820d6b76bd51265847.tar.zst
nixlib-a65767a0b42e91f711e655820d6b76bd51265847.zip
nixpkgs manual: packaging coq libraries
Diffstat (limited to 'doc/language-support.xml')
-rw-r--r--doc/language-support.xml36
1 files changed, 36 insertions, 0 deletions
diff --git a/doc/language-support.xml b/doc/language-support.xml
index 79b56c572d69..5e49121e695b 100644
--- a/doc/language-support.xml
+++ b/doc/language-support.xml
@@ -377,6 +377,42 @@ fileSystem = buildLuaPackage {
 
 </section>
 
+<section xml:id="ssec-language-coq"><title>Coq</title>
+  <para>
+    Coq libraries should be installed in
+    <literal>$(out)/lib/coq/${coq.coq-version}/user-contrib/</literal>.
+    Such directories are automatically added to the
+    <literal>$COQPATH</literal> environment variable by the hook defined
+    in the Coq derivation.
+  </para>
+  <para>
+    Some libraries require OCaml and sometimes also Camlp5. The exact
+    versions that were used to build Coq are saved in the
+    <literal>coq.ocaml</literal> and <literal>coq.camlp5</literal>
+    attributes.
+  </para>
+  <para>
+    Here is a simple package example. It is a pure Coq library, thus it
+    only depends on Coq. Its <literal>makefile</literal> has been
+    generated using <literal>coq_makefile</literal> so we only have to
+    set the <literal>$COQLIB</literal> variable at install time.
+  </para>
+  <programlisting>
+{stdenv, fetchurl, coq}:
+stdenv.mkDerivation {
+  src = fetchurl {
+    url = http://coq.inria.fr/pylons/contribs/files/Karatsuba/v8.4/Karatsuba.tar.gz;
+    sha256 = "0ymfpv4v49k4fm63nq6gcl1hbnnxrvjjp7yzc4973n49b853c5b1";
+  };
+
+  name = "coq-karatsuba";
+
+  buildInputs = [ coq ];
+
+  installFlags = "COQLIB=$(out)/lib/coq/${coq.coq-version}/";
+}
+</programlisting>
+</section>
 
 <!--
 <section><title>Haskell</title>