diff --git a/pkgs/development/ocaml-modules/ocaml-lsp/jsonrpc.nix b/pkgs/development/ocaml-modules/ocaml-lsp/jsonrpc.nix index 701604c8710a..4921f579c418 100644 --- a/pkgs/development/ocaml-modules/ocaml-lsp/jsonrpc.nix +++ b/pkgs/development/ocaml-modules/ocaml-lsp/jsonrpc.nix @@ -4,23 +4,36 @@ , ocaml-syntax-shims , yojson , result -, fetchzip +, fetchurl , lib +, ocaml }: +let params = + if lib.versionAtLeast ocaml.version "4.12" + then { + version = "1.5.0"; + sha256 = "0g82m3jrp4s0m3fn9xmm8khrb3acccq8ns9p62bqa09pjd4vgdk2"; + } else { + version = "1.4.1"; + sha256 = "1ssyazc0yrdng98cypwa9m3nzfisdzpp7hqnx684rqj8f0g3gs6f"; + } +; in buildDunePackage rec { pname = "jsonrpc"; - version = "1.4.1"; - src = fetchzip { + inherit (params) version; + src = fetchurl { url = "https://github.com/ocaml/ocaml-lsp/releases/download/${version}/jsonrpc-${version}.tbz"; - sha256 = "0hzpw17qfhb0cxgwah1fv4k300r363dy1kv0977anl44dlanx1v5"; + inherit (params) sha256; }; useDune2 = true; minimumOCamlVersion = "4.06"; - buildInputs = [ yojson stdlib-shims ocaml-syntax-shims ppx_yojson_conv_lib result ]; + buildInputs = [ yojson stdlib-shims ocaml-syntax-shims ]; + + propagatedBuildInputs = [ ppx_yojson_conv_lib result ]; meta = with lib; { description = "Jsonrpc protocol implementation in OCaml";