From da8413266703b3b3df1a9ba3014b4d9b907f3836 Mon Sep 17 00:00:00 2001 From: Vincent Laporte Date: Sun, 2 Apr 2023 15:17:18 +0200 Subject: [PATCH] =?UTF-8?q?ocamlPackages.yuujinchou:=202.0.0=20=E2=86=92?= =?UTF-8?q?=204.0.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ocaml-modules/yuujinchou/default.nix | 25 ++++++++++++++++--- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/pkgs/development/ocaml-modules/yuujinchou/default.nix b/pkgs/development/ocaml-modules/yuujinchou/default.nix index 5a78809d909..5f0c0965b27 100644 --- a/pkgs/development/ocaml-modules/yuujinchou/default.nix +++ b/pkgs/development/ocaml-modules/yuujinchou/default.nix @@ -1,24 +1,41 @@ -{ lib, fetchFromGitHub, buildDunePackage, qcheck-alcotest }: +{ lib, ocaml, fetchFromGitHub, buildDunePackage +, algaeff, bwd +, qcheck-alcotest +}: + +let params = if lib.versionAtLeast ocaml.version "5.0" then { + version = "4.0.0"; + hash = "sha256-yNLN5bBe4aft9Rl5VHmlOYTlnCdR2NgDWsc3uJHaZy4="; + propagatedBuildInputs = [ algaeff bwd ]; + } else { + version = "2.0.0"; + hash = "sha256:1nhz44cyipy922anzml856532m73nn0g7iwkg79yzhq6yb87109w"; + } +; in buildDunePackage rec { pname = "yuujinchou"; - version = "2.0.0"; + inherit (params) version; minimalOCamlVersion = "4.12"; + duneVersion = "3"; src = fetchFromGitHub { owner = "RedPRL"; repo = pname; rev = version; - sha256 = "sha256:1nhz44cyipy922anzml856532m73nn0g7iwkg79yzhq6yb87109w"; + inherit (params) hash; }; + propagatedBuildInputs = params.propagatedBuildInputs or []; + + doCheck = true; checkInputs = [ qcheck-alcotest ]; meta = { description = "Name pattern combinators"; - inherit (src.meta) homepage; + homepage = "https://github.com/RedPRL/yuujinchou"; license = lib.licenses.asl20; maintainers = [ lib.maintainers.vbgl ]; };