From 9c475289abecc6f89699910ee78299e599d8f5e2 Mon Sep 17 00:00:00 2001 From: Ersin Akinci Date: Fri, 25 Oct 2019 08:38:51 +0000 Subject: [PATCH 1/2] vimPlugins.LeaderF: init at 2019-10-15 --- pkgs/misc/vim-plugins/generated.nix | 11 +++++++++++ pkgs/misc/vim-plugins/overrides.nix | 24 ++++++++++++++++++++++++ pkgs/misc/vim-plugins/vim-plugin-names | 1 + 3 files changed, 36 insertions(+) diff --git a/pkgs/misc/vim-plugins/generated.nix b/pkgs/misc/vim-plugins/generated.nix index be1e6427beef2..d09d763c3a2f5 100644 --- a/pkgs/misc/vim-plugins/generated.nix +++ b/pkgs/misc/vim-plugins/generated.nix @@ -1486,6 +1486,17 @@ let }; }; + LeaderF = buildVimPluginFrom2Nix { + pname = "LeaderF"; + version = "2019-10-15"; + src = fetchFromGitHub { + owner = "Yggdroot"; + repo = "LeaderF"; + rev = "00af3cd7d2648a0e11f7220f6df1a1d790d2fbe1"; + sha256 = "11kfhpfzkcsm0df5rkmhbf22d8y1kq26x3gr84zb7pn4pail7nca"; + }; + }; + lean-vim = buildVimPluginFrom2Nix { pname = "lean-vim"; version = "2017-05-03"; diff --git a/pkgs/misc/vim-plugins/overrides.nix b/pkgs/misc/vim-plugins/overrides.nix index 4d127c20e31a7..343a187e96a91 100644 --- a/pkgs/misc/vim-plugins/overrides.nix +++ b/pkgs/misc/vim-plugins/overrides.nix @@ -213,6 +213,30 @@ self: super: { meta.maintainers = with stdenv.lib.maintainers; [ minijackson ]; }; + LeaderF = super.LeaderF.overrideAttrs(old: { + buildInputs = [ + python3 + stdenv + ]; + buildPhase = '' + patchShebangs . + export PY3=ON + ./install.sh + ''; + # HACK: Installing this plugin triggers Vim/Neovim to reload along with + # this plugin, which triggers autoload/lfMru.vim to load, which in turn + # attempts to read the g:Lf_CacheDirectory setting. That setting is set to + # $HOME, which during the build points to the non-existent + # /homeless-shelter. lfMru.vim tries to create the directory but lacks + # sufficient permissions, so this code forces g:Lf_CacheDirectory to point + # to $TMPDIR only when $HOME == /homeless-shelter, i.e., only during builds. + preFixup = '' + substituteInPlace "$out"/share/vim-plugins/LeaderF/autoload/lfMru.vim \ + --replace "let g:Lf_CacheDirectory = substitute(g:Lf_CacheDirectory, '[\/]$', ''', ''')" \ + "if g:Lf_CacheDirectory == '/homeless-shelter' ''\n let g:Lf_CacheDirectory = '$TMPDIR' ''\nendif''\n''\nlet g:Lf_CacheDirectory = substitute(g:Lf_CacheDirectory, '[\/]$', ''', ''')" + ''; + }); + meson = buildVimPluginFrom2Nix { inherit (meson) pname version src; preInstall = "cd data/syntax-highlighting/vim"; diff --git a/pkgs/misc/vim-plugins/vim-plugin-names b/pkgs/misc/vim-plugins/vim-plugin-names index 59d1726820aac..1f66721874be9 100644 --- a/pkgs/misc/vim-plugins/vim-plugin-names +++ b/pkgs/misc/vim-plugins/vim-plugin-names @@ -468,6 +468,7 @@ xolox/vim-easytags xolox/vim-misc xuhdev/vim-latex-live-preview Yggdroot/indentLine +Yggdroot/LeaderF zah/nim.vim zchee/deoplete-clang zchee/deoplete-go From 2a8da84aba8d9f7872629300a7e2a775c0b6e6b0 Mon Sep 17 00:00:00 2001 From: Ersin Akinci Date: Fri, 25 Oct 2019 21:27:24 +0000 Subject: [PATCH 2/2] Remove unnecessary stdenv dependency --- pkgs/misc/vim-plugins/overrides.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/pkgs/misc/vim-plugins/overrides.nix b/pkgs/misc/vim-plugins/overrides.nix index 343a187e96a91..6bc326f5b5bdd 100644 --- a/pkgs/misc/vim-plugins/overrides.nix +++ b/pkgs/misc/vim-plugins/overrides.nix @@ -216,7 +216,6 @@ self: super: { LeaderF = super.LeaderF.overrideAttrs(old: { buildInputs = [ python3 - stdenv ]; buildPhase = '' patchShebangs .