0
0
Fork 0
mirror of https://github.com/NixOS/nixpkgs.git synced 2025-07-13 13:40:28 +03:00

ocaml-ng.ocamlPackages{_5_1,}.merlin: fix vim python-3.12 warnings

apply upstream patch 9e0c47b0d5.patch
to fix syntax warnings from python-3.12 when opening vim.
This commit is contained in:
Reno Dakota 2024-07-13 05:31:45 +00:00 committed by Vincent Laporte
parent b729601a9e
commit 9ecab00bf4
2 changed files with 21 additions and 2 deletions

View file

@ -1,6 +1,7 @@
{ lib
, substituteAll
, fetchurl
, fetchpatch
, ocaml
, dune_3
, buildDunePackage
@ -56,12 +57,24 @@ buildDunePackage {
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;

View file

@ -1,4 +1,4 @@
{ lib, fetchurl, buildDunePackage, substituteAll
{ lib, fetchurl, fetchpatch, buildDunePackage, substituteAll
, dot-merlin-reader, dune_2, yojson, csexp, result, menhirSdk }:
buildDunePackage rec {
@ -18,6 +18,12 @@ buildDunePackage rec {
dot_merlin_reader = "${dot-merlin-reader}/bin/dot-merlin-reader";
dune = "${dune_2}/bin/dune";
})
# 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;