about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/tools/ocaml/merlin
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2021-01-15 10:30:44 +0000
committerAlyssa Ross <hi@alyssa.is>2021-01-15 10:30:44 +0000
commite0794be8a0d11e90461e5a9c85012a36b93ec976 (patch)
treeefd9cbc55ea3322867bf601c4d536758a3dd5fcc /nixpkgs/pkgs/development/tools/ocaml/merlin
parent3538874082ded7647b1ccec0343c7c1e882cfef3 (diff)
parent1a57d96edd156958b12782e8c8b6a374142a7248 (diff)
downloadnixlib-e0794be8a0d11e90461e5a9c85012a36b93ec976.tar
nixlib-e0794be8a0d11e90461e5a9c85012a36b93ec976.tar.gz
nixlib-e0794be8a0d11e90461e5a9c85012a36b93ec976.tar.bz2
nixlib-e0794be8a0d11e90461e5a9c85012a36b93ec976.tar.lz
nixlib-e0794be8a0d11e90461e5a9c85012a36b93ec976.tar.xz
nixlib-e0794be8a0d11e90461e5a9c85012a36b93ec976.tar.zst
nixlib-e0794be8a0d11e90461e5a9c85012a36b93ec976.zip
Merge commit '1a57d96edd156958b12782e8c8b6a374142a7248'
Diffstat (limited to 'nixpkgs/pkgs/development/tools/ocaml/merlin')
-rw-r--r--nixpkgs/pkgs/development/tools/ocaml/merlin/default.nix21
-rw-r--r--nixpkgs/pkgs/development/tools/ocaml/merlin/dot-merlin-reader.nix6
-rw-r--r--nixpkgs/pkgs/development/tools/ocaml/merlin/fix-paths.patch15
3 files changed, 32 insertions, 10 deletions
diff --git a/nixpkgs/pkgs/development/tools/ocaml/merlin/default.nix b/nixpkgs/pkgs/development/tools/ocaml/merlin/default.nix
index 54712be2b6ec..ce168084f2c6 100644
--- a/nixpkgs/pkgs/development/tools/ocaml/merlin/default.nix
+++ b/nixpkgs/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 useDune2;
 
-  src = fetchurl {
-    url = "https://github.com/ocaml/merlin/releases/download/v${version}/merlin-v${version}.tbz";
-    sha256 = "00ng8299l5rzpak8ljxzr6dgxw6z52ivm91159ahv09xk4d0y5x3";
-  };
+  minimumOCamlVersion = "4.02.3";
+
+  patches = [
+    (substituteAll {
+      src = ./fix-paths.patch;
+      dot_merlin_reader = "${dot-merlin-reader}/bin/dot-merlin-reader";
+      dune = "${dune_2}/bin/dune";
+    })
+  ];
 
-  buildInputs = [ yojson ];
+  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/nixpkgs/pkgs/development/tools/ocaml/merlin/dot-merlin-reader.nix b/nixpkgs/pkgs/development/tools/ocaml/merlin/dot-merlin-reader.nix
index 7af1b4513a85..009998a3f851 100644
--- a/nixpkgs/pkgs/development/tools/ocaml/merlin/dot-merlin-reader.nix
+++ b/nixpkgs/pkgs/development/tools/ocaml/merlin/dot-merlin-reader.nix
@@ -4,13 +4,15 @@ with ocamlPackages;
 
 buildDunePackage rec {
   pname = "dot-merlin-reader";
-  version = "3.4.0";
+  version = "3.4.2";
+
+  useDune2 = true;
 
   minimumOCamlVersion = "4.02.1";
 
   src = fetchurl {
     url = "https://github.com/ocaml/merlin/releases/download/v${version}/merlin-v${version}.tbz";
-    sha256 = "048rkpbvayksv8mgmkgi17vv0y9xplv7v2ww4d1hs7bkm5zzsvg2";
+    sha256 = "109ai1ggnkrwbzsl1wdalikvs1zx940m6n65jllxj68in6bvidz1";
   };
 
   buildInputs = [ yojson csexp result ];
diff --git a/nixpkgs/pkgs/development/tools/ocaml/merlin/fix-paths.patch b/nixpkgs/pkgs/development/tools/ocaml/merlin/fix-paths.patch
new file mode 100644
index 000000000000..05fafacc09c0
--- /dev/null
+++ b/nixpkgs/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);