3
0
Fork 0
forked from mirrors/nixpkgs

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
This commit is contained in:
Matthieu Coudron 2022-05-14 15:53:02 +02:00
parent 90cd5459a1
commit 77a0e5f36e
3 changed files with 25 additions and 8 deletions

View file

@ -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)

View file

@ -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 ;

View file

@ -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";
})