diff --git a/pkgs/development/ocaml-modules/csv/default.nix b/pkgs/development/ocaml-modules/csv/default.nix index 09679ced744..16f755f17b3 100644 --- a/pkgs/development/ocaml-modules/csv/default.nix +++ b/pkgs/development/ocaml-modules/csv/default.nix @@ -1,29 +1,30 @@ -{stdenv, fetchurl, ocaml, findlib}: - -assert stdenv.lib.versionAtLeast (stdenv.lib.getVersion ocaml) "3.11"; +{ stdenv, fetchzip, ocaml, findlib }: stdenv.mkDerivation { - name = "ocaml-csv-1.3.3"; + name = "ocaml-csv-1.4"; - src = fetchurl { - url = "https://forge.ocamlcore.org/frs/download.php/1376/csv-1.3.3.tar.gz"; - sha256 = "19qsvw3n7k4xpy0sw7n5s29kzj91myihjljhr5js6xcxwj4cydh2"; + src = fetchzip { + url = https://github.com/Chris00/ocaml-csv/releases/download/1.4/csv-1.4.tar.gz; + sha256 = "0si0v79rxzyzmgyhd6lidpzxdlcpprlhg0pgrsf688g83xsclkwa"; }; buildInputs = [ ocaml findlib ]; createFindlibDestdir = true; - configurePhase = "ocaml setup.ml -configure --prefix $out"; + configurePhase = "ocaml setup.ml -configure --prefix $out --enable-tests"; buildPhase = "ocaml setup.ml -build"; + doCheck = true; + checkPhase = "ocaml setup.ml -test"; + installPhase = "ocaml setup.ml -install"; meta = with stdenv.lib; { description = "A pure OCaml library to read and write CSV files"; - homepage = "https://forge.ocamlcore.org/projects/csv/"; + homepage = https://github.com/Chris00/ocaml-csv; license = licenses.lgpl21; maintainers = [ maintainers.vbgl ]; platforms = ocaml.meta.platforms; diff --git a/pkgs/development/ocaml-modules/qcheck/default.nix b/pkgs/development/ocaml-modules/qcheck/default.nix new file mode 100644 index 00000000000..260a1fc9811 --- /dev/null +++ b/pkgs/development/ocaml-modules/qcheck/default.nix @@ -0,0 +1,29 @@ +{ stdenv, fetchzip, ocaml, findlib, oasis, ounit }: + +assert stdenv.lib.versionAtLeast (stdenv.lib.getVersion ocaml) "4"; + +stdenv.mkDerivation { + + name = "ocaml-qcheck-0.4.0.1"; + src = fetchzip { + url = https://github.com/c-cube/qcheck/archive/0.4.0.1.tar.gz; + sha256 = "0j2jdrfz8rrslgjihnfgg8yy12860z2vvf7hqzjbmfmf03hz4pgv"; + }; + + buildInputs = [ ocaml findlib oasis ounit ]; + + configureFlags = "--enable-tests --enable-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; + }; +} diff --git a/pkgs/development/ocaml-modules/re/default.nix b/pkgs/development/ocaml-modules/re/default.nix index 457b45a575e..5e7ae1cba09 100644 --- a/pkgs/development/ocaml-modules/re/default.nix +++ b/pkgs/development/ocaml-modules/re/default.nix @@ -1,17 +1,19 @@ -{ stdenv, fetchzip, ocaml, findlib }: +{ stdenv, fetchzip, ocaml, findlib, ounit }: stdenv.mkDerivation rec { - name = "ocaml-re-1.4.0"; + name = "ocaml-re-1.4.1"; src = fetchzip { url = "https://github.com/ocaml/ocaml-re/archive/${name}.tar.gz"; - sha256 = "1xcfmhjgd7prqx2g1addlrk84xpfafmqnpjkqrvg7mw0hn1p7v2m"; + sha256 = "1wmfgazydd20hc796zisqpmsw0sb5lv9g3x77ckmf50v3z8hyhvk"; }; - buildInputs = [ ocaml findlib ]; + buildInputs = [ ocaml findlib ounit ]; - configurePhase = "ocaml setup.ml -configure --prefix $out"; + configurePhase = "ocaml setup.ml -configure --prefix $out --enable-tests"; buildPhase = "ocaml setup.ml -build"; + doCheck = true; + checkPhase = "ocaml setup.ml -test"; installPhase = "ocaml setup.ml -install"; createFindlibDestdir = true; diff --git a/pkgs/development/ocaml-modules/stringext/default.nix b/pkgs/development/ocaml-modules/stringext/default.nix index dae947035d2..961ee4b1fcd 100644 --- a/pkgs/development/ocaml-modules/stringext/default.nix +++ b/pkgs/development/ocaml-modules/stringext/default.nix @@ -1,19 +1,25 @@ -{ stdenv, fetchzip, ocaml, findlib }: +{ stdenv, fetchzip, ocaml, findlib, ounit, qcheck +# Optionally enable tests; test script use OCaml-4.01+ features +, doCheck ? stdenv.lib.versionAtLeast (stdenv.lib.getVersion ocaml) "4.01" +}: -let version = "1.3.0"; in +let version = "1.4.0"; in stdenv.mkDerivation { name = "ocaml-stringext-${version}"; src = fetchzip { url = "https://github.com/rgrinberg/stringext/archive/v${version}.tar.gz"; - sha256 = "0sd1chyxclmip0nxqhasp1ri91bwxr8nszkkr5kpja45f6bav6k9"; + sha256 = "1jp0x9rkss8a48z9wbnc4v5zvmnysin30345psl3xnxb2aqzwlii"; }; - buildInputs = [ ocaml findlib ]; + buildInputs = [ ocaml findlib ounit qcheck ]; - configurePhase = "ocaml setup.ml -configure --prefix $out"; + configurePhase = "ocaml setup.ml -configure --prefix $out" + + stdenv.lib.optionalString doCheck " --enable-tests"; buildPhase = "ocaml setup.ml -build"; + inherit doCheck; + checkPhase = "ocaml setup.ml -test"; installPhase = "ocaml setup.ml -install"; createFindlibDestdir = true; diff --git a/pkgs/development/ocaml-modules/uri/default.nix b/pkgs/development/ocaml-modules/uri/default.nix index 41cd2f64823..03620d05f54 100644 --- a/pkgs/development/ocaml-modules/uri/default.nix +++ b/pkgs/development/ocaml-modules/uri/default.nix @@ -1,25 +1,27 @@ -{ stdenv, fetchzip, ocaml, findlib, re, sexplib, stringext }: +{ stdenv, fetchzip, ocaml, findlib, re, sexplib, stringext, ounit }: assert stdenv.lib.versionAtLeast (stdenv.lib.getVersion ocaml) "4"; -let version = "1.9.0"; in +let version = "1.9.1"; in stdenv.mkDerivation { name = "ocaml-uri-${version}"; src = fetchzip { url = "https://github.com/mirage/ocaml-uri/archive/v${version}.tar.gz"; - sha256 = "13vbv6q7npl2bvvqfw03mav90jcrrvjbdpdp4y8mcjz0iax5ww9b"; + sha256 = "0v3jxqgyi4kj92r3x83rszfpnvvzy9lyb913basch4q64yka3w85"; }; - buildInputs = [ ocaml findlib ]; + buildInputs = [ ocaml findlib ounit ]; propagatedBuildInputs = [ re sexplib stringext ]; - configurePhase = "ocaml setup.ml -configure --prefix $out"; + configurePhase = "ocaml setup.ml -configure --prefix $out --enable-tests"; buildPhase = '' ocaml setup.ml -build ocaml setup.ml -doc ''; + doCheck = true; + checkPhase = "ocaml setup.ml -test"; installPhase = "ocaml setup.ml -install"; createFindlibDestdir = true; diff --git a/pkgs/development/tools/ocaml/ocp-index/default.nix b/pkgs/development/tools/ocaml/ocp-index/default.nix index 767a5e17cb4..c901d676b90 100644 --- a/pkgs/development/tools/ocaml/ocp-index/default.nix +++ b/pkgs/development/tools/ocaml/ocp-index/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchzip, ocaml, findlib, ocpBuild, ocpIndent, opam, cmdliner, ncurses, re, lambdaTerm, libev }: +{ stdenv, fetchurl, fetchzip, ocaml, findlib, ocpBuild, ocpIndent, opam, cmdliner, ncurses, re, lambdaTerm, libev }: let inherit (stdenv.lib) getVersion versionAtLeast optional; in @@ -6,7 +6,13 @@ assert versionAtLeast (getVersion ocaml) "3.12.1"; assert versionAtLeast (getVersion ocpBuild) "1.99.6-beta"; assert versionAtLeast (getVersion ocpIndent) "1.4.2"; -let version = "1.1.1"; in +let + version = "1.1.2"; + patch402 = fetchurl { + url = https://raw.githubusercontent.com/ocaml/opam-repository/master/packages/ocp-index/ocp-index.1.1.2/files/ocaml.4.02.patch; + sha256 = "1wcpn2pv7h8ia3ybmzdlm8v5hfvq1rgmlj02wwj0yh3vqjvxqvsm"; + }; +in stdenv.mkDerivation { @@ -14,9 +20,11 @@ stdenv.mkDerivation { src = fetchzip { url = "http://github.com/OCamlPro/ocp-index/archive/${version}.tar.gz"; - sha256 = "173lqbyivwv1zf9ifpxa9f8m2y3kybzs3idrwyzy824ixdqv2fww"; + sha256 = "0cz0bz5nisc5r23b1w07q2bl489gd09mg8rp9kyq9m6rj669b18l"; }; + patches = optional (versionAtLeast (getVersion ocaml) "4.02") patch402; + buildInputs = [ ocaml findlib ocpBuild opam cmdliner ncurses re libev ] ++ optional (versionAtLeast (getVersion lambdaTerm) "1.7") lambdaTerm; propagatedBuildInputs = [ ocpIndent ]; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 50d083ecafa..46daef79b3a 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -4545,6 +4545,10 @@ let pycaml = callPackage ../development/ocaml-modules/pycaml { }; + qcheck = callPackage ../development/ocaml-modules/qcheck { + oasis = ocaml_oasis; + }; + qtest = callPackage ../development/ocaml-modules/qtest { oasis = ocaml_oasis; };