dev-libs/thrift: fix build with cmake 4

Closes: https://bugs.gentoo.org/951678
Signed-off-by: Kostadin Shishmanov <kostadinshishmanov@protonmail.com>
Part-of: https://github.com/gentoo/gentoo/pull/42230
Closes: https://github.com/gentoo/gentoo/pull/42230
Signed-off-by: Sam James <sam@gentoo.org>
This commit is contained in:
Kostadin Shishmanov 2025-05-23 23:33:16 +03:00 committed by Sam James
parent 36d734c80d
commit ebcbaf61d4
No known key found for this signature in database
GPG Key ID: 738409F520DF9190
2 changed files with 128 additions and 0 deletions

View File

@ -0,0 +1,54 @@
https://bugs.gentoo.org/951678
https://github.com/apache/thrift/commit/b3fc4b2
From b3fc4b224258e4bf154bf774746f0d2554edb90c Mon Sep 17 00:00:00 2001
From: Vyas Ramasubramani <vyas.ramasubramani@gmail.com>
Date: Sun, 20 Apr 2025 13:57:06 -0700
Subject: [PATCH] Update minimum required CMake version for CMake 4.0
compatibility
---
CMakeLists.txt | 2 +-
compiler/cpp/CMakeLists.txt | 2 +-
compiler/cpp/tests/CMakeLists.txt | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b76d7035b22..1f74e75c5f8 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -17,7 +17,7 @@
# under the License.
#
-cmake_minimum_required(VERSION 3.4)
+cmake_minimum_required(VERSION 3.16)
if(POLICY CMP0048)
cmake_policy(SET CMP0048 NEW) # package version behavior added in cmake 3.0
diff --git a/compiler/cpp/CMakeLists.txt b/compiler/cpp/CMakeLists.txt
index b0f123555d8..4c1c2c56a55 100644
--- a/compiler/cpp/CMakeLists.txt
+++ b/compiler/cpp/CMakeLists.txt
@@ -17,7 +17,7 @@
# under the License.
#
-cmake_minimum_required(VERSION 3.3)
+cmake_minimum_required(VERSION 3.16)
project("thrift-compiler" VERSION ${PACKAGE_VERSION})
# version.h now handled via veralign.sh
diff --git a/compiler/cpp/tests/CMakeLists.txt b/compiler/cpp/tests/CMakeLists.txt
index d9c5209134c..6a078ec6304 100644
--- a/compiler/cpp/tests/CMakeLists.txt
+++ b/compiler/cpp/tests/CMakeLists.txt
@@ -16,7 +16,7 @@
# specific language governing permissions and limitations
# under the License.
#
-cmake_minimum_required(VERSION 2.8.12)
+cmake_minimum_required(VERSION 3.16)
project(thrift_compiler_tests)

View File

@ -0,0 +1,74 @@
# Copyright 2022-2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
inherit cmake
DESCRIPTION="C++ bindings for Apache Thrift"
HOMEPAGE="https://thrift.apache.org/lib/cpp.html"
# Misses testing files
# SRC_URI="mirror://apache/thrift/${PV}/${P}.tar.gz"
SRC_URI="
https://github.com/apache/thrift/archive/refs/tags/v${PV}.tar.gz
-> ${P}.gh.tar.gz
"
LICENSE="Apache-2.0"
SLOT="0/${PV}"
KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~loong ~ppc64 ~riscv ~s390 ~x86"
IUSE="libevent lua +ssl test"
REQUIRED_USE="test? ( ssl libevent )"
RESTRICT="!test? ( test )"
DEPEND="
dev-libs/boost:=[nls(+)]
dev-libs/openssl:=
sys-libs/zlib:=
libevent? ( dev-libs/libevent:= )
"
RDEPEND="${DEPEND}"
BDEPEND="
app-alternatives/lex
app-alternatives/yacc
"
PATCHES=(
"${FILESDIR}/thrift-0.21.0-gcc15-cstdint.patch"
"${FILESDIR}/thrift-0.21.0-cmake4.patch"
)
src_configure() {
local mycmakeargs=(
# follow order in build/cmake/DefineOptions.cmake
# Prefer WITH_OPTION over BUILD_OPTION for bug #943012
-DBUILD_COMPILER=ON
-DBUILD_TESTING=$(usex test)
-DBUILD_TUTORIALS=OFF
-DBUILD_LIBRARIES=ON
-DWITH_AS3=ON
-DWITH_CPP=ON
-DWITH_ZLIB=ON
-DWITH_LIBEVENT=$(usex libevent)
-DWITH_QT5=OFF
-DWITH_C_GLIB=OFF
-DWITH_OPENSSL=$(usex ssl)
-DWITH_JAVA=OFF
-DWITH_JAVASCRIPT=OFF
-DWITH_NODEJS=OFF
-DWITH_PYTHON=OFF
-Wno-dev
)
cmake_src_configure
}
src_test() {
local CMAKE_SKIP_TESTS=(
# network sandbox
StressTestConcurrent
StressTestNonBlocking
UnitTests
)
cmake_src_test
}