From 29a98f2be1961d84024c406fd437e223fb108087 Mon Sep 17 00:00:00 2001 From: sternenseemann Date: Mon, 13 Apr 2020 16:42:14 +0200 Subject: [PATCH] ocamlPackages.ounit2: init at 2.2.2 --- .../ocaml-modules/ounit/default.nix | 36 ++++--------------- .../ocaml-modules/ounit2/default.nix | 22 ++++++++++++ pkgs/top-level/ocaml-packages.nix | 2 ++ 3 files changed, 31 insertions(+), 29 deletions(-) create mode 100644 pkgs/development/ocaml-modules/ounit2/default.nix diff --git a/pkgs/development/ocaml-modules/ounit/default.nix b/pkgs/development/ocaml-modules/ounit/default.nix index c0668b811122..2f4a4f0437a2 100644 --- a/pkgs/development/ocaml-modules/ounit/default.nix +++ b/pkgs/development/ocaml-modules/ounit/default.nix @@ -1,38 +1,16 @@ -{ stdenv, fetchurl, fetchpatch, ocaml, findlib, ocamlbuild }: +{ stdenv, ocaml, findlib, ounit2 }: stdenv.mkDerivation { - name = "ounit-2.0.0"; + pname = "ocaml${ocaml.version}-ounit"; + inherit (ounit2) version src meta; - src = fetchurl { - url = "https://forge.ocamlcore.org/frs/download.php/1258/ounit-2.0.0.tar.gz"; - sha256 = "118xsadrx84pif9vaq13hv4yh22w9kmr0ypvhrs0viir1jr0ajjd"; - }; - - patches = with stdenv.lib; - optional (versionAtLeast ocaml.version "4.02") (fetchpatch { - url = "https://raw.githubusercontent.com/ocaml/opam-repository/master/packages/ounit/ounit.2.0.0/files/safe-string.patch"; - sha256 = "0hbd2sqdz75lv5ax82yhsfdk1dlcvq12xpys6n85ysmrl0c3d3lk"; - }); - - nativeBuildInputs = [ ocaml findlib ocamlbuild ]; buildInputs = [ findlib ]; - configurePlatforms = []; + propagatedBuildInputs = [ ounit2 ]; - dontAddPrefix = true; - - doCheck = true; - - checkTarget = "test"; + phases = [ "unpackPhase" "installPhase" "fixupPhase" ]; createFindlibDestdir = true; - meta = { - homepage = "http://ounit.forge.ocamlcore.org/"; - description = "Unit test framework for OCaml"; - license = stdenv.lib.licenses.mit; - platforms = ocaml.meta.platforms or []; - maintainers = [ - stdenv.lib.maintainers.maggesi - ]; - }; + installTargets = "install-ounit version='${ounit2.version}'"; + } diff --git a/pkgs/development/ocaml-modules/ounit2/default.nix b/pkgs/development/ocaml-modules/ounit2/default.nix new file mode 100644 index 000000000000..aea386061937 --- /dev/null +++ b/pkgs/development/ocaml-modules/ounit2/default.nix @@ -0,0 +1,22 @@ +{ lib, buildDunePackage, fetchurl, stdlib-shims }: + +buildDunePackage rec { + minimumOCamlVersion = "4.02.3"; + + pname = "ounit2"; + version = "2.2.2"; + + src = fetchurl { + url = "https://github.com/gildor478/ounit/releases/download/v${version}/ounit-v${version}.tbz"; + sha256 = "1h4xdcyzwyhxg263w9b16x9n6cb11fzazmwnsnpich4djpl9lhsk"; + }; + + propagatedBuildInputs = [ stdlib-shims ]; + + meta = with lib; { + homepage = "https://github.com/gildor478/ounit"; + description = "A unit test framework for OCaml"; + license = licenses.mit; + maintainers = with maintainers; [ sternenseemann ]; + }; +} diff --git a/pkgs/top-level/ocaml-packages.nix b/pkgs/top-level/ocaml-packages.nix index b8493c6eff96..b976d36c7309 100644 --- a/pkgs/top-level/ocaml-packages.nix +++ b/pkgs/top-level/ocaml-packages.nix @@ -719,6 +719,8 @@ let ounit = callPackage ../development/ocaml-modules/ounit { }; + ounit2 = callPackage ../development/ocaml-modules/ounit2 { }; + pgsolver = callPackage ../development/ocaml-modules/pgsolver { }; phylogenetics = callPackage ../development/ocaml-modules/phylogenetics { };