@ -1,15 +1,25 @@
{ stdenv , fetchFromGitHub , cmake , gettext , msgpack , libtermkey , libiconv
, libuv , luaPackages , ncurses , pkgconfig
, libuv , lua , ncurses , pkgconfig
, unibilium , xsel , gperf
, libvterm-neovim
, withJemalloc ? true , jemalloc
, glibcLocales ? null , procps ? null
# now defaults to false because some tests can be flaky (clipboard etc)
, doCheck ? false
} :
with stdenv . lib ;
let
neovim = stdenv . mkDerivation rec {
neovimLuaEnv = lua . withPackages ( ps :
( with ps ; [ mpack lpeg luabitop ]
++ optionals doCheck [
nvim-client luv coxpcall busted luafilesystem penlight inspect
]
) ) ;
in
stdenv . mkDerivation rec {
name = " n e o v i m - u n w r a p p e d - ${ version } " ;
version = " 0 . 3 . 4 " ;
@ -36,11 +46,20 @@ let
ncurses
libvterm-neovim
unibilium
luaPackages . lua
gperf
neovimLuaEnv
] ++ optional withJemalloc jemalloc
++ optional stdenv . isDarwin libiconv
++ lualibs ;
++ optionals doCheck [ glibcLocales procps ]
;
inherit doCheck ;
# to be exhaustive, one could run
# make oldtests too
checkPhase = ''
make functionaltest
'' ;
nativeBuildInputs = [
cmake
@ -48,10 +67,6 @@ let
pkgconfig
] ;
LUA_PATH = stdenv . lib . concatStringsSep " ; " ( map luaPackages . getLuaPath lualibs ) ;
LUA_CPATH = stdenv . lib . concatStringsSep " ; " ( map luaPackages . getLuaCPath lualibs ) ;
lualibs = [ luaPackages . mpack luaPackages . lpeg luaPackages . luabitop ] ;
# nvim --version output retains compilation flags and references to build tools
postPatch = ''
@ -61,9 +76,11 @@ let
disallowedReferences = [ stdenv . cc ] ;
cmakeFlags = [
" - D L U A _ P R G = ${ luaPackages . lua } / b i n / l u a "
" - D L U A _ P R G = ${ neovimLuaEnv } / b i n / l u a "
" - D G P E R F _ P R G = ${ gperf } / b i n / g p e r f "
] ;
]
++ optional doCheck " - D B U S T E D _ P R G = ${ neovimLuaEnv } / b i n / b u s t e d "
;
# triggers on buffer overflow bug while running tests
hardeningDisable = [ " f o r t i f y " ] ;
@ -81,6 +98,11 @@ let
$ out/bin/nvim
'' ;
# export PATH=$PWD/build/bin:${PATH}
shellHook = ''
export VIMRUNTIME = $ PWD/runtime
'' ;
meta = {
description = " V i m t e x t e d i t o r f o r k f o c u s e d o n e x t e n s i b i l i t y a n d a g i l i t y " ;
longDescription = ''
@ -104,7 +126,4 @@ let
# https://nix-cache.s3.amazonaws.com/log/9ahcb52905d9d417zsskjpc331iailpq-neovim-unwrapped-0.2.2.drv
broken = stdenv . isAarch64 ;
} ;
} ;
in
neovim
}