ocamlPackages.dypgen: init at 0.2 for OCaml ≥ 4.07

This commit is contained in:
Vincent Laporte 2023-07-18 07:09:04 +02:00 committed by Vincent Laporte
parent 35be480850
commit 1b3feb1044

View File

@ -1,21 +1,26 @@
{stdenv, lib, fetchurl, ocaml, findlib}: { stdenv, lib, fetchFromGitHub, fetchurl, ocaml, findlib }:
let let params =
pname = "dypgen"; if lib.versionAtLeast ocaml.version "4.07" then rec {
in version = "0.2";
src = fetchFromGitHub {
if lib.versionAtLeast ocaml.version "4.06" owner = "grain-lang";
then throw "${pname} is not available for OCaml ${ocaml.version}" repo = "dypgen";
else rev = version;
hash = "sha256-fKuO/e5YbA2B7XcghWl9pXxwvKw9YlhnmZDZcuKe3cs=";
};
} else if lib.versionOlder ocaml.version "4.06" then {
version = "20120619-1";
src = fetchurl {
url = "http://dypgen.free.fr/dypgen-20120619-1.tar.bz2";
sha256 = "ecb53d6e469e9ec4d57ee6323ff498d45b78883ae13618492488e7c5151fdd97";
};
} else throw "dypgen is not available for OCaml ${ocaml.version}"
; in
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
name = "${pname}-${version}"; pname = "ocaml${ocaml.version}-dypgen";
version = "20120619-1"; inherit (params) src version;
src = fetchurl {
url = "http://dypgen.free.fr/dypgen-20120619-1.tar.bz2";
sha256 = "ecb53d6e469e9ec4d57ee6323ff498d45b78883ae13618492488e7c5151fdd97";
};
nativeBuildInputs = [ ocaml findlib ]; nativeBuildInputs = [ ocaml findlib ];