From a4d954080f71f72f95aee116db8f753f3ded3c2d Mon Sep 17 00:00:00 2001 From: "Matthieu C." <886074+teto@users.noreply.github.com> Date: Tue, 30 Apr 2024 00:39:17 +0200 Subject: [PATCH] lua: fixed the way to create environments `paths = requiredLuaModules (extraLibs ++ [ lua ] );` would discard lua and so in absence of a propagated lua, the lua.withPackages would return an empty bin/ directory. --- pkgs/development/interpreters/lua-5/build-luarocks-package.nix | 1 + pkgs/development/interpreters/lua-5/wrapper.nix | 2 +- pkgs/development/lua-modules/overrides.nix | 3 ++- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/pkgs/development/interpreters/lua-5/build-luarocks-package.nix b/pkgs/development/interpreters/lua-5/build-luarocks-package.nix index 97ac535c9303..cb1b9825e14e 100644 --- a/pkgs/development/interpreters/lua-5/build-luarocks-package.nix +++ b/pkgs/development/interpreters/lua-5/build-luarocks-package.nix @@ -89,6 +89,7 @@ let generatedRockspecFilename = "./${self.pname}-${self.rockspecVersion}.rockspec"; nativeBuildInputs = [ + lua # for lua.h wrapLua luarocks ]; diff --git a/pkgs/development/interpreters/lua-5/wrapper.nix b/pkgs/development/interpreters/lua-5/wrapper.nix index bd97e7186b97..b5166739351e 100644 --- a/pkgs/development/interpreters/lua-5/wrapper.nix +++ b/pkgs/development/interpreters/lua-5/wrapper.nix @@ -10,7 +10,7 @@ # Create a lua executable that knows about additional packages. let env = let - paths = requiredLuaModules (extraLibs ++ [ lua ] ); + paths = [ lua ] ++ requiredLuaModules extraLibs; in buildEnv { name = "${lua.name}-env"; diff --git a/pkgs/development/lua-modules/overrides.nix b/pkgs/development/lua-modules/overrides.nix index b4b2bfe4af6a..cc28ca4fec8f 100644 --- a/pkgs/development/lua-modules/overrides.nix +++ b/pkgs/development/lua-modules/overrides.nix @@ -641,7 +641,8 @@ in tar xf *.tar.gz ''; - propagatedBuildInputs = [ lua luaposix + propagatedBuildInputs = [ + luaposix readline.out ];