neovim-unwrapped: use finalAttrs

finalAttrs is more discoverable via REPL, hence I
- referenced doCheck via finalAttrs
This commit is contained in:
Matthieu Coudron 2024-01-15 17:13:04 +01:00
parent 4c8ce132ff
commit c4be1f71a5

View File

@ -12,11 +12,10 @@
# now defaults to false because some tests can be flaky (clipboard etc), see
# also: https://github.com/neovim/neovim/issues/16233
, doCheck ? false
, nodejs ? null, fish ? null, python3 ? null
}:
let
stdenv.mkDerivation (finalAttrs:
let
nvim-lpeg-dylib = luapkgs: if stdenv.isDarwin
then (luapkgs.lpeg.overrideAttrs (oa: {
preConfigure = ''
@ -42,7 +41,7 @@ let
(nvim-lpeg-dylib ps)
luabitop
mpack
] ++ lib.optionals doCheck [
] ++ lib.optionals finalAttrs.doCheck [
luv
coxpcall
busted
@ -64,17 +63,15 @@ let
in deterministicLuajit.withPackages(ps: [ ps.mpack (nvim-lpeg-dylib ps) ])
else lua.luaOnBuild;
pyEnv = python3.withPackages(ps: with ps; [ pynvim msgpack ]);
in
stdenv.mkDerivation rec {
in {
pname = "neovim-unwrapped";
version = "0.9.5";
src = fetchFromGitHub {
owner = "neovim";
repo = "neovim";
rev = "v${version}";
rev = "v${finalAttrs.version}";
hash = "sha256-CcaBqA0yFCffNPmXOJTo8c9v1jrEBiqAl8CG5Dj5YxE=";
};
@ -105,15 +102,17 @@ in
tree-sitter
unibilium
] ++ lib.optionals stdenv.isDarwin [ libiconv CoreServices ]
++ lib.optionals doCheck [ glibcLocales procps ]
++ lib.optionals finalAttrs.doCheck [ glibcLocales procps ]
;
inherit doCheck;
doCheck = false;
# to be exhaustive, one could run
# make oldtests too
checkPhase = ''
runHook preCheck
make functionaltest
runHook postCheck
'';
nativeBuildInputs = [
@ -123,7 +122,9 @@ in
];
# extra programs test via `make functionaltest`
nativeCheckInputs = [
nativeCheckInputs = let
pyEnv = python3.withPackages(ps: with ps; [ pynvim msgpack ]);
in [
fish
nodejs
pyEnv # for src/clint.py
@ -166,7 +167,7 @@ in
ln -s \
${tree-sitter.buildGrammar {
inherit language src;
version = "neovim-${version}";
version = "neovim-${finalAttrs.version}";
}}/parser \
$out/lib/nvim/parser/${language}.so
'')
@ -199,4 +200,4 @@ in
maintainers = with maintainers; [ manveru rvolosatovs ];
platforms = platforms.unix;
};
}
})