From 77a0e5f36e758ec62354919bd4dcc28b9eeebe3c Mon Sep 17 00:00:00 2001 From: Matthieu Coudron Date: Sat, 14 May 2022 15:53:02 +0200 Subject: [PATCH] luarocks: 3.8.0 -> 3.9.0 pass the config to the luarocks binary also bumps luarocks-nix: bump package due to the luarocks rebase --- maintainers/scripts/update-luarocks-packages | 8 ++++++-- pkgs/development/tools/misc/luarocks/default.nix | 11 +++++++++-- .../tools/misc/luarocks/luarocks-nix.nix | 14 ++++++++++---- 3 files changed, 25 insertions(+), 8 deletions(-) diff --git a/maintainers/scripts/update-luarocks-packages b/maintainers/scripts/update-luarocks-packages index 73a233c5f103..048068a32e12 100755 --- a/maintainers/scripts/update-luarocks-packages +++ b/maintainers/scripts/update-luarocks-packages @@ -158,8 +158,11 @@ def generate_pkg_nix(plug: LuaPlugin): Our cache key associates "p.name-p.version" to its rockspec ''' log.debug("Generating nix expression for %s", plug.name) - cmd = [ "luarocks", "nix"] + custom_env = os.environ.copy() + # TODO check + custom_env['LUAROCKS_CONFIG'] = LUAROCKS_CONFIG + cmd = [ "luarocks", "nix"] if plug.maintainers: cmd.append(f"--maintainers={plug.maintainers}") @@ -194,7 +197,8 @@ def generate_pkg_nix(plug: LuaPlugin): cmd.append(f"--lua-dir={lua_drv_path}/bin") log.debug("running %s", ' '.join(cmd)) - output = subprocess.check_output(cmd, text=True) + + output = subprocess.check_output(cmd, env=custom_env, text=True) output = "callPackage(" + output.strip() + ") {};\n\n" return (plug, output) diff --git a/pkgs/development/tools/misc/luarocks/default.nix b/pkgs/development/tools/misc/luarocks/default.nix index b34c88979211..1b05f88a091f 100644 --- a/pkgs/development/tools/misc/luarocks/default.nix +++ b/pkgs/development/tools/misc/luarocks/default.nix @@ -3,6 +3,7 @@ , lua # for 'luarocks pack' , zip +, nix-update-script # some packages need to be compiled with cmake , cmake , installShellFiles @@ -10,13 +11,13 @@ stdenv.mkDerivation rec { pname = "luarocks"; - version = "3.8.0"; + version = "3.9.0"; src = fetchFromGitHub { owner = "luarocks"; repo = "luarocks"; rev = "v${version}"; - sha256 = "sha256-tPSAtveOodF2w54d82hEyaTj91imtySJUTsk/gje2dQ="; + sha256 = "sha256-i0NmF268aK5lr4zjYyhk4TPUO7Zyz0Cl0fSW43Pmd1Q="; }; patches = [ ./darwin-3.7.0.patch ]; @@ -71,6 +72,12 @@ stdenv.mkDerivation rec { export LUA_PATH="src/?.lua;''${LUA_PATH:-}" ''; + passthru = { + updateScript = nix-update-script { + attrPath = pname; + }; + }; + meta = with lib; { description = "A package manager for Lua"; license = licenses.mit ; diff --git a/pkgs/development/tools/misc/luarocks/luarocks-nix.nix b/pkgs/development/tools/misc/luarocks/luarocks-nix.nix index fe34bfd20a6f..d7dba4f59afb 100644 --- a/pkgs/development/tools/misc/luarocks/luarocks-nix.nix +++ b/pkgs/development/tools/misc/luarocks/luarocks-nix.nix @@ -1,14 +1,20 @@ -{ luarocks, fetchFromGitHub }: +{ luarocks, fetchFromGitHub, nix-update-script }: luarocks.overrideAttrs(old: { pname = "luarocks-nix"; - version = "2021-01-22"; + src = fetchFromGitHub { owner = "nix-community"; repo = "luarocks-nix"; - rev = "6aa1d59e88eaef72d699477c3e7aa98b274ca405"; - sha256 = "sha256-nQLl01RFYZYhpShz0gHxnhwFPvTgALpAbjFPIuTD2D0="; + rev = "b1ff9eeb64c7c1dc5fc177008d6f2be9191c6aa2"; + sha256 = "sha256-mkzrf/6yMyLMIEDwsuCIxi1HJvg57ybyZPXVheFAAHE="; }; patches = []; + passthru = { + updateScript = nix-update-script { + attrPath = "luarocks-nix"; + }; + }; + meta.mainProgram = "luarocks"; })