From 011dd72d6a792e1992e3b1166bee7e59b598b260 Mon Sep 17 00:00:00 2001 From: Vincent Laporte Date: Fri, 20 Sep 2019 05:28:52 +0000 Subject: [PATCH 1/3] =?UTF-8?q?ocamlPackages.mdx:=20disable=20tests=20for?= =?UTF-8?q?=20OCaml=20=E2=89=A5=204.08?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Don’t strip for OCaml 4.04 --- pkgs/development/ocaml-modules/mdx/default.nix | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/pkgs/development/ocaml-modules/mdx/default.nix b/pkgs/development/ocaml-modules/mdx/default.nix index 29fee1b63184..0b43cf461e01 100644 --- a/pkgs/development/ocaml-modules/mdx/default.nix +++ b/pkgs/development/ocaml-modules/mdx/default.nix @@ -1,11 +1,9 @@ -{ stdenv, fetchFromGitHub, buildDunePackage, astring, cmdliner, cppo, fmt, logs, ocaml-migrate-parsetree, ocaml_lwt, pandoc, re }: +{ lib, fetchFromGitHub, buildDunePackage, ocaml, astring, cmdliner, cppo, fmt, logs, ocaml-migrate-parsetree, ocaml_lwt, pandoc, re }: buildDunePackage rec { pname = "mdx"; version = "1.4.0"; - minimumOCamlVersion = "4.05"; - src = fetchFromGitHub { owner = "realworldocaml"; repo = pname; @@ -15,14 +13,16 @@ buildDunePackage rec { nativeBuildInputs = [ cppo ]; buildInputs = [ astring cmdliner fmt logs ocaml-migrate-parsetree re ]; - checkInputs = [ ocaml_lwt pandoc ]; + checkInputs = lib.optionals doCheck [ ocaml_lwt pandoc ]; - doCheck = true; + doCheck = !lib.versionAtLeast ocaml.version "4.08"; + + dontStrip = lib.versions.majorMinor ocaml.version == "4.04"; meta = { homepage = https://github.com/realworldocaml/mdx; description = "Executable OCaml code blocks inside markdown files"; - license = stdenv.lib.licenses.isc; - maintainers = [ stdenv.lib.maintainers.romildo ]; + license = lib.licenses.isc; + maintainers = [ lib.maintainers.romildo ]; }; } From 59a07abdb2ce466d37c745e3daa19649e35c2f86 Mon Sep 17 00:00:00 2001 From: Vincent Laporte Date: Fri, 20 Sep 2019 05:28:59 +0000 Subject: [PATCH 2/3] =?UTF-8?q?ocamlPackages.printbox:=20disable=20tests?= =?UTF-8?q?=20for=20OCaml=20=E2=89=A5=204.08?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkgs/development/ocaml-modules/printbox/default.nix | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pkgs/development/ocaml-modules/printbox/default.nix b/pkgs/development/ocaml-modules/printbox/default.nix index b4b733ed7d84..50866e1d9691 100644 --- a/pkgs/development/ocaml-modules/printbox/default.nix +++ b/pkgs/development/ocaml-modules/printbox/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchFromGitHub, buildDunePackage, mdx }: +{ lib, fetchFromGitHub, buildDunePackage, ocaml, mdx }: buildDunePackage rec { pname = "printbox"; @@ -13,14 +13,14 @@ buildDunePackage rec { sha256 = "16nwwpp13hzlcm9xqfxc558afm3i5s802dkj69l9s2vp04lgms5n"; }; - checkInputs = [ mdx ]; + checkInputs = lib.optional doCheck mdx; - doCheck = true; + doCheck = !lib.versionAtLeast ocaml.version "4.08"; meta = { homepage = https://github.com/c-cube/printbox/; description = "Allows to print nested boxes, lists, arrays, tables in several formats"; - license = stdenv.lib.licenses.isc; - maintainers = [ stdenv.lib.maintainers.romildo ]; + license = lib.licenses.isc; + maintainers = [ lib.maintainers.romildo ]; }; } From 424c20414a310fbefa0c32fe5341bc38aa4134d2 Mon Sep 17 00:00:00 2001 From: Vincent Laporte Date: Fri, 20 Sep 2019 05:29:05 +0000 Subject: [PATCH 3/3] =?UTF-8?q?ocamlPackages.containers:=201.4=20=E2=86=92?= =?UTF-8?q?=202.6.1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ocamlPackages.sequence/iter: 1.1 → 1.2.1 Ensures compatibility with OCaml 4.08 --- .../ocaml-modules/containers/default.nix | 54 +++++-------------- .../{sequence => iter}/default.nix | 16 +++--- pkgs/top-level/ocaml-packages.nix | 4 +- 3 files changed, 22 insertions(+), 52 deletions(-) rename pkgs/development/ocaml-modules/{sequence => iter}/default.nix (65%) diff --git a/pkgs/development/ocaml-modules/containers/default.nix b/pkgs/development/ocaml-modules/containers/default.nix index 98fd7fc46cf6..1b465c2984ec 100644 --- a/pkgs/development/ocaml-modules/containers/default.nix +++ b/pkgs/development/ocaml-modules/containers/default.nix @@ -1,53 +1,26 @@ -{ stdenv, fetchFromGitHub, ocaml, findlib, ocamlbuild, cppo, gen, sequence, qtest, ounit, result -, qcheck }: +{ lib, fetchFromGitHub, buildDunePackage, ocaml +, iter, result, uchar +, gen, mdx, ounit, qcheck, uutf +}: -let - - mkpath = p: - "${p}/lib/ocaml/${ocaml.version}/site-lib"; - - version = "1.4"; - -in - -stdenv.mkDerivation { - name = "ocaml${ocaml.version}-containers-${version}"; +buildDunePackage rec { + version = "2.6.1"; + pname = "containers"; src = fetchFromGitHub { owner = "c-cube"; repo = "ocaml-containers"; rev = version; - sha256 = "1wbarxphdrxvy7qsdp4p837h1zrv0z83pgs5lbz2h3kdnyvz2f1i"; + sha256 = "02iq01pq6047hab5s8zpprwr21cygvzfcfj2lpsyj823f28crhmv"; }; - buildInputs = [ ocaml findlib ocamlbuild cppo gen sequence qtest ounit qcheck ]; + buildInputs = [ iter ]; - propagatedBuildInputs = [ result ]; + checkInputs = lib.optionals doCheck [ gen mdx ounit qcheck uutf ]; - preConfigure = '' - # The following is done so that the '#use "topfind"' directive works in the ocaml top-level - export HOME="$(mktemp -d)" - export OCAML_TOPLEVEL_PATH="${mkpath findlib}" - cat < $HOME/.ocamlinit -let () = - try Topdirs.dir_directory (Sys.getenv "OCAML_TOPLEVEL_PATH") - with Not_found -> () -;; -EOF - ''; + propagatedBuildInputs = [ result uchar ]; - configureFlags = [ - "--enable-unix" - "--enable-thread" - "--enable-tests" - "--enable-docs" - "--disable-bench" - ]; - - doCheck = true; - checkTarget = "test"; - - createFindlibDestdir = true; + doCheck = !lib.versionAtLeast ocaml.version "4.08"; meta = { homepage = https://github.com/c-cube/ocaml-containers; @@ -62,7 +35,6 @@ EOF It also features optional libraries for dealing with strings, and helpers for unix and threads. ''; - license = stdenv.lib.licenses.bsd2; - platforms = ocaml.meta.platforms or []; + license = lib.licenses.bsd2; }; } diff --git a/pkgs/development/ocaml-modules/sequence/default.nix b/pkgs/development/ocaml-modules/iter/default.nix similarity index 65% rename from pkgs/development/ocaml-modules/sequence/default.nix rename to pkgs/development/ocaml-modules/iter/default.nix index e5ead36d1c19..eb2ca1409ab8 100644 --- a/pkgs/development/ocaml-modules/sequence/default.nix +++ b/pkgs/development/ocaml-modules/iter/default.nix @@ -1,22 +1,20 @@ -{ stdenv, fetchFromGitHub, buildDunePackage, qtest, result }: +{ lib, fetchFromGitHub, buildDunePackage, ocaml, mdx, qtest, result }: buildDunePackage rec { - pname = "sequence"; - version = "1.1"; - - minimumOCamlVersion = "4.02"; + pname = "iter"; + version = "1.2.1"; src = fetchFromGitHub { owner = "c-cube"; repo = pname; rev = version; - sha256 = "08j37nldw47syq3yw4mzhhvya43knl0d7biddp0q9hwbaxhzgi44"; + sha256 = "0j2sg50byn0ppmf6l36ksip7zx1d3gv7sc4hbbxs2rmx39jr7vxh"; }; - buildInputs = [ qtest ]; + buildInputs = lib.optionals doCheck [ mdx qtest ]; propagatedBuildInputs = [ result ]; - doCheck = true; + doCheck = lib.versionAtLeast ocaml.version "4.04"; meta = { homepage = https://github.com/c-cube/sequence; @@ -27,6 +25,6 @@ buildDunePackage rec { like `filter`, `map`, `take`, `drop` and `append` can be performed before the sequence is iterated/folded on. ''; - license = stdenv.lib.licenses.bsd2; + license = lib.licenses.bsd2; }; } diff --git a/pkgs/top-level/ocaml-packages.nix b/pkgs/top-level/ocaml-packages.nix index 728f6f7712d0..66e92f47d117 100644 --- a/pkgs/top-level/ocaml-packages.nix +++ b/pkgs/top-level/ocaml-packages.nix @@ -304,6 +304,8 @@ let iso8601 = callPackage ../development/ocaml-modules/iso8601 { }; + iter = callPackage ../development/ocaml-modules/iter { }; + javalib = callPackage ../development/ocaml-modules/javalib { extlib = ocaml_extlib; }; @@ -621,8 +623,6 @@ let seq = callPackage ../development/ocaml-modules/seq { }; - sequence = callPackage ../development/ocaml-modules/sequence { }; - spacetime_lib = callPackage ../development/ocaml-modules/spacetime_lib { }; sqlexpr = callPackage ../development/ocaml-modules/sqlexpr { };