From 4304c709af6c1b6d96c3bc7a833a33e4cf93f9cc Mon Sep 17 00:00:00 2001 From: Hongchang Wu Date: Wed, 23 Sep 2020 00:51:13 -0400 Subject: [PATCH] ocamlPackages.merlin: 3.3.9 -> 3.4.0 --- .../tools/ocaml/merlin/default.nix | 21 ++++++++++++------- .../tools/ocaml/merlin/fix-paths.patch | 15 +++++++++++++ 2 files changed, 28 insertions(+), 8 deletions(-) create mode 100644 pkgs/development/tools/ocaml/merlin/fix-paths.patch diff --git a/pkgs/development/tools/ocaml/merlin/default.nix b/pkgs/development/tools/ocaml/merlin/default.nix index 54712be2b6ec..34fcc9bb6c32 100644 --- a/pkgs/development/tools/ocaml/merlin/default.nix +++ b/pkgs/development/tools/ocaml/merlin/default.nix @@ -1,17 +1,22 @@ -{ lib, fetchurl, buildDunePackage, yojson }: +{ lib, fetchurl, buildDunePackage, substituteAll +, dot-merlin-reader, dune_2, yojson, csexp, result }: buildDunePackage rec { pname = "merlin"; - version = "3.3.9"; - minimumOCamlVersion = "4.02.1"; + inherit (dot-merlin-reader) src version; - src = fetchurl { - url = "https://github.com/ocaml/merlin/releases/download/v${version}/merlin-v${version}.tbz"; - sha256 = "00ng8299l5rzpak8ljxzr6dgxw6z52ivm91159ahv09xk4d0y5x3"; - }; + minimumOCamlVersion = "4.02.3"; - buildInputs = [ yojson ]; + patches = [ + (substituteAll { + src = ./fix-paths.patch; + dot_merlin_reader = "${dot-merlin-reader}/bin/dot-merlin-reader"; + dune = "${dune_2}/bin/dune"; + }) + ]; + + buildInputs = [ dot-merlin-reader yojson csexp result ]; meta = with lib; { description = "An editor-independent tool to ease the development of programs in OCaml"; diff --git a/pkgs/development/tools/ocaml/merlin/fix-paths.patch b/pkgs/development/tools/ocaml/merlin/fix-paths.patch new file mode 100644 index 000000000000..05fafacc09c0 --- /dev/null +++ b/pkgs/development/tools/ocaml/merlin/fix-paths.patch @@ -0,0 +1,15 @@ +--- a/src/kernel/mconfig_dot.ml ++++ b/src/kernel/mconfig_dot.ml +@@ -126,10 +126,10 @@ module Configurator = struct + let prog, args = + match cfg with + | Dot_merlin -> +- let prog = "dot-merlin-reader" in ++ let prog = "@dot_merlin_reader@" in + prog, [| prog |] + | Dune -> +- let prog = "dune" in ++ let prog = "@dune@" in + prog, [| prog; "ocaml-merlin"; "--no-print-directory" |] + in + log ~title:"get_config" "Using %s configuration provider." (to_string cfg);