From e261eb152ba8aa72a139a15e9856495ba348f8af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Na=C3=AFm=20Favier?= Date: Tue, 6 Jun 2023 19:21:07 +0200 Subject: [PATCH 1/2] vim-full: remove redundant nix support patches Vim 9 includes syntax highlighting for nix files, but not the ftplugin/indent parts of vim-nix so we still include those. https://github.com/LnL7/vim-nix/issues/47 https://github.com/vim/vim/pull/11646 --- .../applications/editors/vim/configurable.nix | 9 ++++----- .../editors/vim/ft-nix-support.patch | 20 ------------------- 2 files changed, 4 insertions(+), 25 deletions(-) delete mode 100644 pkgs/applications/editors/vim/ft-nix-support.patch diff --git a/pkgs/applications/editors/vim/configurable.nix b/pkgs/applications/editors/vim/configurable.nix index 8b49850d6003..dc361d8e8807 100644 --- a/pkgs/applications/editors/vim/configurable.nix +++ b/pkgs/applications/editors/vim/configurable.nix @@ -24,7 +24,7 @@ , netbeansSupport ? config.netbeans or true # Enable NetBeans integration support. , ximSupport ? config.vim.xim or true # less than 15KB, needed for deadkeys , darwinSupport ? config.vim.darwin or false # Enable Darwin support -, ftNixSupport ? config.vim.ftNix or true # Add .nix filetype detection and minimal syntax highlighting support +, ftNixSupport ? config.vim.ftNix or true # Add nix indentation support from vim-nix (not needed for basic syntax highlighting) }: @@ -61,7 +61,7 @@ let common = callPackage ./common.nix {}; -in stdenv.mkDerivation rec { +in stdenv.mkDerivation { pname = "vim-full"; @@ -71,7 +71,7 @@ in stdenv.mkDerivation rec { default = common.src; # latest release }; - patches = [ ./cflags-prune.diff ] ++ lib.optional ftNixSupport ./ft-nix-support.patch; + patches = [ ./cflags-prune.diff ]; configureFlags = [ "--with-features=${features}" @@ -163,10 +163,9 @@ in stdenv.mkDerivation rec { # error: '__declspec' attributes are not enabled; use '-fdeclspec' or '-fms-extensions' to enable support for __declspec attributes env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-fdeclspec"; - preConfigure = "" + lib.optionalString ftNixSupport '' + preConfigure = lib.optionalString ftNixSupport '' cp ${vimPlugins.vim-nix.src}/ftplugin/nix.vim runtime/ftplugin/nix.vim cp ${vimPlugins.vim-nix.src}/indent/nix.vim runtime/indent/nix.vim - cp ${vimPlugins.vim-nix.src}/syntax/nix.vim runtime/syntax/nix.vim ''; preInstall = '' diff --git a/pkgs/applications/editors/vim/ft-nix-support.patch b/pkgs/applications/editors/vim/ft-nix-support.patch deleted file mode 100644 index 274d855731fd..000000000000 --- a/pkgs/applications/editors/vim/ft-nix-support.patch +++ /dev/null @@ -1,20 +0,0 @@ -diff --git a/runtime/filetype.vim b/runtime/filetype.vim -index a8e6261..2b008fc 100644 ---- a/runtime/filetype.vim -+++ b/runtime/filetype.vim -@@ -2258,6 +2258,9 @@ au BufNewFile,BufRead *.zsql call s:SQL() - " Z80 assembler asz80 - au BufNewFile,BufRead *.z8a setf z8a - -+" Nix -+au BufNewFile,BufRead *.nix setf nix -+ - augroup END - - -@@ -2440,3 +2443,5 @@ endfunc - " Restore 'cpoptions' - let &cpo = s:cpo_save - unlet s:cpo_save -+ -+ From 013cd176ff901e75439d45abce7137f87b15c10b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Na=C3=AFm=20Favier?= Date: Tue, 6 Jun 2023 21:14:09 +0200 Subject: [PATCH 2/2] =?UTF-8?q?vim-full:=20configurable.nix=20=E2=86=92=20?= =?UTF-8?q?full.nix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reflects the name change from `vim_configurable` to `vim-full`. --- pkgs/applications/editors/vim/{configurable.nix => full.nix} | 0 pkgs/top-level/all-packages.nix | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename pkgs/applications/editors/vim/{configurable.nix => full.nix} (100%) diff --git a/pkgs/applications/editors/vim/configurable.nix b/pkgs/applications/editors/vim/full.nix similarity index 100% rename from pkgs/applications/editors/vim/configurable.nix rename to pkgs/applications/editors/vim/full.nix diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 26e08cfb6996..15d02959fbea 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -34846,7 +34846,7 @@ with pkgs; macvim = callPackage ../applications/editors/vim/macvim-configurable.nix { stdenv = clangStdenv; }; - vim-full = vimUtils.makeCustomizable (callPackage ../applications/editors/vim/configurable.nix { + vim-full = vimUtils.makeCustomizable (callPackage ../applications/editors/vim/full.nix { inherit (darwin.apple_sdk.frameworks) CoreServices Cocoa Foundation CoreData; inherit (darwin) libobjc; });