From 6c426745b4469b5a9432002affd819055bd1a67d Mon Sep 17 00:00:00 2001 From: Vincent Laporte Date: Wed, 6 Jun 2018 22:18:11 +0200 Subject: [PATCH] ocamlPackages.functory: 0.5 -> 0.6 (#41596) --- .../ocaml-modules/functory/default.nix | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/pkgs/development/ocaml-modules/functory/default.nix b/pkgs/development/ocaml-modules/functory/default.nix index 6d4deac38c47..c8b29759b97c 100644 --- a/pkgs/development/ocaml-modules/functory/default.nix +++ b/pkgs/development/ocaml-modules/functory/default.nix @@ -1,14 +1,24 @@ -{stdenv, fetchurl, ocaml, findlib}: +{ stdenv, fetchurl, ocaml, findlib }: assert stdenv.lib.versionAtLeast (stdenv.lib.getVersion ocaml) "3.11"; +let param = + if stdenv.lib.versionAtLeast ocaml.version "4.02" then { + version = "0.6"; + sha256 = "18wpyxblz9jh5bfp0hpffnd0q8cq1b0dqp0f36vhqydfknlnpx8y"; + } else { + version = "0.5"; + sha256 = "1j17rhifdjv1z262dma148ywg34x0zjn8vczdrnkwajsm4qg1hw3"; + }; +in + stdenv.mkDerivation { - name = "ocaml-functory-0.5"; + name = "ocaml${ocaml.version}-functory-${param.version}"; src = fetchurl { - url = https://www.lri.fr/~filliatr/functory/download/functory-0.5.tar.gz; - sha256 = "1j17rhifdjv1z262dma148ywg34x0zjn8vczdrnkwajsm4qg1hw3"; + url = "https://www.lri.fr/~filliatr/functory/download/functory-${param.version}.tar.gz"; + inherit (param) sha256; }; buildInputs = [ ocaml findlib ];