about summary refs log tree commit diff
path: root/pkgs/development
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development')
-rw-r--r--pkgs/development/ocaml-modules/ounit/default.nix36
-rw-r--r--pkgs/development/ocaml-modules/ounit2/default.nix22
2 files changed, 29 insertions, 29 deletions
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 = [];
-
-  dontAddPrefix = true;
+  propagatedBuildInputs = [ ounit2 ];
 
-  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 ];
+  };
+}