From e6b29c024be556362552b6879534e4d372bd8dfd Mon Sep 17 00:00:00 2001 From: Vincent Laporte Date: Thu, 28 May 2015 14:10:39 +0200 Subject: [PATCH 1/5] coq-ssreflect: also build and install the documentation --- pkgs/development/coq-modules/ssreflect/default.nix | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/pkgs/development/coq-modules/ssreflect/default.nix b/pkgs/development/coq-modules/ssreflect/default.nix index 75112ec96639..bb91c3e270b6 100644 --- a/pkgs/development/coq-modules/ssreflect/default.nix +++ b/pkgs/development/coq-modules/ssreflect/default.nix @@ -1,4 +1,6 @@ -{stdenv, fetchurl, coq}: +{ stdenv, fetchurl, coq +, graphviz, withDoc ? true +}: assert coq.coq-version == "8.4"; @@ -11,6 +13,7 @@ stdenv.mkDerivation { sha256 = "0hm1ha7sxqfqhc7iwhx6zdz3nki4rj5nfd3ab24hmz8v7mlpinds"; }; + nativeBuildInputs = stdenv.lib.optionals withDoc [ graphviz ]; buildInputs = [ coq.ocaml coq.camlp5 ]; propagatedBuildInputs = [ coq ]; @@ -22,12 +25,17 @@ stdenv.mkDerivation { sed -i 's/^#SSRCOQ/SSRCOQ/' Make ''; + buildFlags = stdenv.lib.optionalString withDoc "doc"; + installFlags = "COQLIB=$(out)/lib/coq/${coq.coq-version}/"; postInstall = '' mkdir -p $out/bin cp -p bin/ssrcoq $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; { From 0f6b981fbabf22cc816fe09846e6452e22ea6ae2 Mon Sep 17 00:00:00 2001 From: Vincent Laporte Date: Thu, 28 May 2015 14:11:58 +0200 Subject: [PATCH 2/5] coq-mathcomp: also build and install the documentation --- pkgs/development/coq-modules/mathcomp/default.nix | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/pkgs/development/coq-modules/mathcomp/default.nix b/pkgs/development/coq-modules/mathcomp/default.nix index 02d06edd538b..9ebfba98d836 100644 --- a/pkgs/development/coq-modules/mathcomp/default.nix +++ b/pkgs/development/coq-modules/mathcomp/default.nix @@ -1,4 +1,6 @@ -{stdenv, fetchurl, coq, ssreflect}: +{ stdenv, fetchurl, coq, ssreflect +, graphviz, ocaml, withDoc ? true +}: stdenv.mkDerivation { @@ -9,12 +11,19 @@ stdenv.mkDerivation { sha256 = "1297svwi18blrlyd8vsqilar2h5nfixlvlifdkbx47aljq4m5bam"; }; + nativeBuildInputs = stdenv.lib.optionals withDoc [ graphviz ocaml ]; propagatedBuildInputs = [ coq ssreflect ]; enableParallelBuilding = true; + buildFlags = stdenv.lib.optionalString withDoc "doc"; + installFlags = "COQLIB=$(out)/lib/coq/${coq.coq-version}/"; + postInstall = stdenv.lib.optionalString withDoc '' + make -f Makefile.coq install-doc DOCDIR=$out/share/coq/${coq.coq-version}/ + ''; + meta = with stdenv.lib; { homepage = http://ssr.msr-inria.inria.fr/; license = licenses.cecill-b; From 524b7fe178e7ff909d9eef1e8fab78e227076de7 Mon Sep 17 00:00:00 2001 From: Vincent Laporte Date: Thu, 28 May 2015 16:09:05 +0200 Subject: [PATCH 3/5] coq-ssreflect: refactor --- .../coq-modules/ssreflect/default.nix | 47 +++++-------------- .../ssreflect/{1.5.nix => generic.nix} | 22 +++++---- pkgs/top-level/all-packages.nix | 15 +++--- 3 files changed, 33 insertions(+), 51 deletions(-) rename pkgs/development/coq-modules/ssreflect/{1.5.nix => generic.nix} (59%) diff --git a/pkgs/development/coq-modules/ssreflect/default.nix b/pkgs/development/coq-modules/ssreflect/default.nix index bb91c3e270b6..a0b0d951c0df 100644 --- a/pkgs/development/coq-modules/ssreflect/default.nix +++ b/pkgs/development/coq-modules/ssreflect/default.nix @@ -1,48 +1,27 @@ -{ stdenv, fetchurl, coq -, graphviz, withDoc ? true -}: +{ callPackage, fetchurl, coq }: -assert coq.coq-version == "8.4"; +if coq.coq-version == "8.4" then -stdenv.mkDerivation { - - name = "coq-ssreflect-1.5"; +callPackage ./generic.nix { src = fetchurl { url = http://ssr.msr-inria.inria.fr/FTP/ssreflect-1.5.tar.gz; sha256 = "0hm1ha7sxqfqhc7iwhx6zdz3nki4rj5nfd3ab24hmz8v7mlpinds"; }; - nativeBuildInputs = stdenv.lib.optionals withDoc [ graphviz ]; - buildInputs = [ coq.ocaml coq.camlp5 ]; - propagatedBuildInputs = [ coq ]; +} - enableParallelBuilding = true; +else if coq.coq-version == "8.5" then - patchPhase = '' - # Permit building of the ssrcoq statically-bound executable - sed -i 's/^#-custom/-custom/' Make - sed -i 's/^#SSRCOQ/SSRCOQ/' Make - ''; +callPackage ./generic.nix { - buildFlags = stdenv.lib.optionalString withDoc "doc"; - - installFlags = "COQLIB=$(out)/lib/coq/${coq.coq-version}/"; - - postInstall = '' - mkdir -p $out/bin - cp -p bin/ssrcoq $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; { - homepage = http://ssr.msr-inria.inria.fr/; - license = licenses.cecill-b; - maintainers = with maintainers; [ vbgl jwiegley ]; - platforms = coq.meta.platforms; + src = fetchurl { + url = http://ssr.msr-inria.inria.fr/FTP/ssreflect-1.5.coq85beta2.tar.gz; + sha256 = "084l9xd5vgb8jml0dkm66g8cil5rsf04w821pjhn2qk9mdbwaagf"; }; + patches = [ ./threads.patch ]; + } + +else throw "No ssreflect package for Coq version ${coq.coq-version}" diff --git a/pkgs/development/coq-modules/ssreflect/1.5.nix b/pkgs/development/coq-modules/ssreflect/generic.nix similarity index 59% rename from pkgs/development/coq-modules/ssreflect/1.5.nix rename to pkgs/development/coq-modules/ssreflect/generic.nix index 7c16b43ba8cb..dffa895da5fc 100644 --- a/pkgs/development/coq-modules/ssreflect/1.5.nix +++ b/pkgs/development/coq-modules/ssreflect/generic.nix @@ -1,22 +1,21 @@ -{stdenv, fetchurl, coq}: - -assert coq.coq-version == "8.5"; +{ stdenv, fetchurl, coq +, graphviz, withDoc ? true +, src, patches ? [] +}: stdenv.mkDerivation { - name = "coq-ssreflect-1.5-8.5b2"; + name = "coq-${coq.coq-version}-ssreflect-1.5"; - src = fetchurl { - url = http://ssr.msr-inria.inria.fr/FTP/ssreflect-1.5.coq85beta2.tar.gz; - sha256 = "084l9xd5vgb8jml0dkm66g8cil5rsf04w821pjhn2qk9mdbwaagf"; - }; + inherit src; + nativeBuildInputs = stdenv.lib.optionals withDoc [ graphviz ]; buildInputs = [ coq.ocaml coq.camlp5 ]; propagatedBuildInputs = [ coq ]; enableParallelBuilding = true; - patches = [ ./threads.patch ]; + inherit patches; postPatch = '' # Permit building of the ssrcoq statically-bound executable @@ -24,12 +23,17 @@ stdenv.mkDerivation { sed -i 's/^#SSRCOQ/SSRCOQ/' Make ''; + buildFlags = stdenv.lib.optionalString withDoc "doc"; + installFlags = "COQLIB=$(out)/lib/coq/${coq.coq-version}/"; postInstall = '' mkdir -p $out/bin cp -p bin/ssrcoq $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; { diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index bc4a490902da..ef80fcd5e088 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -14090,19 +14090,18 @@ let mkCoqPackages_8_5 = self: let callPackage = newScope self; in rec { - mathcomp = callPackage ../development/coq-modules/mathcomp/1.5.nix { - coq = coq_8_5; - ssreflect = ssreflect; - }; + inherit callPackage; - ssreflect = callPackage ../development/coq-modules/ssreflect/1.5.nix { - coq = coq_8_5; - }; + coq = coq_8_5; + + mathcomp = callPackage ../development/coq-modules/mathcomp/1.5.nix { }; + + ssreflect = callPackage ../development/coq-modules/ssreflect { }; }; coqPackages = recurseIntoAttrs (mkCoqPackages_8_4 coqPackages); - coqPackages_8_5 = recurseIntoAttrs (mkCoqPackages_8_5 coqPackages); + coqPackages_8_5 = recurseIntoAttrs (mkCoqPackages_8_5 coqPackages_8_5); cvc3 = callPackage ../applications/science/logic/cvc3 {}; cvc4 = callPackage ../applications/science/logic/cvc4 {}; From 01571ab2d796d136987c8759fe9b7347ea9a7720 Mon Sep 17 00:00:00 2001 From: Vincent Laporte Date: Thu, 28 May 2015 20:31:12 +0200 Subject: [PATCH 4/5] coq-mathcomp: refactor --- pkgs/development/coq-modules/mathcomp/1.5.nix | 26 ----------- .../coq-modules/mathcomp/default.nix | 43 +++++++------------ .../coq-modules/mathcomp/generic.nix | 33 ++++++++++++++ pkgs/top-level/all-packages.nix | 4 +- 4 files changed, 52 insertions(+), 54 deletions(-) delete mode 100644 pkgs/development/coq-modules/mathcomp/1.5.nix create mode 100644 pkgs/development/coq-modules/mathcomp/generic.nix diff --git a/pkgs/development/coq-modules/mathcomp/1.5.nix b/pkgs/development/coq-modules/mathcomp/1.5.nix deleted file mode 100644 index c984bab49171..000000000000 --- a/pkgs/development/coq-modules/mathcomp/1.5.nix +++ /dev/null @@ -1,26 +0,0 @@ -{stdenv, fetchurl, coq, ssreflect}: - -stdenv.mkDerivation { - - name = "coq-mathcomp-1.5-8.5b2"; - - src = fetchurl { - url = http://ssr.msr-inria.inria.fr/FTP/mathcomp-1.5.coq85beta2.tar.gz; - sha256 = "03bnq44ym43x8shi7whc02l0g5vy6rx8f1imjw478chlgwcxazqy"; - }; - - propagatedBuildInputs = [ coq ssreflect ]; - - enableParallelBuilding = true; - - installFlags = "COQLIB=$(out)/lib/coq/${coq.coq-version}/"; - - meta = with stdenv.lib; { - homepage = http://ssr.msr-inria.inria.fr/; - license = licenses.cecill-b; - maintainers = [ maintainers.vbgl maintainers.jwiegley ]; - platforms = coq.meta.platforms; - hydraPlatforms = []; - }; - -} diff --git a/pkgs/development/coq-modules/mathcomp/default.nix b/pkgs/development/coq-modules/mathcomp/default.nix index 9ebfba98d836..7c34e186717c 100644 --- a/pkgs/development/coq-modules/mathcomp/default.nix +++ b/pkgs/development/coq-modules/mathcomp/default.nix @@ -1,35 +1,24 @@ -{ stdenv, fetchurl, coq, ssreflect -, graphviz, ocaml, withDoc ? true -}: +{ callPackage, coq, fetchurl }: -stdenv.mkDerivation { +let src = + if coq.coq-version == "8.4" then - name = "coq-mathcomp-1.5"; + fetchurl { + url = http://ssr.msr-inria.inria.fr/FTP/mathcomp-1.5.tar.gz; + sha256 = "1297svwi18blrlyd8vsqilar2h5nfixlvlifdkbx47aljq4m5bam"; + } - src = fetchurl { - url = http://ssr.msr-inria.inria.fr/FTP/mathcomp-1.5.tar.gz; - sha256 = "1297svwi18blrlyd8vsqilar2h5nfixlvlifdkbx47aljq4m5bam"; - }; + else if coq.coq-version == "8.5" then - nativeBuildInputs = stdenv.lib.optionals withDoc [ graphviz ocaml ]; - propagatedBuildInputs = [ coq ssreflect ]; + fetchurl { + url = http://ssr.msr-inria.inria.fr/FTP/mathcomp-1.5.coq85beta2.tar.gz; + sha256 = "03bnq44ym43x8shi7whc02l0g5vy6rx8f1imjw478chlgwcxazqy"; + } - enableParallelBuilding = true; + else throw "No mathcomp package for Coq version ${coq.coq-version}"; - buildFlags = stdenv.lib.optionalString withDoc "doc"; - - installFlags = "COQLIB=$(out)/lib/coq/${coq.coq-version}/"; - - postInstall = stdenv.lib.optionalString withDoc '' - make -f Makefile.coq install-doc DOCDIR=$out/share/coq/${coq.coq-version}/ - ''; - - meta = with stdenv.lib; { - homepage = http://ssr.msr-inria.inria.fr/; - license = licenses.cecill-b; - maintainers = [ maintainers.vbgl maintainers.jwiegley ]; - platforms = coq.meta.platforms; - hydraPlatforms = []; - }; +in +callPackage ./generic.nix { + inherit src; } diff --git a/pkgs/development/coq-modules/mathcomp/generic.nix b/pkgs/development/coq-modules/mathcomp/generic.nix new file mode 100644 index 000000000000..3748152b68a7 --- /dev/null +++ b/pkgs/development/coq-modules/mathcomp/generic.nix @@ -0,0 +1,33 @@ +{ stdenv, fetchurl, coq, ssreflect +, graphviz, ocamlPackages, withDoc ? true +, src +}: + +stdenv.mkDerivation { + + name = "coq-${coq.coq-version}-mathcomp-1.5"; + + inherit src; + + nativeBuildInputs = stdenv.lib.optionals withDoc + ([ graphviz ] ++ (with ocamlPackages; [ ocaml camlp5_transitional ])); + propagatedBuildInputs = [ ssreflect ]; + + enableParallelBuilding = true; + + buildFlags = stdenv.lib.optionalString withDoc "doc"; + + installFlags = "COQLIB=$(out)/lib/coq/${coq.coq-version}/"; + + postInstall = stdenv.lib.optionalString withDoc '' + make -f Makefile.coq install-doc DOCDIR=$out/share/coq/${coq.coq-version}/ + ''; + + meta = with stdenv.lib; { + homepage = http://ssr.msr-inria.inria.fr/; + license = licenses.cecill-b; + maintainers = [ maintainers.vbgl maintainers.jwiegley ]; + platforms = coq.meta.platforms; + }; + +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index ef80fcd5e088..0959b25fad51 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -14048,6 +14048,8 @@ let mkCoqPackages_8_4 = self: let callPackage = newScope self; in { + inherit callPackage; + bedrock = callPackage ../development/coq-modules/bedrock {}; contribs = @@ -14094,7 +14096,7 @@ let coq = coq_8_5; - mathcomp = callPackage ../development/coq-modules/mathcomp/1.5.nix { }; + mathcomp = callPackage ../development/coq-modules/mathcomp { }; ssreflect = callPackage ../development/coq-modules/ssreflect { }; From cd3a7d5be6f9ae699fd4d1f3f4101fa31ba96ed6 Mon Sep 17 00:00:00 2001 From: Vincent Laporte Date: Wed, 17 Jun 2015 11:06:51 +0200 Subject: [PATCH 5/5] ssreflect, mathcomp: better package names --- pkgs/development/coq-modules/mathcomp/generic.nix | 2 +- pkgs/development/coq-modules/ssreflect/generic.nix | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/coq-modules/mathcomp/generic.nix b/pkgs/development/coq-modules/mathcomp/generic.nix index 3748152b68a7..56838734b6d3 100644 --- a/pkgs/development/coq-modules/mathcomp/generic.nix +++ b/pkgs/development/coq-modules/mathcomp/generic.nix @@ -5,7 +5,7 @@ stdenv.mkDerivation { - name = "coq-${coq.coq-version}-mathcomp-1.5"; + name = "coq-mathcomp-1.5-${coq.coq-version}"; inherit src; diff --git a/pkgs/development/coq-modules/ssreflect/generic.nix b/pkgs/development/coq-modules/ssreflect/generic.nix index dffa895da5fc..e208f1cc25a8 100644 --- a/pkgs/development/coq-modules/ssreflect/generic.nix +++ b/pkgs/development/coq-modules/ssreflect/generic.nix @@ -5,7 +5,7 @@ stdenv.mkDerivation { - name = "coq-${coq.coq-version}-ssreflect-1.5"; + name = "coq-ssreflect-1.5-${coq.coq-version}"; inherit src;