commit:     ac3a9d61285f3e0cf5fffa0588812463ae422335
Author:     Johannes Huber <johu <AT> gmx <DOT> de>
AuthorDate: Fri May 30 15:28:24 2025 +0000
Commit:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Mon Jun  2 16:54:38 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ac3a9d61

net-libs/rtrlib: fix build w/ cmake 4

Closes: https://bugs.gentoo.org/953446
Signed-off-by: Johannes Huber <johu <AT> gmx.de>
Part-of: https://github.com/gentoo/gentoo/pull/42353
Closes: https://github.com/gentoo/gentoo/pull/42353
Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>

 net-libs/rtrlib/files/rtrlib-0.8.0-cmake4.patch | 14 ++++++
 net-libs/rtrlib/rtrlib-0.8.0-r1.ebuild          | 64 +++++++++++++++++++++++++
 2 files changed, 78 insertions(+)

diff --git a/net-libs/rtrlib/files/rtrlib-0.8.0-cmake4.patch 
b/net-libs/rtrlib/files/rtrlib-0.8.0-cmake4.patch
new file mode 100644
index 000000000000..f6112f49fce6
--- /dev/null
+++ b/net-libs/rtrlib/files/rtrlib-0.8.0-cmake4.patch
@@ -0,0 +1,14 @@
+https://github.com/rtrlib/rtrlib/pull/294
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 7e9aa98..736ae62 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -2,7 +2,7 @@ project(rtrlib C)
+ 
+ set(PROJECT_DESCRIPTION "Lightweight C library that implements the RPKI/RTR 
protocol and prefix origin validation.")
+ 
+-cmake_minimum_required(VERSION 2.6)
++cmake_minimum_required(VERSION 3.10)
+ 
+ set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules)
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -std=gnu99 -fstack-protector-all")

diff --git a/net-libs/rtrlib/rtrlib-0.8.0-r1.ebuild 
b/net-libs/rtrlib/rtrlib-0.8.0-r1.ebuild
new file mode 100644
index 000000000000..9054936a4cb3
--- /dev/null
+++ b/net-libs/rtrlib/rtrlib-0.8.0-r1.ebuild
@@ -0,0 +1,64 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit cmake toolchain-funcs
+
+DESCRIPTION="An open-source C implementation of the RPKI/Router Protocol 
client"
+HOMEPAGE="https://rtrlib.realmv6.org/";
+SRC_URI="https://github.com/rtrlib/rtrlib/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~amd64 ~arm64 ~x86"
+IUSE="doc ssh test"
+RESTRICT="!test? ( test )"
+
+RDEPEND="ssh? ( net-libs/libssh:0= )"
+DEPEND="
+       ${RDEPEND}
+       test? ( dev-util/cmocka )
+"
+BDEPEND="
+       doc? ( app-text/doxygen[dot] )
+"
+
+PATCHES=(
+       "${FILESDIR}"/${P}-no-network-tests.patch
+       "${FILESDIR}"/${P}-tests-strict-aliasing.patch
+       "${FILESDIR}"/${P}-cmake4.patch
+)
+
+src_prepare() {
+       # fix path for installing docs
+       sed -i -e "s:share/doc/rtrlib:share/doc/${PF}:" CMakeLists.txt || die
+
+       cmake_src_prepare
+}
+
+src_configure() {
+       local mycmakeargs=(
+               $(cmake_use_find_package doc Doxygen)
+               -DRTRLIB_TRANSPORT_SSH=$(usex ssh)
+               -DUNIT_TESTING=$(usex test)
+       )
+
+       cmake_src_configure
+}
+
+src_test() {
+       tc-is-lto && CMAKE_SKIP_TESTS+=(
+               # These tests use cmocka (so --wrap) which goes wrong
+               # with LTO: bug #951662.
+               test_packets
+               test_packets_static
+       )
+
+       cmake_src_test
+}
+
+src_install() {
+       cmake_src_install
+       find "${D}" -name '*.la' -delete || die
+}

Reply via email to