From 861c7554d18200137a1480d733cbbb337614b500 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Mon, 19 Dec 2022 08:42:26 +0100 Subject: [PATCH 1/3] buildLuaPackage: make makeFlags expandable --- .../development/lua-modules/generic/default.nix | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/pkgs/development/lua-modules/generic/default.nix b/pkgs/development/lua-modules/generic/default.nix index 183a958b4e1f1..7f07c6602dacd 100644 --- a/pkgs/development/lua-modules/generic/default.nix +++ b/pkgs/development/lua-modules/generic/default.nix @@ -2,6 +2,7 @@ { disabled ? false , propagatedBuildInputs ? [ ] +, makeFlags ? [ ] , ... } @ attrs: @@ -9,18 +10,16 @@ if disabled then throw "${attrs.name} not supported by interpreter lua-${lua.luaversion}" else toLuaModule (lua.stdenv.mkDerivation ( - { + attrs // { + name = "lua${lua.luaversion}-" + attrs.pname + "-" + attrs.version; + makeFlags = [ "PREFIX=$(out)" - "LUA_LIBDIR=$(out)/lib/lua/${lua.luaversion}" "LUA_INC=-I${lua}/include" - ]; - } - // - attrs - // - { - name = "lua${lua.luaversion}-" + attrs.pname + "-" + attrs.version; + "LUA_LIBDIR=$(out)/lib/lua/${lua.luaversion}" + "LUA_VERSION=${lua.luaversion}" + ] ++ makeFlags; + propagatedBuildInputs = propagatedBuildInputs ++ [ lua # propagate it for its setup-hook ]; From 40ff955c07786cf3f5dad27b4f08f1df0f280458 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Mon, 19 Dec 2022 08:43:14 +0100 Subject: [PATCH 2/3] luaPlugins.lua-resty-lrucache: init at 0.13 --- pkgs/top-level/lua-packages.nix | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/pkgs/top-level/lua-packages.nix b/pkgs/top-level/lua-packages.nix index 73a4efae15b71..606e3b92511e9 100644 --- a/pkgs/top-level/lua-packages.nix +++ b/pkgs/top-level/lua-packages.nix @@ -30,7 +30,7 @@ let lib.concatMapStringsSep ";" (path: "${drv}/${path}") pathListForVersion; in -{ +rec { # Dont take luaPackages from "global" pkgs scope to avoid mixing lua versions luaPackages = self; @@ -59,6 +59,25 @@ in # a fork of luarocks used to generate nix lua derivations from rockspecs luarocks-nix = callPackage ../development/tools/misc/luarocks/luarocks-nix.nix { }; + lua-resty-lrucache = callPackage ({ fetchFromGitHub }: buildLuaPackage rec { + pname = "lua-resty-lrucache"; + version = "0.13"; + + src = fetchFromGitHub { + owner = "openresty"; + repo = "lua-resty-lrucache"; + rev = "v${version}"; + sha256 = "sha256-J8RNAMourxqUF8wPKd8XBhNwGC/x1KKvrVnZtYDEu4Q="; + }; + + meta = with lib; { + description = "Lua-land LRU Cache based on LuaJIT FFI"; + homepage = "https://github.com/openresty/lua-resty-lrucache"; + license = licenses.bsd3; + maintainers = with maintainers; [ SuperSandro2000 ]; + }; + }) {}; + luxio = callPackage ({ fetchurl, which, pkg-config }: buildLuaPackage rec { pname = "luxio"; version = "13"; From e33fb7418d3974b623df53a463f94010d3a101bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Mon, 19 Dec 2022 08:43:32 +0100 Subject: [PATCH 3/3] luaPlugins.lua-resty-core: init at 0.1.24 --- pkgs/top-level/lua-packages.nix | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/pkgs/top-level/lua-packages.nix b/pkgs/top-level/lua-packages.nix index 606e3b92511e9..5ea0e298f0a6b 100644 --- a/pkgs/top-level/lua-packages.nix +++ b/pkgs/top-level/lua-packages.nix @@ -59,6 +59,27 @@ rec { # a fork of luarocks used to generate nix lua derivations from rockspecs luarocks-nix = callPackage ../development/tools/misc/luarocks/luarocks-nix.nix { }; + lua-resty-core = callPackage ({ fetchFromGitHub }: buildLuaPackage rec { + pname = "lua-resty-core"; + version = "0.1.24"; + + src = fetchFromGitHub { + owner = "openresty"; + repo = "lua-resty-core"; + rev = "v${version}"; + sha256 = "sha256-obwyxHSot1Lb2c1dNqJor3inPou+UIBrqldbkNBCQQk="; + }; + + propagatedBuildInputs = [ lua-resty-lrucache ]; + + meta = with lib; { + description = "New FFI-based API for lua-nginx-module"; + homepage = "https://github.com/openresty/lua-resty-core"; + license = licenses.bsd3; + maintainers = with maintainers; [ SuperSandro2000 ]; + }; + }) {}; + lua-resty-lrucache = callPackage ({ fetchFromGitHub }: buildLuaPackage rec { pname = "lua-resty-lrucache"; version = "0.13";