commit:     19291467aba84d673813849809648598b9355816
Author:     Alexey Sokolov <alexey+gentoo <AT> asokolov <DOT> org>
AuthorDate: Thu Mar 27 18:08:21 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Mar 28 15:20:14 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=19291467

net-libs/rpc2: add 2.37

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

 net-libs/rpc2/Manifest                            |  1 +
 net-libs/rpc2/files/rpc2-2.37-gcc15.patch         | 13 +++++
 net-libs/rpc2/files/rpc2-2.37-lua.patch           | 34 +++++++++++++
 net-libs/rpc2/files/rpc2-2.37-respect-flags.patch | 17 +++++++
 net-libs/rpc2/metadata.xml                        |  3 ++
 net-libs/rpc2/rpc2-2.37.ebuild                    | 59 +++++++++++++++++++++++
 6 files changed, 127 insertions(+)

diff --git a/net-libs/rpc2/Manifest b/net-libs/rpc2/Manifest
index 529ebdbf6455..8ce0a8060655 100644
--- a/net-libs/rpc2/Manifest
+++ b/net-libs/rpc2/Manifest
@@ -1 +1,2 @@
 DIST rpc2-2.14.tar.xz 427144 BLAKE2B 
e0b2fb6d0eb8d1391b7049142cfea7d4e8d760e6c2d5d646c705b4efbfcd9ac7ea40168ca40e0c184e2b04f0b3a26afd19fb2f2bda4bd12b511d44962749f7ca
 SHA512 
b8a1b87ee27d820cbe30e7d031ca36b5e07340e3795755672d3831109f844de9b3985deb371b52cd9cde0b023d59a8d9d6c73576afcf0af8034b29bf9f3602be
+DIST rpc2-2.37.tar.gz 2012661 BLAKE2B 
e1142d315e24a6d7d4136795c72a86b0ddf762b0315bdc7432293e3052b82e703e20aa82d26a9e11a3449c1dba542a4ba539644b23a7e7da83fd77c9e6636fc1
 SHA512 
16087e616b9f540fed90724ac8c45e337ce9bc03a09c27d8d92335959db1f5ea9e22a6d60f3a5e2dddc9fcd840ed959f683b6b3906823ed1af3b18ba696a93eb

diff --git a/net-libs/rpc2/files/rpc2-2.37-gcc15.patch 
b/net-libs/rpc2/files/rpc2-2.37-gcc15.patch
new file mode 100644
index 000000000000..957058423157
--- /dev/null
+++ b/net-libs/rpc2/files/rpc2-2.37-gcc15.patch
@@ -0,0 +1,13 @@
+https://bugs.gentoo.org/947850
+
+--- a/rp2gen/crout.c
++++ b/rp2gen/crout.c
+@@ -96,7 +96,7 @@ extern rp2_bool testing;
+ extern rp2_bool cplusplus;
+ extern rp2_bool neterrors; /* exchange OS independent errors */
+ extern struct subsystem subsystem;
+-extern unsigned versionnumber; /* used to check version */
++extern time_t versionnumber; /* used to check version */
+ extern ENTRY *find();
+ 
+ enum

diff --git a/net-libs/rpc2/files/rpc2-2.37-lua.patch 
b/net-libs/rpc2/files/rpc2-2.37-lua.patch
new file mode 100644
index 000000000000..160850f10174
--- /dev/null
+++ b/net-libs/rpc2/files/rpc2-2.37-lua.patch
@@ -0,0 +1,34 @@
+https://wiki.gentoo.org/wiki/Lua/Porting_notes
+
+--- a/rpc2-src/lua.c
++++ b/rpc2-src/lua.c
+@@ -303,10 +303,28 @@ static void l2c_totimeval(lua_State *L, int index, 
struct timeval *tv)
+     }
+ }
+ 
++#if !defined LUA_VERSION_NUM || LUA_VERSION_NUM==501
++/*
++** Adapted from Lua 5.2.0
++*/
++static void luaL_setfuncs (lua_State *L, const luaL_Reg *l, int nup) {
++  luaL_checkstack(L, nup+1, "too many upvalues");
++  for (; l->name != NULL; l++) {  /* fill the table with given functions */
++    int i;
++    lua_pushstring(L, l->name);
++    for (i = 0; i < nup; i++)  /* copy upvalues to the top */
++      lua_pushvalue(L, -(nup+1));
++    lua_pushcclosure(L, l->func, nup);  /* closure with those upvalues */
++    lua_settable(L, -(nup + 3));
++  }
++  lua_pop(L, nup);  /* remove upvalues */
++}
++#endif
++
+ static int l2c_timeval_init(lua_State *L)
+ {
+     luaL_newmetatable(L, RPC2_TIMEVAL);
+-    luaL_openlib(L, NULL, timeval_m, 0);
++    luaL_setfuncs(L, timeval_m, 0);
+     lua_register(L, "time", timeval_new);
+     return 1;
+ }

diff --git a/net-libs/rpc2/files/rpc2-2.37-respect-flags.patch 
b/net-libs/rpc2/files/rpc2-2.37-respect-flags.patch
new file mode 100644
index 000000000000..d30ae5aadab9
--- /dev/null
+++ b/net-libs/rpc2/files/rpc2-2.37-respect-flags.patch
@@ -0,0 +1,17 @@
+--- a/rp2gen/Makefile.am
++++ b/rp2gen/Makefile.am
+@@ -3,13 +3,9 @@
+ CCLD=$(NATIVECC)
+ #EXEEXT=
+ AM_YFLAGS= -d
+-AM_CPPFLAGS= -I$(top_builddir)/include -I$(top_srcdir)/include -I$(srcdir) -I.
++AM_CPPFLAGS= -I$(top_builddir)/include -I$(top_srcdir)/include -I$(srcdir) 
-I. $(CFLAGS)
+ 
+ # override any cross compilation target flags
+-CFLAGS=-Wall
+-LDFLAGS=
+-LIBS=
+-
+ .c.o:
+       $(NATIVECC) $(AM_CPPFLAGS) -c $<
+ 

diff --git a/net-libs/rpc2/metadata.xml b/net-libs/rpc2/metadata.xml
index eefc50cbc6d0..2d8df3a8bbd4 100644
--- a/net-libs/rpc2/metadata.xml
+++ b/net-libs/rpc2/metadata.xml
@@ -5,6 +5,9 @@
                <email>[email protected]</email>
                <name>Gentoo Base System</name>
        </maintainer>
+       <use>
+               <flag name="codatunneld">Support for codatunneld.</flag>
+       </use>
        <upstream>
                <remote-id type="github">cmusatyalab/coda</remote-id>
        </upstream>

diff --git a/net-libs/rpc2/rpc2-2.37.ebuild b/net-libs/rpc2/rpc2-2.37.ebuild
new file mode 100644
index 000000000000..68325e3cf67c
--- /dev/null
+++ b/net-libs/rpc2/rpc2-2.37.ebuild
@@ -0,0 +1,59 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+LUA_COMPAT=( lua5-1 )
+
+inherit autotools flag-o-matic lua-single
+
+DESCRIPTION="Remote procedure call package for IP/UDP (used by Coda)"
+HOMEPAGE="http://www.coda.cs.cmu.edu/";
+SRC_URI="https://github.com/cmusatyalab/coda/archive/refs/tags/${P}.tar.gz";
+S="${WORKDIR}/coda-${P}/lib-src/rpc2"
+
+LICENSE="LGPL-2.1"
+SLOT="1"
+KEYWORDS="~alpha ~amd64 ~hppa ~mips ~ppc ~sparc ~x86"
+IUSE="codatunneld lua"
+REQUIRED_USE="${LUA_REQUIRED_USE}"
+
+RDEPEND="
+       codatunneld? (
+               dev-libs/libuv:=
+               net-libs/gnutls:=
+       )
+       lua? (
+               ${LUA_DEPS}
+       )
+       >=sys-libs/lwp-2.5:1
+"
+DEPEND="${RDEPEND}"
+BDEPEND="virtual/pkgconfig"
+
+PATCHES=(
+       "${FILESDIR}"/rpc2-2.37-respect-flags.patch
+       "${FILESDIR}"/rpc2-2.14-include.patch
+       "${FILESDIR}"/rpc2-2.37-gcc15.patch
+       "${FILESDIR}"/rpc2-2.37-lua.patch
+)
+
+src_prepare() {
+       default
+       eautoreconf
+
+       # https://bugs.gentoo.org/947850
+       append-cflags -std=gnu17
+}
+
+src_configure() {
+       econf \
+               $(use_with codatunneld libuv) \
+               $(use_with lua)
+}
+
+src_install() {
+       default
+
+       find "${ED}" -type f -name '*.la' -delete || die
+}

Reply via email to