about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/ocaml-modules/qcheck
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/ocaml-modules/qcheck')
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/qcheck/alcotest.nix13
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/qcheck/core.nix23
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/qcheck/default.nix31
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/qcheck/ounit.nix14
4 files changed, 58 insertions, 23 deletions
diff --git a/nixpkgs/pkgs/development/ocaml-modules/qcheck/alcotest.nix b/nixpkgs/pkgs/development/ocaml-modules/qcheck/alcotest.nix
new file mode 100644
index 000000000000..4f1baec1e556
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/qcheck/alcotest.nix
@@ -0,0 +1,13 @@
+{ buildDunePackage, qcheck-core, alcotest }:
+
+buildDunePackage {
+  pname = "qcheck-alcotest";
+
+  inherit (qcheck-core) version src;
+
+  propagatedBuildInputs = [ qcheck-core alcotest ];
+
+  meta = qcheck-core.meta // {
+    description = "Alcotest backend for qcheck";
+  };
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/qcheck/core.nix b/nixpkgs/pkgs/development/ocaml-modules/qcheck/core.nix
new file mode 100644
index 000000000000..fa72a211ef45
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/qcheck/core.nix
@@ -0,0 +1,23 @@
+{ lib, buildDunePackage, fetchFromGitHub }:
+
+buildDunePackage rec {
+  pname = "qcheck-core";
+  version = "0.15";
+
+  minimumOCamlVersion = "4.03";
+
+  src = fetchFromGitHub {
+    owner = "c-cube";
+    repo = "qcheck";
+    rev = version;
+    sha256 = "1ywaklqm1agvxvzv7pwl8v4zlwc3ykw6l251w43f0gy9cfwqmh3j";
+  };
+
+  meta = {
+    description = "Core qcheck library";
+    homepage = "https://c-cube.github.io/qcheck/";
+    license = lib.licenses.bsd2;
+    maintainers = [ lib.maintainers.vbgl ];
+  };
+
+}
diff --git a/nixpkgs/pkgs/development/ocaml-modules/qcheck/default.nix b/nixpkgs/pkgs/development/ocaml-modules/qcheck/default.nix
index be625f4d8d72..2a0e6c0ae40c 100644
--- a/nixpkgs/pkgs/development/ocaml-modules/qcheck/default.nix
+++ b/nixpkgs/pkgs/development/ocaml-modules/qcheck/default.nix
@@ -1,29 +1,14 @@
-{ stdenv, fetchzip, ocaml, findlib, ocamlbuild, ounit }:
+{ buildDunePackage, qcheck-ounit }:
 
-assert stdenv.lib.versionAtLeast (stdenv.lib.getVersion ocaml) "4";
+buildDunePackage {
+  pname = "qcheck";
 
-stdenv.mkDerivation {
+  inherit (qcheck-ounit) version src;
 
-  name = "ocaml${ocaml.version}-qcheck-0.7";
-  src = fetchzip {
-    url = "https://github.com/c-cube/qcheck/archive/0.7.tar.gz";
-    sha256 = "1afy7li74r3ivpvq670gvsj1rmglh5rnvb17p6w8gy5rh30aljah";
-  };
-
-  buildInputs = [ ocaml findlib ocamlbuild ounit ];
-
-  configureFlags = [ "--enable-tests" ];
+  propagatedBuildInputs = [ qcheck-ounit ];
 
-  doCheck = true;
-  checkPhase = "ocaml setup.ml -test";
-
-  createFindlibDestdir = true;
-
-  meta = {
-    description = "QuickCheck inspired property-based testing for OCaml";
-    homepage = "https://github.com/c-cube/qcheck/";
-    license = stdenv.lib.licenses.bsd2;
-    maintainers = with stdenv.lib.maintainers; [ vbgl ];
-    platforms = ocaml.meta.platforms or [];
+  meta = qcheck-ounit.meta // {
+    description = "Compatibility package for qcheck";
   };
+
 }
diff --git a/nixpkgs/pkgs/development/ocaml-modules/qcheck/ounit.nix b/nixpkgs/pkgs/development/ocaml-modules/qcheck/ounit.nix
new file mode 100644
index 000000000000..06897987a954
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/qcheck/ounit.nix
@@ -0,0 +1,14 @@
+{ buildDunePackage, qcheck-core, ounit }:
+
+buildDunePackage {
+  pname = "qcheck-ounit";
+
+  inherit (qcheck-core) version src;
+
+  propagatedBuildInputs = [ qcheck-core ounit ];
+
+  meta = qcheck-core.meta // {
+    description = "OUnit backend for qcheck";
+  };
+
+}