dev-cpp/range-v3: fix compat with cmake4

Closes: https://bugs.gentoo.org/957283
Signed-off-by: Alexey Sokolov <alexey+gentoo@asokolov.org>
Part-of: https://github.com/gentoo/gentoo/pull/43303
Signed-off-by: Sam James <sam@gentoo.org>
This commit is contained in:
Alexey Sokolov
2025-08-03 16:19:08 +01:00
committed by Sam James
parent dbcf9d4788
commit c1be5310e3
2 changed files with 113 additions and 0 deletions

View File

@@ -0,0 +1,66 @@
https://bugs.gentoo.org/957283
https://github.com/ericniebler/range-v3/pull/1851
From 78980bf7f978ca2a698c5c84f13311efe91f6690 Mon Sep 17 00:00:00 2001
From: wermos <63574588+wermos@users.noreply.github.com>
Date: Sat, 31 May 2025 19:53:51 +0530
Subject: [PATCH] Bump CMake minimum version.
---
CMakeLists.txt | 2 +-
cmake/GoogleBenchmark.cmake.in | 2 +-
cmake/GoogleTest.cmake.in | 2 +-
test_package/CMakeLists.txt | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4670179121..4e528a23db 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -5,7 +5,7 @@
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
-cmake_minimum_required(VERSION 3.6)
+cmake_minimum_required(VERSION 3.15)
get_directory_property(is_subproject PARENT_DIRECTORY)
if(NOT is_subproject)
diff --git a/cmake/GoogleBenchmark.cmake.in b/cmake/GoogleBenchmark.cmake.in
index 3fcf1b5c90..b5bf1439b6 100644
--- a/cmake/GoogleBenchmark.cmake.in
+++ b/cmake/GoogleBenchmark.cmake.in
@@ -2,7 +2,7 @@
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
-cmake_minimum_required(VERSION 2.8.2)
+cmake_minimum_required(VERSION 3.15)
project(google-benchmark-download NONE)
diff --git a/cmake/GoogleTest.cmake.in b/cmake/GoogleTest.cmake.in
index 0d33f9d8b5..1afe647be3 100644
--- a/cmake/GoogleTest.cmake.in
+++ b/cmake/GoogleTest.cmake.in
@@ -2,7 +2,7 @@
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
-cmake_minimum_required(VERSION 2.8.2)
+cmake_minimum_required(VERSION 3.15)
project(google-test-download NONE)
diff --git a/test_package/CMakeLists.txt b/test_package/CMakeLists.txt
index 2984a513d9..5b758fc0f4 100644
--- a/test_package/CMakeLists.txt
+++ b/test_package/CMakeLists.txt
@@ -11,7 +11,7 @@
#
PROJECT(PackageTest)
-cmake_minimum_required(VERSION 3.1.0 FATAL_ERROR)
+cmake_minimum_required(VERSION 3.15 FATAL_ERROR)
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
conan_basic_setup()

View File

@@ -0,0 +1,47 @@
# Copyright 2020-2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
inherit cmake
DESCRIPTION="Range library for C++14/17/20, basis for C++20's std::ranges"
HOMEPAGE="https://github.com/ericniebler/range-v3"
SRC_URI="https://github.com/ericniebler/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
LICENSE="Boost-1.0"
SLOT="0"
KEYWORDS="~amd64 ~arm64 ~loong ~ppc64 ~riscv ~x86"
IUSE="test"
RESTRICT="!test? ( test )"
PATCHES=(
"${FILESDIR}/0.12.0-fix-any-1.patch"
"${FILESDIR}/0.12.0-fix-any-2.patch"
"${FILESDIR}/0.12.0-cmake.patch"
)
src_prepare() {
# header-only libraries go to arch-independent dirs
sed -i -e 's@CMAKE_INSTALL_LIBDIR@CMAKE_INSTALL_DATADIR@g' CMakeLists.txt || die
rm include/module.modulemap || die # https://bugs.gentoo.org/755740
cmake_src_prepare
}
src_configure() {
local mycmakeargs=(
-DRANGES_BUILD_CALENDAR_EXAMPLE=OFF
-DRANGES_NATIVE=OFF
-DRANGES_DEBUG_INFO=OFF
-DRANGES_NATIVE=OFF
-DRANGES_ENABLE_WERROR=OFF
-DRANGES_VERBOSE_BUILD=ON
-DRANGE_V3_EXAMPLES=OFF
-DRANGE_V3_PERF=OFF
-DRANGE_V3_DOCS=OFF
-DRANGE_V3_HEADER_CHECKS="$(usex test ON OFF)"
-DRANGE_V3_TESTS=$(usex test ON OFF)
#TODO: clang support + -DRANGES_MODULES=yes
)
cmake_src_configure
}