Commit 91ab8ed2 authored by Jules Aguillon's avatar Jules Aguillon Committed by Vincent Laporte
Browse files

ocamlPackages.merlin: Fix OCaml version shortening

The previous method was incompatible with future Merlin versions.
parent 52dce480
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -28,8 +28,13 @@ let
    "4.10-500" = "sha256-m9+Qz8DT94yNSwpamTVLQKISHtRVBWnZD3t/yyujSZ0=";
  };

  ocamlVersionShorthand = lib.substring 0 3
    (lib.concatStrings (lib.splitVersion ocaml.version));
  ocamlVersionShorthand =
    let
      v = lib.splitVersion ocaml.version;
      major = builtins.elemAt v 0;
      minor = builtins.elemAt v 1;
      minor_prefix = if builtins.stringLength minor < 2 then "0" else "";
    in "${toString major}${minor_prefix}${toString minor}";

  version = "${merlinVersion}-${ocamlVersionShorthand}";
in