diff options
Diffstat (limited to 'pkgs/development/tools/ocaml/merlin/4.x.nix')
-rw-r--r-- | pkgs/development/tools/ocaml/merlin/4.x.nix | 33 |
1 files changed, 24 insertions, 9 deletions
diff --git a/pkgs/development/tools/ocaml/merlin/4.x.nix b/pkgs/development/tools/ocaml/merlin/4.x.nix index fb9b46c00ce56..f4c97b9642ece 100644 --- a/pkgs/development/tools/ocaml/merlin/4.x.nix +++ b/pkgs/development/tools/ocaml/merlin/4.x.nix @@ -1,6 +1,7 @@ { lib , substituteAll , fetchurl +, fetchpatch , ocaml , dune_3 , buildDunePackage @@ -21,23 +22,26 @@ let "4.12.1" = "4.7-412"; "4.13.0" = "4.7-413"; "4.13.1" = "4.7-413"; - "4.14.0" = "4.14-414"; - "4.14.1" = "4.14-414"; - "4.14.2" = "4.14-414"; + "4.14.0" = "4.16-414"; + "4.14.1" = "4.16-414"; + "4.14.2" = "4.16-414"; "5.0.0" = "4.14-500"; - "5.1.0" = "4.14-501"; - "5.1.1" = "4.14-501"; + "5.1.0" = "4.16-501"; + "5.1.1" = "4.16-501"; + "5.2.0" = "5.1-502"; }; hashes = { "4.7-412" = "sha256-0U3Ia7EblKULNy8AuXFVKACZvGN0arYJv7BWiBRgT0Y="; "4.7-413" = "sha256-aVmGWS4bJBLuwsxDKsng/n0A6qlyJ/pnDTcYab/5gyU="; - "4.14-414" = "sha256-eQGMyqN8FQHdXE1c94vDQg1kGx6CRDZimBxUctlzmT0="; "4.14-500" = "sha256-7CPzJPh1UgzYiX8wPMbU5ZXz1wAJFNQQcp8WuGrR1w4="; - "4.14-501" = "sha256-t+npbpJAWMLOQpZCeIqi45ByDUQeIkU4vPSUplIDopI="; + "4.16-414" = "sha256-xekZdfPfVoSeGzBvNWwxcJorE519V2NLjSHkcyZvzy0="; + "4.16-501" = "sha256-2lvzCbBAZFwpKuRXLMagpwDb0rz8mWrBPI5cODbCHiY="; + "5.1-502" = "sha256-T9gIvCaSnP/MqOoGNEeQFZwQ4+r5yRTPRu956Rf8rhU="; }; version = lib.getAttr ocaml.version merlinVersions; + in if !lib.hasAttr ocaml.version merlinVersions @@ -47,19 +51,30 @@ else buildDunePackage { pname = "merlin"; inherit version; - duneVersion = "3"; src = fetchurl { url = "https://github.com/ocaml/merlin/releases/download/v${version}/merlin-${version}.tbz"; sha256 = hashes."${version}"; }; - patches = [ + patches = let + branch = lib.head (lib.tail (lib.splitString "-" version)); + needsVimPatch = lib.versionOlder version "4.17" || + branch == "502" && lib.versionOlder version "5.2"; + in + [ (substituteAll { src = ./fix-paths.patch; dot_merlin_reader = "${dot-merlin-reader}/bin/dot-merlin-reader"; dune = "${dune_3}/bin/dune"; }) + ] ++ lib.optionals needsVimPatch [ + # https://github.com/ocaml/merlin/pull/1798 + (fetchpatch { + name = "vim-python-12-syntax-warning-fix.patch"; + url = "https://github.com/ocaml/merlin/commit/9e0c47b0d5fd0c4edc37c4c7ce927b155877557d.patch"; + hash = "sha256-HmdTISE/s45C5cwLgsCHNUW6OAPSsvQ/GcJE6VDEobs="; + }) ]; strictDeps = true; |