From 7d40080053f9c235e2128bd5259e9c517536d7f6 Mon Sep 17 00:00:00 2001 From: Philipp Joram Date: Tue, 30 Apr 2024 15:49:48 +0300 Subject: [PATCH] vimPlugins.cornelis: init at 2024-04-17 --- .../editors/vim/plugins/generated.nix | 12 +++++++ .../editors/vim/plugins/overrides.nix | 13 ++++++++ ...01-Unconditionally-use-global-binary.patch | 31 +++++++++++++++++++ .../editors/vim/plugins/vim-plugin-names | 1 + 4 files changed, 57 insertions(+) create mode 100644 pkgs/applications/editors/vim/plugins/patches/cornelis/0001-Unconditionally-use-global-binary.patch diff --git a/pkgs/applications/editors/vim/plugins/generated.nix b/pkgs/applications/editors/vim/plugins/generated.nix index 1f59cc3e3541..31e70d7247ad 100644 --- a/pkgs/applications/editors/vim/plugins/generated.nix +++ b/pkgs/applications/editors/vim/plugins/generated.nix @@ -2634,6 +2634,18 @@ final: prev: meta.homepage = "https://github.com/ms-jpq/coq_nvim/"; }; + cornelis = buildVimPlugin { + pname = "cornelis"; + version = "2024-04-17"; + src = fetchFromGitHub { + owner = "isovector"; + repo = "cornelis"; + rev = "c97b4817034a927dcadb22294cf97a88087a935f"; + sha256 = "03wkq7jly9syv7kqsf66hdq8p7fqk6a240azcys9fsak797nbs1a"; + }; + meta.homepage = "https://github.com/isovector/cornelis/"; + }; + cosco-vim = buildVimPlugin { pname = "cosco.vim"; version = "2018-08-07"; diff --git a/pkgs/applications/editors/vim/plugins/overrides.nix b/pkgs/applications/editors/vim/plugins/overrides.nix index c3711bd412fe..c6425c0a5a9d 100644 --- a/pkgs/applications/editors/vim/plugins/overrides.nix +++ b/pkgs/applications/editors/vim/plugins/overrides.nix @@ -63,6 +63,8 @@ , # command-t dependencies getconf , ruby +, # cornelis dependencies + cornelis , # cpsm dependencies boost , cmake @@ -462,6 +464,17 @@ patches = [ ./patches/coq_nvim/emulate-venv.patch ]; }; + cornelis = super.cornelis.overrideAttrs { + dependencies = with self; [ vim-textobj-user ]; + opt = with self; [ vim-which-key ]; + # Unconditionally use the cornelis binary provided by the top-level package: + patches = [ ./patches/cornelis/0001-Unconditionally-use-global-binary.patch ]; + postInstall = '' + substituteInPlace $out/ftplugin/agda.vim \ + --subst-var-by CORNELIS "${lib.getBin cornelis}/bin/cornelis" + ''; + }; + cpsm = super.cpsm.overrideAttrs { nativeBuildInputs = [ cmake ]; buildInputs = [ diff --git a/pkgs/applications/editors/vim/plugins/patches/cornelis/0001-Unconditionally-use-global-binary.patch b/pkgs/applications/editors/vim/plugins/patches/cornelis/0001-Unconditionally-use-global-binary.patch new file mode 100644 index 000000000000..67caa386c76c --- /dev/null +++ b/pkgs/applications/editors/vim/plugins/patches/cornelis/0001-Unconditionally-use-global-binary.patch @@ -0,0 +1,31 @@ +From f8e993846551bda77a34a77aad7ad6dcc45b66a7 Mon Sep 17 00:00:00 2001 +From: Philipp Joram +Date: Tue, 16 Apr 2024 12:48:42 +0300 +Subject: [PATCH] Unconditionally use global binary + +--- + ftplugin/agda.vim | 8 +------- + 1 file changed, 1 insertion(+), 7 deletions(-) + +diff --git a/ftplugin/agda.vim b/ftplugin/agda.vim +index c7dd9d0..6b4aba3 100644 +--- a/ftplugin/agda.vim ++++ b/ftplugin/agda.vim +@@ -11,13 +11,7 @@ if exists("b:cornelis_ftplugin") + endif + let b:cornelis_ftplugin = 1 + +-if exists("g:cornelis_use_global_binary") +- call remote#host#Register('cornelis', '*', rpcstart('cornelis', [])) +-else +- call nvimhs#start(expand(':p:h:h'), 'cornelis', ['-v', 'DEBUG', '-l', '/tmp/cornelis.log']) +-endif +- +-nnoremap :call nvimhs#compileAndRestart('cornelis') ++call remote#host#Register('cornelis', '*', rpcstart('@CORNELIS@', [])) + + runtime agda-input.vim + runtime agda-matchpairs.vim +-- +2.44.0 + diff --git a/pkgs/applications/editors/vim/plugins/vim-plugin-names b/pkgs/applications/editors/vim/plugins/vim-plugin-names index acdd809e5438..b9a963e8ab61 100644 --- a/pkgs/applications/editors/vim/plugins/vim-plugin-names +++ b/pkgs/applications/editors/vim/plugins/vim-plugin-names @@ -219,6 +219,7 @@ https://github.com/ms-jpq/coq.artifacts/,HEAD, https://github.com/ms-jpq/coq.thirdparty/,HEAD, https://github.com/jvoorhis/coq.vim/,, https://github.com/ms-jpq/coq_nvim/,, +https://github.com/isovector/cornelis/,HEAD, https://github.com/lfilho/cosco.vim/,, https://github.com/nixprime/cpsm/,, https://github.com/saecki/crates.nvim/,,