From 811f95f000d9610bd85cca1cf78ae9a069464d87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Baylac-Jacqu=C3=A9?= Date: Fri, 22 Apr 2022 12:50:43 +0200 Subject: [PATCH] luaPackages.luaunbound: init at 1.0.0-1 Required for Prosody 0.12.0. I first tried to run the bare ./maintainers/scripts/update-luarocks-packages, however it did break a fair share of Lua packages. In the end, I: 1. Added the luaunbound entry to luarocks-packages.csv 2. Run the update-luprocks-packages. 3. Cherry picked the luaunbound entry 4. Reverted the rest of lua-modules/generated-packages.nix to what we currently have in Nixpkgs. 5. Injected the native unbound library via the lua-modules overrides. --- maintainers/scripts/luarocks-packages.csv | 1 + .../lua-modules/generated-packages.nix | 25 +++++++++++++++++++ pkgs/development/lua-modules/overrides.nix | 6 +++++ 3 files changed, 32 insertions(+) diff --git a/maintainers/scripts/luarocks-packages.csv b/maintainers/scripts/luarocks-packages.csv index bdda8020a3da..2d903430520b 100644 --- a/maintainers/scripts/luarocks-packages.csv +++ b/maintainers/scripts/luarocks-packages.csv @@ -64,6 +64,7 @@ luasocket,,,,,, luasql-sqlite3,,,,,,vyp luassert,,,,,, luasystem,,,,,, +luaunbound,,,,, luautf8,,,,,,pstn luazip,,,,,, lua-yajl,,,,,,pstn diff --git a/pkgs/development/lua-modules/generated-packages.nix b/pkgs/development/lua-modules/generated-packages.nix index 4269d7eb0d7e..75c4426732d0 100644 --- a/pkgs/development/lua-modules/generated-packages.nix +++ b/pkgs/development/lua-modules/generated-packages.nix @@ -1944,6 +1944,31 @@ buildLuarocksPackage { }; }) {}; +luaunbound = callPackage({ buildLuarocksPackage, luaOlder, luaAtLeast +, fetchurl, lua +}: +buildLuarocksPackage { + pname = "luaunbound"; + version = "1.0.0-1"; + knownRockspec = (fetchurl { + url = "https://luarocks.org/luaunbound-1.0.0-1.rockspec"; + sha256 = "1zlkibdwrj5p97nhs33cz8xx0323z3kiq5x7v0h3i7v6j0h8ppvn"; + }).outPath; + src = fetchurl { + url = "https://code.zash.se/dl/luaunbound/luaunbound-1.0.0.tar.gz"; + sha256 = "1lsh0ylp5xskygxl5qdv6mhkm1x8xp0vfd5prk5hxkr19jk5mr3d"; + }; + + disabled = with lua; (luaOlder "5.1") || (luaAtLeast "5.5"); + propagatedBuildInputs = [ lua ]; + + meta = { + homepage = "https://www.zash.se/luaunbound.html"; + description = "A binding to libunbound"; + license.fullName = "MIT"; + }; +}) {}; + luautf8 = callPackage({ buildLuarocksPackage, luaOlder, luaAtLeast , fetchurl, lua }: diff --git a/pkgs/development/lua-modules/overrides.nix b/pkgs/development/lua-modules/overrides.nix index b659bd9382ad..b2d239774c73 100644 --- a/pkgs/development/lua-modules/overrides.nix +++ b/pkgs/development/lua-modules/overrides.nix @@ -257,6 +257,12 @@ with prev; ]; }); + luaunbound = prev.lib.overrideLuarocks prev.luaunbound(drv: { + externalDeps = [ + { name = "libunbound"; dep = pkgs.unbound; } + ]; + }); + luuid = (prev.lib.overrideLuarocks prev.luuid (drv: { externalDeps = [ { name = "LIBUUID"; dep = pkgs.libuuid; }