From a478f09d4b28179f747bc37867e254eff7e2fe5e Mon Sep 17 00:00:00 2001 From: Nick Hu Date: Sun, 1 Mar 2020 14:05:31 +0000 Subject: [PATCH] vimPlugins.fruzzy: init at 2019-10-28 --- pkgs/misc/vim-plugins/generated.nix | 11 ++++++ pkgs/misc/vim-plugins/overrides.nix | 35 +++++++++++++++++++ .../patches/fruzzy/get_version.patch | 25 +++++++++++++ pkgs/misc/vim-plugins/vim-plugin-names | 1 + 4 files changed, 72 insertions(+) create mode 100644 pkgs/misc/vim-plugins/patches/fruzzy/get_version.patch diff --git a/pkgs/misc/vim-plugins/generated.nix b/pkgs/misc/vim-plugins/generated.nix index 9d6a47e507db..1c73abe0e7e5 100644 --- a/pkgs/misc/vim-plugins/generated.nix +++ b/pkgs/misc/vim-plugins/generated.nix @@ -1320,6 +1320,17 @@ let }; }; + fruzzy = buildVimPluginFrom2Nix { + pname = "fruzzy"; + version = "2019-10-28"; + src = fetchFromGitHub { + owner = "raghur"; + repo = "fruzzy"; + rev = "b312ae79db98cf6939c8319f2511efa06889e8e3"; + sha256 = "01iisbawq2w7yw866qvv109amnvyaymzyz9nqal3cjrrcwk6mmdk"; + }; + }; + fugitive-gitlab-vim = buildVimPluginFrom2Nix { pname = "fugitive-gitlab-vim"; version = "2019-10-24"; diff --git a/pkgs/misc/vim-plugins/overrides.nix b/pkgs/misc/vim-plugins/overrides.nix index 79418c62aa8e..23a75b9fb24a 100644 --- a/pkgs/misc/vim-plugins/overrides.nix +++ b/pkgs/misc/vim-plugins/overrides.nix @@ -28,6 +28,9 @@ # vCoolor dependency , gnome3 + +# fruzzy dependency +, nim }: self: super: { @@ -211,6 +214,38 @@ self: super: { dependencies = with super; [ super.self ]; }); + fruzzy = let # until https://github.com/NixOS/nixpkgs/pull/67878 is merged, there's no better way to install nim libraries with nix + nimpy = fetchFromGitHub { + owner = "yglukhov"; + repo = "nimpy"; + rev = "4840d1e438985af759ddf0923e7a9250fd8ea0da"; + sha256 = "0qqklvaajjqnlqm3rkk36pwwnn7x942mbca7nf2cvryh36yg4q5k"; + }; + binaryheap = fetchFromGitHub { + owner = "bluenote10"; + repo = "nim-heap"; + rev = "c38039309cb11391112571aa332df9c55f625b54"; + sha256 = "05xdy13vm5n8dw2i366ppbznc4cfhq23rdcklisbaklz2jhdx352"; + }; + in super.fruzzy.overrideAttrs(old: { + buildInputs = [ nim ]; + patches = [ + (substituteAll { + src = ./patches/fruzzy/get_version.patch; + version = old.version; + }) + ]; + configurePhase = '' + substituteInPlace Makefile \ + --replace \ + "nim c" \ + "nim c --nimcache:$TMP --path:${nimpy} --path:${binaryheap}" + ''; + buildPhase = '' + make build + ''; + }); + ghcid = super.ghcid.overrideAttrs(old: { configurePhase = "cd plugins/nvim"; }); diff --git a/pkgs/misc/vim-plugins/patches/fruzzy/get_version.patch b/pkgs/misc/vim-plugins/patches/fruzzy/get_version.patch new file mode 100644 index 000000000000..62aaba118f20 --- /dev/null +++ b/pkgs/misc/vim-plugins/patches/fruzzy/get_version.patch @@ -0,0 +1,25 @@ +diff --git a/rplugin/python3/fruzzy_mod.nim b/rplugin/python3/fruzzy_mod.nim +index dba0689..0109285 100644 +--- a/rplugin/python3/fruzzy_mod.nim ++++ b/rplugin/python3/fruzzy_mod.nim +@@ -12,9 +12,7 @@ when defined(profile): + import nimprof + + proc getVersion(): string {.compileTime.}= +- let ver = staticExec("git describe --tags --always --dirty").strip() +- # let cTime = format(times.now(), "yyyy-MM-dd hh:mm:ss") +- let branch = staticExec("git rev-parse --abbrev-ref HEAD").strip() ++ let ver = "@version@" + var options:seq[string] = newSeq[string]() + if not defined(removelogger): + options.add("info") +@@ -26,7 +24,7 @@ proc getVersion(): string {.compileTime.}= + options.add("release") + let optionsStr = options.join(",") + +- return &"rev: {ver} on branch: {branch} with options: {optionsStr}" ++ return &"version: {ver} with options: {optionsStr}" + + let L = newConsoleLogger(levelThreshold = logging.Level.lvlDebug) + addHandler(L) + diff --git a/pkgs/misc/vim-plugins/vim-plugin-names b/pkgs/misc/vim-plugins/vim-plugin-names index 0dc770ea29ef..dbcb0f3a11a7 100644 --- a/pkgs/misc/vim-plugins/vim-plugin-names +++ b/pkgs/misc/vim-plugins/vim-plugin-names @@ -369,6 +369,7 @@ Quramy/tsuquyomi racer-rust/vim-racer rafaqz/ranger.vim rafi/awesome-vim-colorschemes +raghur/fruzzy raghur/vim-ghost raichoo/purescript-vim Raimondi/delimitMate