commit:     c0c44bc43be3faed270239c211378a75ac3ab812
Author:     Alexey Sokolov <alexey+gentoo <AT> asokolov <DOT> org>
AuthorDate: Fri Mar 28 21:01:16 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sat Mar 29 13:58:56 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c0c44bc4

net-libs/rpc2: fix build without lua

Closes: https://bugs.gentoo.org/952846
Signed-off-by: Alexey Sokolov <alexey+gentoo <AT> asokolov.org>
Closes: https://github.com/gentoo/gentoo/pull/41356
Signed-off-by: Sam James <sam <AT> gentoo.org>

 net-libs/rpc2/files/rpc2-2.37-lua.patch | 11 +++++++++++
 net-libs/rpc2/rpc2-2.37.ebuild          |  4 ++++
 2 files changed, 15 insertions(+)

diff --git a/net-libs/rpc2/files/rpc2-2.37-lua.patch 
b/net-libs/rpc2/files/rpc2-2.37-lua.patch
index 160850f10174..fd7c0bca0d31 100644
--- a/net-libs/rpc2/files/rpc2-2.37-lua.patch
+++ b/net-libs/rpc2/files/rpc2-2.37-lua.patch
@@ -32,3 +32,14 @@ https://wiki.gentoo.org/wiki/Lua/Porting_notes
      lua_register(L, "time", timeval_new);
      return 1;
  }
+--- a/configure.ac
++++ b/configure.ac
+@@ -55,6 +55,8 @@ AS_IF([test "x$with_libuv" != "xno"],
+ 
+ AC_ARG_WITH(lua,
+   [AS_HELP_STRING([--with-lua], [embed Lua interpreter])],
++  [], [with_lua=no])
++AS_IF([test "x$with_lua" != "xno"],
+   [PKG_CHECK_EXISTS([lua5.1], [ PKG_CHECK_MODULES([LUA], [lua5.1]) ],
+                              [ PKG_CHECK_MODULES([LUA], [lua]) ])
+    AC_DEFINE(USE_LUA, 1, [Define this when linking against Lua])

diff --git a/net-libs/rpc2/rpc2-2.37.ebuild b/net-libs/rpc2/rpc2-2.37.ebuild
index 68325e3cf67c..8701fd44b6d0 100644
--- a/net-libs/rpc2/rpc2-2.37.ebuild
+++ b/net-libs/rpc2/rpc2-2.37.ebuild
@@ -38,6 +38,10 @@ PATCHES=(
        "${FILESDIR}"/rpc2-2.37-lua.patch
 )
 
+pkg_setup() {
+       use lua && lua-single_pkg_setup
+}
+
 src_prepare() {
        default
        eautoreconf

Reply via email to