git.iko.soy/typeable/nixpkgs
on master help sign in
Add checkPhase for neovim (disabled by default) (#55266)

* neovim-unwrapped: now use lua environments * mpv: use lua environments * luaPackages.inspect: init at 3.1.1-0 * luaPackages.lgi: mark as a lua module * luaPackages.vicious: mark as a lua module

commitaaeaa6d1c6052938c302c07407e441e5b5794e48 authorMatthieu Coudron <coudron@iij.ad.jp> dateWed 6 Feb 2019, 00:00 (8 years ago) parentc15c4d7
6 files changed+68−33
maintainers/scripts/luarocks-packages.csv+1 pkgs/applications/editors/neovim/default.nix+34−15 pkgs/applications/video/mpv/default.nix+7−12 pkgs/development/lua-modules/generated-packages.nix+20 pkgs/top-level/all-packages.nix+2−2 pkgs/top-level/lua-packages.nix+4−4
maintainers/scripts/luarocks-packages.csv+1
@@ -1,6 +1,7 @@
11ansicolors,
22argparse,
33dkjson
4+inspect
45lrexlib-gnu,
56lrexlib-posix,
67ltermbox,
pkgs/applications/editors/neovim/default.nix+34−15
@@ -1,15 +1,25 @@
11{ stdenv, fetchFromGitHub, cmake, gettext, msgpack, libtermkey, libiconv
2−, libuv, luaPackages, ncurses, pkgconfig
2+, libuv, lua, ncurses, pkgconfig
33, unibilium, xsel, gperf
44, libvterm-neovim
55, withJemalloc ? true, jemalloc
6+, glibcLocales ? null, procps ? null
7+
8+# now defaults to false because some tests can be flaky (clipboard etc)
9+, doCheck ? false
610}:
711
812with stdenv.lib;
913
1014let
11−
12− neovim = stdenv.mkDerivation rec {
15+ neovimLuaEnv = lua.withPackages(ps:
16+ (with ps; [ mpack lpeg luabitop ]
17+ ++ optionals doCheck [
18+ nvim-client luv coxpcall busted luafilesystem penlight inspect
19+ ]
20+ ));
21+in
22+ stdenv.mkDerivation rec {
1323 name = "neovim-unwrapped-${version}";
1424 version = "0.3.4";
1525
@@ -36,11 +46,20 @@ let
3646 ncurses
3747 libvterm-neovim
3848 unibilium
39− luaPackages.lua
4049 gperf
50+ neovimLuaEnv
4151 ] ++ optional withJemalloc jemalloc
4252 ++ optional stdenv.isDarwin libiconv
43− ++ lualibs;
53+ ++ optionals doCheck [ glibcLocales procps ]
54+ ;
55+
56+ inherit doCheck;
57+
58+ # to be exhaustive, one could run
59+ # make oldtests too
60+ checkPhase = ''
61+ make functionaltest
62+ '';
4463
4564 nativeBuildInputs = [
4665 cmake
@@ -48,10 +67,6 @@ let
4867 pkgconfig
4968 ];
5069
51− LUA_PATH = stdenv.lib.concatStringsSep ";" (map luaPackages.getLuaPath lualibs);
52− LUA_CPATH = stdenv.lib.concatStringsSep ";" (map luaPackages.getLuaCPath lualibs);
53−
54− lualibs = [ luaPackages.mpack luaPackages.lpeg luaPackages.luabitop ];
5570
5671 # nvim --version output retains compilation flags and references to build tools
5772 postPatch = ''
@@ -61,9 +76,11 @@ let
6176 disallowedReferences = [ stdenv.cc ];
6277
6378 cmakeFlags = [
64− "-DLUA_PRG=${luaPackages.lua}/bin/lua"
79+ "-DLUA_PRG=${neovimLuaEnv}/bin/lua"
6580 "-DGPERF_PRG=${gperf}/bin/gperf"
66− ];
81+ ]
82+ ++ optional doCheck "-DBUSTED_PRG=${neovimLuaEnv}/bin/busted"
83+ ;
6784
6885 # triggers on buffer overflow bug while running tests
6986 hardeningDisable = [ "fortify" ];
@@ -81,6 +98,11 @@ let
8198 $out/bin/nvim
8299 '';
83100
101+ # export PATH=$PWD/build/bin:${PATH}
102+ shellHook=''
103+ export VIMRUNTIME=$PWD/runtime
104+ '';
105+
84106 meta = {
85107 description = "Vim text editor fork focused on extensibility and agility";
86108 longDescription = ''
@@ -104,7 +126,4 @@ let
104126 # https://nix-cache.s3.amazonaws.com/log/9ahcb52905d9d417zsskjpc331iailpq-neovim-unwrapped-0.2.2.drv
105127 broken = stdenv.isAarch64;
106128 };
107− };
108−
109−in
110− neovim
129+ }
pkgs/applications/video/mpv/default.nix+7−12
@@ -1,7 +1,7 @@
11{ stdenv, fetchurl, fetchFromGitHub, makeWrapper
22, docutils, perl, pkgconfig, python3, which, ffmpeg_4
33, freefont_ttf, freetype, libass, libpthreadstubs, mujs
4−, lua, luasocket, libuchardet, libiconv ? null, darwin
4+, lua, libuchardet, libiconv ? null, darwin
55
66, waylandSupport ? false
77 , wayland ? null
@@ -92,6 +92,8 @@ let
9292 "http://www.freehackers.org/~tnagy/release/waf-${wafVersion}" ];
9393 sha256 = "0j7sbn3w6bgslvwwh5v9527w3gi2sd08kskrgxamx693y0b0i3ia";
9494 };
95+ luaEnv = lua.withPackages(ps: with ps; [ luasocket]);
96+
9597in stdenv.mkDerivation rec {
9698 name = "mpv-${version}";
9799 version = "0.29.1";
@@ -139,7 +141,7 @@ in stdenv.mkDerivation rec {
139141
140142 buildInputs = [
141143 ffmpeg_4 freetype libass libpthreadstubs
142− lua luasocket libuchardet mujs
144+ luaEnv libuchardet mujs
143145 ] ++ optional alsaSupport alsaLib
144146 ++ optional archiveSupport libarchive
145147 ++ optional bluraySupport libbluray
@@ -183,16 +185,9 @@ in stdenv.mkDerivation rec {
183185
184186 # Ensure youtube-dl is available in $PATH for mpv
185187 wrapperFlags =
186− let
187− getPath = type : "${luasocket}/lib/lua/${lua.luaversion}/?.${type};" +
188− "${luasocket}/share/lua/${lua.luaversion}/?.${type}";
189− luaPath = getPath "lua";
190− luaCPath = getPath "so";
191− in
192− ''
193− --prefix LUA_PATH : "${luaPath}" \
194− --prefix LUA_CPATH : "${luaCPath}" \
195− '' + optionalString youtubeSupport ''
188+
189+ ''--prefix PATH : "${luaEnv}/bin" \''
190+ + optionalString youtubeSupport ''
196191 --prefix PATH : "${youtube-dl}/bin" \
197192 '' + optionalString vapoursynthSupport ''
198193 --prefix PYTHONPATH : "${vapoursynth}/lib/${python3.libPrefix}/site-packages:$PYTHONPATH"
pkgs/development/lua-modules/generated-packages.nix+20
@@ -70,6 +70,26 @@ dkjson = buildLuarocksPackage {
7070 };
7171 };
7272};
73+inspect = buildLuarocksPackage {
74+ pname = "inspect";
75+ version = "3.1.1-0";
76+
77+ src = fetchurl {
78+ url = https://luarocks.org/inspect-3.1.1-0.src.rock;
79+ sha256 = "0k4g9ahql83l4r2bykfs6sacf9l1wdpisav2i0z55fyfcdv387za";
80+ };
81+ disabled = ( luaOlder "5.1");
82+ propagatedBuildInputs = [lua ];
83+ buildType="builtin";
84+
85+ meta = {
86+ homepage = "https://github.com/kikito/inspect.lua";
87+ description="Lua table visualizer, ideal for debugging";
88+ license = {
89+ fullName = "MIT <http://opensource.org/licenses/MIT>";
90+ };
91+ };
92+};
7393lrexlib-gnu = buildLuarocksPackage {
7494 pname = "lrexlib-gnu";
7595 version = "2.9.0-1";
pkgs/top-level/all-packages.nix+2−2
@@ -18354,7 +18354,7 @@ in
1835418354 };
1835518355
1835618356 mpv = callPackage ../applications/video/mpv rec {
18357− inherit (luaPackages) luasocket;
18357+ inherit lua;
1835818358 waylandSupport = stdenv.isLinux;
1835918359 alsaSupport = !stdenv.isDarwin;
1836018360 pulseSupport = !stdenv.isDarwin;
@@ -19816,7 +19816,7 @@ in
1981619816 wrapNeovim = callPackage ../applications/editors/neovim/wrapper.nix { };
1981719817
1981819818 neovim-unwrapped = callPackage ../applications/editors/neovim {
19819− luaPackages = luajitPackages;
19819+ lua = luajit;
1982019820 };
1982119821
1982219822 neovim = wrapNeovim neovim-unwrapped { };
pkgs/top-level/lua-packages.nix+4−4
@@ -972,7 +972,7 @@ with self; {
972972 };
973973 };
974974
975− lgi = stdenv.mkDerivation rec {
975+ lgi = toLuaModule(stdenv.mkDerivation rec {
976976 name = "lgi-${version}";
977977 version = "0.9.2";
978978
@@ -1007,7 +1007,7 @@ with self; {
10071007 maintainers = with maintainers; [ lovek323 rasendubi ];
10081008 platforms = platforms.unix;
10091009 };
1010− };
1010+ });
10111011
10121012 mpack = buildLuaPackage rec {
10131013 name = "mpack-${version}";
@@ -1105,7 +1105,7 @@ with self; {
11051105 };
11061106 };
11071107
1108− vicious = stdenv.mkDerivation rec {
1108+ vicious = toLuaModule(stdenv.mkDerivation rec {
11091109 name = "vicious-${version}";
11101110 version = "2.3.1";
11111111
@@ -1131,7 +1131,7 @@ with self; {
11311131 maintainers = with maintainers; [ makefu mic92 ];
11321132 platforms = platforms.linux;
11331133 };
1134− };
1134+ });
11351135
11361136});
11371137in (lib.extends overrides packages)