From 61cf0ddf29290c8b57395943b698bd85aa6f32e9 Mon Sep 17 00:00:00 2001 From: Vincent Laporte Date: Sat, 26 Sep 2020 19:10:51 +0200 Subject: [PATCH] =?UTF-8?q?ocamlPackages.topkg:=201.0.0=20=E2=86=92=201.0.?= =?UTF-8?q?3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ocaml-modules/topkg/default.nix | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/pkgs/development/ocaml-modules/topkg/default.nix b/pkgs/development/ocaml-modules/topkg/default.nix index d2327b93a4f..1bd926b1ddb 100644 --- a/pkgs/development/ocaml-modules/topkg/default.nix +++ b/pkgs/development/ocaml-modules/topkg/default.nix @@ -7,11 +7,17 @@ build system is required, the attribute `run` can be used. */ { stdenv, fetchurl, ocaml, findlib, ocamlbuild, result, opaline }: -if !stdenv.lib.versionAtLeast ocaml.version "4.01" -then throw "topkg is not available for OCaml ${ocaml.version}" -else - let + param = + if stdenv.lib.versionAtLeast ocaml.version "4.03" then { + version = "1.0.3"; + sha256 = "0b77gsz9bqby8v77kfi4lans47x9p2lmzanzwins5r29maphb8y6"; + } else { + version = "1.0.0"; + sha256 = "1df61vw6v5bg2mys045682ggv058yqkqb67w7r2gz85crs04d5fw"; + propagatedBuildInputs = [ result ]; + }; + /* This command allows to run the “topkg” build system. * It is usually called with `build` or `test` as argument. * Packages that use `topkg` may call this command as part of @@ -22,15 +28,15 @@ in stdenv.mkDerivation rec { name = "ocaml${ocaml.version}-topkg-${version}"; - version = "1.0.0"; + inherit (param) version; src = fetchurl { url = "https://erratique.ch/software/topkg/releases/topkg-${version}.tbz"; - sha256 = "1df61vw6v5bg2mys045682ggv058yqkqb67w7r2gz85crs04d5fw"; + inherit (param) sha256; }; nativeBuildInputs = [ ocaml findlib ocamlbuild ]; - propagatedBuildInputs = [ result ]; + propagatedBuildInputs = param.propagatedBuildInputs or []; buildPhase = "${run} build"; createFindlibDestdir = true;