From 7c15d4b15ff759831d848ac7c1af1e932cd65da8 Mon Sep 17 00:00:00 2001 From: Vincent Laporte Date: Thu, 9 Apr 2020 18:58:17 +0200 Subject: [PATCH 1/5] ocamlPackages.ppx_blob: separate checkInputs --- pkgs/development/ocaml-modules/ppx_blob/default.nix | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pkgs/development/ocaml-modules/ppx_blob/default.nix b/pkgs/development/ocaml-modules/ppx_blob/default.nix index b6a451848c9..cc106b70f42 100644 --- a/pkgs/development/ocaml-modules/ppx_blob/default.nix +++ b/pkgs/development/ocaml-modules/ppx_blob/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchurl, buildDunePackage, alcotest, ocaml-migrate-parsetree }: +{ lib, fetchurl, buildDunePackage, alcotest, ocaml-migrate-parsetree }: buildDunePackage rec { pname = "ppx_blob"; @@ -9,10 +9,11 @@ buildDunePackage rec { sha256 = "1xmslk1mwdzhy1bydgsjlcb7h544c39hvxa8lywp8w72gaggjl16"; }; - buildInputs = [ alcotest ocaml-migrate-parsetree ]; + checkInputs = lib.optional doCheck alcotest; + buildInputs = [ ocaml-migrate-parsetree ]; doCheck = true; - meta = with stdenv.lib; { + meta = with lib; { homepage = "https://github.com/johnwhitington/ppx_blob"; description = "OCaml ppx to include binary data from a file as a string"; license = licenses.unlicense; From 8e0d02c073c16ced011a569518b1d1c3d6647c22 Mon Sep 17 00:00:00 2001 From: Vincent Laporte Date: Thu, 9 Apr 2020 18:58:24 +0200 Subject: [PATCH 2/5] ocamlPackages.ppx_blob: disable tests for OCaml < 4.03 --- pkgs/development/ocaml-modules/ppx_blob/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/ocaml-modules/ppx_blob/default.nix b/pkgs/development/ocaml-modules/ppx_blob/default.nix index cc106b70f42..d7d662e74a5 100644 --- a/pkgs/development/ocaml-modules/ppx_blob/default.nix +++ b/pkgs/development/ocaml-modules/ppx_blob/default.nix @@ -1,4 +1,4 @@ -{ lib, fetchurl, buildDunePackage, alcotest, ocaml-migrate-parsetree }: +{ lib, fetchurl, buildDunePackage, ocaml, alcotest, ocaml-migrate-parsetree }: buildDunePackage rec { pname = "ppx_blob"; @@ -11,7 +11,7 @@ buildDunePackage rec { checkInputs = lib.optional doCheck alcotest; buildInputs = [ ocaml-migrate-parsetree ]; - doCheck = true; + doCheck = lib.versionAtLeast ocaml.version "4.03"; meta = with lib; { homepage = "https://github.com/johnwhitington/ppx_blob"; From 942d312a69e5f3bb28ab1b7b3518d070ea0aa2c0 Mon Sep 17 00:00:00 2001 From: Vincent Laporte Date: Thu, 9 Apr 2020 18:58:29 +0200 Subject: [PATCH 3/5] ocamlPackages.cstruct-sexp: separate checkInputs --- pkgs/development/ocaml-modules/cstruct/sexp.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/ocaml-modules/cstruct/sexp.nix b/pkgs/development/ocaml-modules/cstruct/sexp.nix index 9a1ef0dd301..d4b311181d5 100644 --- a/pkgs/development/ocaml-modules/cstruct/sexp.nix +++ b/pkgs/development/ocaml-modules/cstruct/sexp.nix @@ -4,12 +4,12 @@ if !lib.versionAtLeast (cstruct.version or "1") "3" then cstruct else -buildDunePackage { +buildDunePackage rec { pname = "cstruct-sexp"; inherit (cstruct) version src meta; doCheck = true; - buildInputs = [ alcotest ]; + checkInputs = lib.optional doCheck alcotest; propagatedBuildInputs = [ cstruct sexplib ]; } From bab29617d10061836c4fc09fe0016e8e39a8fa49 Mon Sep 17 00:00:00 2001 From: Vincent Laporte Date: Thu, 9 Apr 2020 18:58:32 +0200 Subject: [PATCH 4/5] ocamlPackages.cstruct-sexp: disable tests for OCaml < 4.03 --- pkgs/development/ocaml-modules/cstruct/sexp.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/ocaml-modules/cstruct/sexp.nix b/pkgs/development/ocaml-modules/cstruct/sexp.nix index d4b311181d5..d0df442013f 100644 --- a/pkgs/development/ocaml-modules/cstruct/sexp.nix +++ b/pkgs/development/ocaml-modules/cstruct/sexp.nix @@ -1,4 +1,4 @@ -{ lib, buildDunePackage, alcotest, cstruct, sexplib }: +{ lib, buildDunePackage, ocaml, alcotest, cstruct, sexplib }: if !lib.versionAtLeast (cstruct.version or "1") "3" then cstruct @@ -8,7 +8,7 @@ buildDunePackage rec { pname = "cstruct-sexp"; inherit (cstruct) version src meta; - doCheck = true; + doCheck = lib.versionAtLeast ocaml.version "4.03"; checkInputs = lib.optional doCheck alcotest; propagatedBuildInputs = [ cstruct sexplib ]; From 32e50391008f58bc3594e26bce46f2260cbb8897 Mon Sep 17 00:00:00 2001 From: Vincent Laporte Date: Thu, 9 Apr 2020 18:58:36 +0200 Subject: [PATCH 5/5] =?UTF-8?q?ocamlPackages.fmt:=200.8.5=20=E2=86=92=200.?= =?UTF-8?q?8.6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkgs/development/ocaml-modules/fmt/default.nix | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/pkgs/development/ocaml-modules/fmt/default.nix b/pkgs/development/ocaml-modules/fmt/default.nix index 2b1d92c56ed..5f63be43a5e 100644 --- a/pkgs/development/ocaml-modules/fmt/default.nix +++ b/pkgs/development/ocaml-modules/fmt/default.nix @@ -1,16 +1,21 @@ -{ stdenv, fetchurl, ocaml, findlib, ocamlbuild, topkg, cmdliner, result, uchar }: +{ stdenv, fetchurl, ocaml, findlib, ocamlbuild, topkg, cmdliner, seq, stdlib-shims }: -stdenv.mkDerivation { - name = "ocaml${ocaml.version}-fmt-0.8.5"; +if !stdenv.lib.versionAtLeast ocaml.version "4.03" +then throw "fmt is not available for OCaml ${ocaml.version}" +else + +stdenv.mkDerivation rec { + version = "0.8.6"; + pname = "ocaml${ocaml.version}-fmt"; src = fetchurl { - url = "https://erratique.ch/software/fmt/releases/fmt-0.8.5.tbz"; - sha256 = "1zj9azcxcn6skmb69ykgmi9z8c50yskwg03wqgh87lypgjdcz060"; + url = "https://erratique.ch/software/fmt/releases/fmt-${version}.tbz"; + sha256 = "1jlw5izgvqw1adzqi87rp0383j0vj52wmacy3rqw87vxkf7a3xin"; }; nativeBuildInputs = [ ocaml findlib ocamlbuild ]; buildInputs = [ findlib topkg cmdliner ]; - propagatedBuildInputs = [ result uchar ]; + propagatedBuildInputs = [ seq stdlib-shims ]; inherit (topkg) buildPhase installPhase;