diff --git a/pkgs/development/ocaml-modules/bisect_ppx/default.nix b/pkgs/development/ocaml-modules/bisect_ppx/default.nix index fdfc61e73c34..4ecfea79e155 100644 --- a/pkgs/development/ocaml-modules/bisect_ppx/default.nix +++ b/pkgs/development/ocaml-modules/bisect_ppx/default.nix @@ -1,4 +1,4 @@ -{ lib, fetchFromGitHub, buildDunePackage, cmdliner, ppxlib }: +{ lib, fetchFromGitHub, fetchpatch, buildDunePackage, cmdliner, ppxlib }: buildDunePackage rec { pname = "bisect_ppx"; @@ -11,8 +11,22 @@ buildDunePackage rec { sha256 = "sha256-pOeeSxzUF1jXQjA71atSZALdgQ2NB9qpKo5iaDnPwhQ="; }; - minimumOCamlVersion = "4.08"; - useDune2 = true; + patches = lib.optionals (lib.versionAtLeast ppxlib.version "0.26.0") [ + # Ppxlib >= 0.26.0 compatibility + # remove when a new version is released + (fetchpatch { + name = "${pname}-${version}-ppxlib-0.26-compatibility.patch"; + url = "https://patch-diff.githubusercontent.com/raw/aantron/bisect_ppx/pull/400.patch"; + sha256 = "sha256-WAn6+d6pMUr79LVugOENuh9s0gbVEcTg0rxXMz1P3ak="; + }) + (fetchpatch { + name = "${pname}-${version}-ppxlib-0.28-compatibility.patch"; + url = "https://github.com/anmonteiro/bisect_ppx/commit/cc442a08e3a2e0e18deb48f3a696076ac0986728.patch"; + sha256 = "sha256-pPHhmtd81eWhQd4X0gfZNPYT75+EkurwivP7acfJbNc="; + }) + ]; + + minimalOCamlVersion = "4.08"; buildInputs = [ cmdliner diff --git a/pkgs/development/ocaml-modules/gen_js_api/default.nix b/pkgs/development/ocaml-modules/gen_js_api/default.nix index e0474cdac6a8..4baa21c57cf1 100644 --- a/pkgs/development/ocaml-modules/gen_js_api/default.nix +++ b/pkgs/development/ocaml-modules/gen_js_api/default.nix @@ -9,16 +9,16 @@ buildDunePackage rec { pname = "gen_js_api"; - version = "1.0.9"; + version = "1.1.1"; src = fetchFromGitHub { owner = "LexiFi"; repo = pname; rev = "v${version}"; - sha256 = "1qx6if1avr484bl9x1h0cksdc6gqw5i4pwzdr27h46hppnnvi8y8"; + sha256 = "sha256-0FKKYPbSBza/Q6oZniq/UHi5zBjD/i7j5ds3ZDWkBTs="; }; - minimalOCamlVersion = "4.08"; + minimalOCamlVersion = "4.11"; propagatedBuildInputs = [ ojs ppxlib ]; checkInputs = [ js_of_ocaml-compiler nodejs ]; diff --git a/pkgs/development/ocaml-modules/gen_js_api/ojs.nix b/pkgs/development/ocaml-modules/gen_js_api/ojs.nix index 722f9fa7f6e1..381fda7acd93 100644 --- a/pkgs/development/ocaml-modules/gen_js_api/ojs.nix +++ b/pkgs/development/ocaml-modules/gen_js_api/ojs.nix @@ -1,5 +1,6 @@ { buildDunePackage , gen_js_api +, js_of_ocaml-compiler }: buildDunePackage rec { @@ -7,6 +8,8 @@ buildDunePackage rec { inherit (gen_js_api) version src; + propagatedBuildInputs = [ js_of_ocaml-compiler ]; + doCheck = false; # checks depend on gen_js_api, which is a cycle minimalOCamlVersion = "4.08"; diff --git a/pkgs/development/ocaml-modules/janestreet/0.14.nix b/pkgs/development/ocaml-modules/janestreet/0.14.nix index 68c633b800a6..67d0e6c7896e 100644 --- a/pkgs/development/ocaml-modules/janestreet/0.14.nix +++ b/pkgs/development/ocaml-modules/janestreet/0.14.nix @@ -613,7 +613,7 @@ with self; minimumOCamlVersion = "4.04.2"; hash = "0dbri9d00ydi0dw1cavswnqdmhjaaz80vap29ns2lr6mhhlvyjmj"; meta.description = "[@@deriving] plugin to generate S-expression conversion functions"; - propagatedBuildInputs = [ ppxlib sexplib0 base ]; + propagatedBuildInputs = [ (ppxlib.override { version = "0.24.0"; }) sexplib0 base ]; }; ppx_sexp_message = janePackage { diff --git a/pkgs/development/ocaml-modules/janestreet/0.15.nix b/pkgs/development/ocaml-modules/janestreet/0.15.nix index 3a4a20822c80..19d0219e384d 100644 --- a/pkgs/development/ocaml-modules/janestreet/0.15.nix +++ b/pkgs/development/ocaml-modules/janestreet/0.15.nix @@ -740,8 +740,9 @@ with self; ppx_sexp_conv = janePackage { pname = "ppx_sexp_conv"; - minimumOCamlVersion = "4.04.2"; - hash = "1fyf7hgxprn7pj58rmmrfpv938a0avpzvvk6wzihpmfm6whgbdm8"; + version = "0.15.1"; + minimalOCamlVersion = "4.08.0"; + hash = "sha256-NYknZHyDklr71hihM2pPFQ7uAKkuKO2DJkjtsF+xc5g="; meta.description = "[@@deriving] plugin to generate S-expression conversion functions"; propagatedBuildInputs = [ ppxlib sexplib0 base ]; }; diff --git a/pkgs/development/ocaml-modules/piqi-ocaml/default.nix b/pkgs/development/ocaml-modules/piqi-ocaml/default.nix index 39869765349b..09f2bd351837 100644 --- a/pkgs/development/ocaml-modules/piqi-ocaml/default.nix +++ b/pkgs/development/ocaml-modules/piqi-ocaml/default.nix @@ -1,7 +1,7 @@ { lib, stdenv, fetchFromGitHub, fetchpatch, ocaml, findlib, piqi, stdlib-shims, num }: stdenv.mkDerivation rec { - version = "0.7.7"; + version = "0.7.8"; pname = "piqi-ocaml"; name = "ocaml${ocaml.version}-${pname}-${version}"; @@ -9,7 +9,7 @@ stdenv.mkDerivation rec { owner = "alavrik"; repo = pname; rev = "v${version}"; - sha256 = "1913jpsb8mvqi8609j4g4sm5jhg50dq0xqxgy8nmvknfryyc89nm"; + sha256 = "sha256-6Luq49sbo+AqLSq57mc6fLhrRx0K6G5LCUIzkGPfqYo="; }; nativeBuildInputs = [ ocaml findlib ]; diff --git a/pkgs/development/ocaml-modules/piqi/default.nix b/pkgs/development/ocaml-modules/piqi/default.nix index f9eb09987fb9..ec8231285827 100644 --- a/pkgs/development/ocaml-modules/piqi/default.nix +++ b/pkgs/development/ocaml-modules/piqi/default.nix @@ -1,7 +1,7 @@ { lib, stdenv, fetchFromGitHub, ocaml, findlib, which, sedlex, easy-format, xmlm, base64 }: stdenv.mkDerivation rec { - version = "0.6.15"; + version = "0.6.16"; pname = "piqi"; name = "ocaml${ocaml.version}-${pname}-${version}"; @@ -9,7 +9,7 @@ stdenv.mkDerivation rec { owner = "alavrik"; repo = pname; rev = "v${version}"; - sha256 = "0v04hs85xv6d4ysqxyv1dik34dx49yab9shpi4x7iv19qlzl7csb"; + sha256 = "sha256-qE+yybTn+kzbY0h8udhZYO+GwQPI/J/6p3LMmF12cFU="; }; nativeBuildInputs = [ ocaml findlib which ]; diff --git a/pkgs/development/ocaml-modules/ppx_deriving_cmdliner/default.nix b/pkgs/development/ocaml-modules/ppx_deriving_cmdliner/default.nix index ec160b2fc9fb..5bf70a056507 100644 --- a/pkgs/development/ocaml-modules/ppx_deriving_cmdliner/default.nix +++ b/pkgs/development/ocaml-modules/ppx_deriving_cmdliner/default.nix @@ -1,6 +1,7 @@ { lib , buildDunePackage , fetchFromGitHub +, fetchpatch , alcotest , cmdliner , ppx_deriving @@ -12,7 +13,7 @@ buildDunePackage rec { pname = "ppx_deriving_cmdliner"; version = "0.6.1"; - minimalOCamlVersion = "4.08"; + minimalOCamlVersion = "4.11"; src = fetchFromGitHub { owner = "hammerlab"; @@ -21,6 +22,15 @@ buildDunePackage rec { sha256 = "sha256-/22KLQnxu3e2ZSca6ZLxTJDfv/rsmgCUkJnZC0RwRi8"; }; + patches = [ + # Ppxlib.0.26.0 compatibility + # remove when a new version is released + (fetchpatch { + url = "https://patch-diff.githubusercontent.com/raw/hammerlab/ppx_deriving_cmdliner/pull/50.patch"; + sha256 = "sha256-FfUfEAsyobwZ99+s5sFAaCE6Xgx7jLr/q79OxDbGcvQ="; + }) + ]; + propagatedBuildInputs = [ cmdliner ppx_deriving diff --git a/pkgs/development/ocaml-modules/ppx_deriving_yojson/default.nix b/pkgs/development/ocaml-modules/ppx_deriving_yojson/default.nix index bef60b3f381c..4fef3c0619f3 100644 --- a/pkgs/development/ocaml-modules/ppx_deriving_yojson/default.nix +++ b/pkgs/development/ocaml-modules/ppx_deriving_yojson/default.nix @@ -2,19 +2,27 @@ , ppx_deriving, yojson }: +let param = + if lib.versionAtLeast ppxlib.version "0.26" then { + version = "3.7.0"; + sha256 = "sha256-niKxn1fX0mL1MhlZvbN1wgRed9AHh+z9s6l++k1VX9k="; + } else { + version = "3.6.1"; + sha256 = "1icz5h6p3pfj7my5gi7wxpflrb8c902dqa17f9w424njilnpyrbk"; + } +; in + buildDunePackage rec { pname = "ppx_deriving_yojson"; - version = "3.6.1"; + inherit (param) version; - useDune2 = true; - - minimumOCamlVersion = "4.07"; + minimalOCamlVersion = "4.07"; src = fetchFromGitHub { owner = "ocaml-ppx"; repo = "ppx_deriving_yojson"; rev = "v${version}"; - sha256 = "1icz5h6p3pfj7my5gi7wxpflrb8c902dqa17f9w424njilnpyrbk"; + inherit (param) sha256; }; propagatedBuildInputs = [ ppxlib ppx_deriving yojson ]; diff --git a/pkgs/development/ocaml-modules/ppx_import/default.nix b/pkgs/development/ocaml-modules/ppx_import/default.nix index 192e7258c4c5..3a59b217e8f2 100644 --- a/pkgs/development/ocaml-modules/ppx_import/default.nix +++ b/pkgs/development/ocaml-modules/ppx_import/default.nix @@ -1,18 +1,29 @@ { lib , fetchurl , buildDunePackage +, ocaml , ounit , ppx_deriving , ppx_sexp_conv , ppxlib +, version ? if lib.versionAtLeast ocaml.version "4.11" then "1.10.0" else "1.9.1" }: +let param = { + "1.9.1" = { + sha256 = "sha256-0bSY4u44Ds84XPIbcT5Vt4AG/4PkzFKMl9CDGFZyIdI="; + }; + "1.10.0" = { + sha256 = "sha256-MA8sf0F7Ch1wJDL8E8470ukKx7KieWyjWJnJQsqBVW8="; + }; +}."${version}"; in + lib.throwIfNot (lib.versionAtLeast ppxlib.version "0.24.0") "ppx_import is not available with ppxlib-${ppxlib.version}" buildDunePackage rec { pname = "ppx_import"; - version = "1.9.1"; + inherit version; useDune2 = true; @@ -20,7 +31,7 @@ buildDunePackage rec { src = fetchurl { url = "https://github.com/ocaml-ppx/ppx_import/releases/download/${version}/ppx_import-${version}.tbz"; - sha256 = "1li1f9b1i0yhjy655k74hgzhd05palz726zjbhwcy3iqxvi9id6i"; + inherit (param) sha256; }; propagatedBuildInputs = [ diff --git a/pkgs/development/ocaml-modules/ppxlib/default.nix b/pkgs/development/ocaml-modules/ppxlib/default.nix index 2b7feddfa89b..92090c244142 100644 --- a/pkgs/development/ocaml-modules/ppxlib/default.nix +++ b/pkgs/development/ocaml-modules/ppxlib/default.nix @@ -2,7 +2,8 @@ , version ? if lib.versionAtLeast ocaml.version "4.07" then if lib.versionAtLeast ocaml.version "4.08" - then "0.24.0" else "0.15.0" else "0.13.0" + then if lib.versionAtLeast ocaml.version "4.11" + then "0.28.0" else "0.24.0" else "0.15.0" else "0.13.0" , ocaml-compiler-libs, ocaml-migrate-parsetree, ppx_derivers, stdio , stdlib-shims, ocaml-migrate-parsetree-2 }: @@ -46,6 +47,10 @@ let param = { sha256 = "sha256-wuG7cUZiVP2PdM+nZloip7lGGiWn6Wpkh2YoF/Fuc9o="; min_version = "4.07"; }; + "0.28.0" = { + sha256 = "sha256-i/U++sosKQUjyxu9GscPb1Gfv2a3Hbmj+UgIZlewnCo="; + min_version = "4.07"; + }; }."${version}"; in if param ? max_version && lib.versionAtLeast ocaml.version param.max_version diff --git a/pkgs/development/ocaml-modules/sedlex/default.nix b/pkgs/development/ocaml-modules/sedlex/default.nix index e49f03d3f537..a6a7604208ab 100644 --- a/pkgs/development/ocaml-modules/sedlex/default.nix +++ b/pkgs/development/ocaml-modules/sedlex/default.nix @@ -8,6 +8,16 @@ , uchar }: +let param = + if lib.versionAtLeast ppxlib.version "0.26.0" then { + version = "2.6"; + sha256 = "sha256-AU+dV+jTG9v3BXzip2Bnv04Ewyo3pyUglDDBFsOsFf0="; + } else { + version = "2.5"; + sha256 = "sha256:062a5dvrzvb81l3a9phljrhxfw9nlb61q341q0a6xn65hll3z2wy"; + } +; in + let unicodeVersion = "15.0.0"; baseUrl = "https://www.unicode.org/Public/${unicodeVersion}"; @@ -27,7 +37,7 @@ let in buildDunePackage rec { pname = "sedlex"; - version = "2.5"; + inherit (param) version; minimalOCamlVersion = "4.08"; @@ -35,7 +45,7 @@ buildDunePackage rec { owner = "ocaml-community"; repo = "sedlex"; rev = "v${version}"; - sha256 = "sha256:062a5dvrzvb81l3a9phljrhxfw9nlb61q341q0a6xn65hll3z2wy"; + inherit (param) sha256; }; propagatedBuildInputs = [ diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index c1405b5b614d..9501acb83143 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -14326,7 +14326,37 @@ with pkgs; fsharp = callPackage ../development/compilers/fsharp { }; - fstar = callPackage ../development/compilers/fstar { }; + fstar = callPackage ../development/compilers/fstar { + # Work around while compatibility with ppxlib >= 0.26 is unavailable + # Should be removed when a fix is availaible + # See https://github.com/FStarLang/FStar/issues/2681 + ocamlPackages = + ocamlPackages.overrideScope' (self: super: { + ppxlib = super.ppxlib.override { + version = if lib.versionAtLeast self.ocaml.version "4.07" + then if lib.versionAtLeast self.ocaml.version "4.08" + then "0.24.0" else "0.15.0" else "0.13.0"; + }; + ppx_deriving_yojson = super.ppx_deriving_yojson.overrideAttrs (oldAttrs: rec { + version = "3.6.1"; + src = fetchFromGitHub { + owner = "ocaml-ppx"; + repo = "ppx_deriving_yojson"; + rev = "v${version}"; + sha256 = "1icz5h6p3pfj7my5gi7wxpflrb8c902dqa17f9w424njilnpyrbk"; + }; + }); + sedlex = super.sedlex.overrideAttrs (oldAttrs: rec { + version = "2.5"; + src = fetchFromGitHub { + owner = "ocaml-community"; + repo = "sedlex"; + rev = "v${version}"; + sha256 = "sha256:062a5dvrzvb81l3a9phljrhxfw9nlb61q341q0a6xn65hll3z2wy"; + }; + }); + }); + }; dotnetPackages = recurseIntoAttrs (callPackage ./dotnet-packages.nix {});