coq-ssreflect: also build and install the documentation

This commit is contained in:
Vincent Laporte 2015-05-28 14:10:39 +02:00
parent 8def3d69c7
commit e6b29c024b

View File

@ -1,4 +1,6 @@
{stdenv, fetchurl, coq}: { stdenv, fetchurl, coq
, graphviz, withDoc ? true
}:
assert coq.coq-version == "8.4"; assert coq.coq-version == "8.4";
@ -11,6 +13,7 @@ stdenv.mkDerivation {
sha256 = "0hm1ha7sxqfqhc7iwhx6zdz3nki4rj5nfd3ab24hmz8v7mlpinds"; sha256 = "0hm1ha7sxqfqhc7iwhx6zdz3nki4rj5nfd3ab24hmz8v7mlpinds";
}; };
nativeBuildInputs = stdenv.lib.optionals withDoc [ graphviz ];
buildInputs = [ coq.ocaml coq.camlp5 ]; buildInputs = [ coq.ocaml coq.camlp5 ];
propagatedBuildInputs = [ coq ]; propagatedBuildInputs = [ coq ];
@ -22,12 +25,17 @@ stdenv.mkDerivation {
sed -i 's/^#SSRCOQ/SSRCOQ/' Make sed -i 's/^#SSRCOQ/SSRCOQ/' Make
''; '';
buildFlags = stdenv.lib.optionalString withDoc "doc";
installFlags = "COQLIB=$(out)/lib/coq/${coq.coq-version}/"; installFlags = "COQLIB=$(out)/lib/coq/${coq.coq-version}/";
postInstall = '' postInstall = ''
mkdir -p $out/bin mkdir -p $out/bin
cp -p bin/ssrcoq $out/bin cp -p bin/ssrcoq $out/bin
cp -p bin/ssrcoq.byte $out/bin cp -p bin/ssrcoq.byte $out/bin
'' + stdenv.lib.optionalString withDoc ''
mkdir -p $out/share/doc/coq/${coq.coq-version}/user-contrib/Ssreflect/
cp -r html $out/share/doc/coq/${coq.coq-version}/user-contrib/Ssreflect/
''; '';
meta = with stdenv.lib; { meta = with stdenv.lib; {