Unverified Commit b4551924 authored by Vincent Laporte's avatar Vincent Laporte Committed by GitHub
Browse files

Merge pull request #32737 from vbgl/coq-packages-filter

Tidy up the Coq package sets
parents 982cd565 fcb89df1
Loading
Loading
Loading
Loading
+35 −13
Original line number Diff line number Diff line
@@ -11,31 +11,53 @@
    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
    Some libraries require OCaml and sometimes also Camlp5 or findlib.
    The exact versions that were used to build Coq are saved in the
    <literal>coq.ocaml</literal> and <literal>coq.camlp5</literal>
    attributes.
    and <literal>coq.findlib</literal> attributes.
  </para>
  <para>
    Coq libraries may be compatible with some specific versions of Coq only.
    The <liberal>compatibleCoqVersions</liberal> attribute is used to
    precisely select those versions of Coq that are compatible with this
    derivation.
  </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
    depends on Coq. It builds on the Mathematical Components library, thus it
    also takes <literal>mathcomp</literal> as <literal>buildInputs</literal>.
    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";
  };
{ stdenv, fetchFromGitHub, coq, mathcomp }:

  name = "coq-karatsuba";
stdenv.mkDerivation rec {
  name = "coq${coq.coq-version}-multinomials-${version}";
  version = "1.0";
  src = fetchFromGitHub {
    owner = "math-comp";
    repo = "multinomials";
    rev = version;
    sha256 = "1qmbxp1h81cy3imh627pznmng0kvv37k4hrwi2faa101s6bcx55m";
  };

  buildInputs = [ coq ];
  propagatedBuildInputs = [ mathcomp ];

  installFlags = "COQLIB=$(out)/lib/coq/${coq.coq-version}/";

  meta = {
    description = "A Coq/SSReflect Library for Monoidal Rings and Multinomials";
    inherit (src.meta) homepage;
    license = stdenv.lib.licenses.cecill-b;
    inherit (coq.meta) platforms;
  };

  passthru = {
    compatibleCoqVersions = v: builtins.elem v [ "8.5" "8.6" "8.7" ];
  };
}
</programlisting>
</section>
+1 −2
Original line number Diff line number Diff line
@@ -9,7 +9,7 @@
, ocamlPackages, ncurses
, buildIde ? true
, csdp ? null
, version ? "8.6.1"
, version ? "8.7.1"
}:

let
@@ -19,7 +19,6 @@ let
   "8.5pl3"    = "15c3rdk59nifzihsp97z4vjxis5xmsnrvpb86qiazj143z2fmdgw";
   "8.6"       = "148mb48zpdax56c0blfi7v67lx014lnmrvxxasi28hsibyz2lvg4";
   "8.6.1"     = "0llrxcxwy5j87vbbjnisw42rfw1n1pm5602ssx64xaxx3k176g6l";
   "8.7+beta2" = "1r274m44z774xigvj43g211ms9z9bwgyp1g43rvq4fswb3gzxc4b";
   "8.7.0"     = "1h18b7xpnx3ix9vsi5fx4zdcbxy7bhra7gd5c5yzxmk53cgf1p9m";
   "8.7.1"     = "0gjn59jkbxwrihk8fx9d823wjyjh5m9gvj9l31nv6z6bcqhgdqi8";
  }."${version}";
+6 −6
Original line number Diff line number Diff line
{ stdenv, fetchurl, coq, coqPackages }:

if !stdenv.lib.versionAtLeast coq.coq-version "8.6"
then throw "CoLoR is not available for Coq ${coq.coq-version}"
else
{ stdenv, fetchurl, coq, bignums }:

stdenv.mkDerivation {
  name = "coq${coq.coq-version}-CoLoR-1.4.0";
@@ -12,7 +8,7 @@ stdenv.mkDerivation {
    sha256 = "1jsp9adsh7w59y41ihbwchryjhjpajgs9bhf8rnb4b3hzccqxgag";
  };

  buildInputs = [ coq coqPackages.bignums ];
  buildInputs = [ coq bignums ];
  enableParallelBuilding = false;

  installPhase = ''
@@ -25,4 +21,8 @@ stdenv.mkDerivation {
    maintainers = with maintainers; [ jwiegley ];
    platforms = coq.meta.platforms;
  };

  passthru = {
    compatibleCoqVersions = v: stdenv.lib.versionAtLeast v "8.6";
  };
}
+5 −3
Original line number Diff line number Diff line
{ stdenv, fetchFromGitHub, autoconf, automake, coq }:

if !stdenv.lib.versionAtLeast coq.coq-version "8.6"
then throw "This version of HoTT requires Coq 8.6"
else stdenv.mkDerivation rec {
stdenv.mkDerivation rec {
  name = "coq${coq.coq-version}-HoTT-${version}";
  version = "20170921";

@@ -56,4 +54,8 @@ else stdenv.mkDerivation rec {
    maintainers = with maintainers; [ siddharthist ];
    platforms = coq.meta.platforms;
  };

  passthru = {
    compatibleCoqVersions = v: v == "8.6";
  };
}
+4 −0
Original line number Diff line number Diff line
@@ -42,4 +42,8 @@ stdenv.mkDerivation rec {
    platforms = coq.meta.platforms;
  };

  passthru = {
    compatibleCoqVersions = v: builtins.elem v [ "8.6" "8.7" ];
  };

}
Loading