From c4be1f71a512cbb4bd68ef8da99025023048f6d3 Mon Sep 17 00:00:00 2001 From: Matthieu Coudron <886074+teto@users.noreply.github.com> Date: Mon, 15 Jan 2024 17:13:04 +0100 Subject: [PATCH] neovim-unwrapped: use finalAttrs finalAttrs is more discoverable via REPL, hence I - referenced doCheck via finalAttrs --- pkgs/applications/editors/neovim/default.nix | 27 ++++++++++---------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/pkgs/applications/editors/neovim/default.nix b/pkgs/applications/editors/neovim/default.nix index 60035e3f1b58..82bb404fd24a 100644 --- a/pkgs/applications/editors/neovim/default.nix +++ b/pkgs/applications/editors/neovim/default.nix @@ -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; }; - } + })