sci-mathematics/cvc4: Update CMake-4 fix, drop Gentoo build type

- Just use upstream's "Production" instead, but still drop their config
- Replace various parts of cvc4-1.8-gentoo.patch with upstreamed ones
- Fix CMake 3.31 warnings about unsupported <CMake-3.10 already
- Cleanup superfluous src_install() phase

Closes: https://bugs.gentoo.org/953543
Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
Part-of: https://github.com/gentoo/gentoo/pull/44558
Closes: https://github.com/gentoo/gentoo/pull/44558
Signed-off-by: Alfredo Tupone <tupone@gentoo.org>
This commit is contained in:
Andreas Sturmlechner 2025-11-09 21:50:28 +01:00 committed by Alfredo Tupone
parent 385372b025
commit 4a58d8049c
No known key found for this signature in database
GPG Key ID: FBE5925C5B02CE58
5 changed files with 265 additions and 38 deletions

View File

@ -3,6 +3,7 @@
EAPI=8
CMAKE_BUILD_TYPE=Production
CMAKE_MAKEFILE_GENERATOR=emake
PYTHON_COMPAT=( python3_{11..13} )
inherit cmake python-any-r1
@ -29,6 +30,9 @@ DEPEND="${PYTHON_DEPS}
PATCHES=(
"${FILESDIR}"/${P}-gentoo.patch
"${FILESDIR}"/${P}-gnuinstalldirs.patch # cvc5 git master
"${FILESDIR}"/${P}-destdir.patch # cvc5 git master
"${FILESDIR}"/${P}-cmake4.patch # bug 953543
"${FILESDIR}"/${P}-toml.patch
"${FILESDIR}"/${P}-bash-5.2-fix.patch
"${FILESDIR}"/${P}-size_t.patch
@ -50,7 +54,6 @@ src_configure() {
-DENABLE_STATISTICS="$(usex statistics ON OFF)"
-DENABLE_PROOFS="$(usex proofs ON OFF)"
)
CMAKE_BUILD_TYPE="Gentoo"
cmake_src_configure
# Bug #934053 - build with musl
antlr3 "${S}"/src/parser/cvc/Cvc.g -fo "${BUILD_DIR}"/src/parser/cvc || die
@ -70,8 +73,3 @@ src_test() {
systemtests
cmake_src_test
}
src_install() {
cmake_src_install
mv "${D}"/usr/{lib,$(get_libdir)}
}

View File

@ -0,0 +1,24 @@
Source: https://salsa.debian.org/science-team/cvc4/-/blob/master/debian/patches/05-fix-headers.patch
Bumped from 3.5 to 3.10 though.
Description: Fix FTBFS with CMake 4
Author: Adrian Bunk <bunk@debian.org>
Bug-Debian: https://bugs.debian.org/1112823
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.2)
+cmake_minimum_required(VERSION 3.10)
#-----------------------------------------------------------------------------#
# Project configuration
--- a/examples/CMakeLists.txt
+++ b/examples/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.2)
+cmake_minimum_required(VERSION 3.10)
project(cvc4-examples)

View File

@ -0,0 +1,26 @@
Source: https://github.com/cvc5/cvc5/pull/4978
From f1e97b1db6bc38a54d80c60e9dc968a3415fc624 Mon Sep 17 00:00:00 2001
From: Fabian Wolff <fabi.wolff@arcor.de>
Date: Mon, 31 Aug 2020 15:55:42 +0200
Subject: [PATCH] 'fix-install-headers.sh' should respect DESTDIR environment
variable
Signed-off-by: Fabian Wolff <fabi.wolff@arcor.de>
---
src/fix-install-headers.sh | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/fix-install-headers.sh b/src/fix-install-headers.sh
index 39d8bc663a6..7f9fa5d5bc2 100755
--- a/src/fix-install-headers.sh
+++ b/src/fix-install-headers.sh
@@ -2,6 +2,7 @@
set -e -o pipefail
-dir=$1
+dir="$DESTDIR$1"
+
find "$dir/include/cvc4/" -type f \
-exec sed -i'' -e 's/include.*"\(.*\)"/include <cvc4\/\1>/' {} +

View File

@ -1,29 +1,5 @@
--- a/CMakeLists.txt 2019-07-09 14:47:12.552425226 +0200
+++ b/CMakeLists.txt 2019-07-09 14:50:02.595001358 +0200
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.2)
+cmake_minimum_required(VERSION 3.5)
#-----------------------------------------------------------------------------#
# Project configuration
@@ -83,7 +83,7 @@
#-----------------------------------------------------------------------------#
set(INCLUDE_INSTALL_DIR include)
-set(LIBRARY_INSTALL_DIR lib)
+set(LIBRARY_INSTALL_DIR ${CMAKE_INSTALL_LIBDIR})
set(RUNTIME_INSTALL_DIR bin)
#-----------------------------------------------------------------------------#
@@ -143,7 +143,7 @@
# Note: Module CodeCoverage requires the name of the debug build to conform
# to cmake standards (first letter uppercase).
-set(BUILD_TYPES Production Debug Testing Competition)
+set(BUILD_TYPES Production Debug Testing Competition Gentoo)
if(ENABLE_ASAN)
#_cmake_modify_IGNORE set(CMAKE_BUILD_TYPE Debug)
@@ -166,12 +166,10 @@
endif()
@ -47,11 +23,3 @@
regress4/hole10.cvc
regress4/instance_1151.smtv1.smt2
)
--- a/src/CMakeLists.txt 2019-07-18 08:56:47.923025745 +0200
+++ b/src/CMakeLists.txt 2019-07-18 08:58:10.584750385 +0200
@@ -915,4 +915,4 @@
# Note: This is a temporary fix until the new C++ API is in place.
install(CODE "execute_process(COMMAND
${CMAKE_CURRENT_LIST_DIR}/fix-install-headers.sh
- ${CMAKE_INSTALL_PREFIX})")
+ \$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX})")

View File

@ -0,0 +1,211 @@
Source: https://github.com/cvc5/cvc5/pull/4979
From 4744019a72b14ed79602e3d03ce2c5d6412b3163 Mon Sep 17 00:00:00 2001
From: Fabian Wolff <fabi.wolff@arcor.de>
Date: Mon, 31 Aug 2020 16:38:20 +0200
Subject: [PATCH] Drop {INCLUDE,LIBRARY,RUNTIME}_INSTALL_DIR variables in
CMakeLists.txt
Signed-off-by: Fabian Wolff <fabi.wolff@arcor.de>
---
CMakeLists.txt | 18 +++++++-----------
src/CMakeLists.txt | 28 ++++++++++++++--------------
src/main/CMakeLists.txt | 4 ++--
src/parser/CMakeLists.txt | 2 +-
4 files changed, 24 insertions(+), 28 deletions(-)
index 5b1d1e29210..12ccf433acd 100644
diff --git a/CMakeLists.txt b/CMakeLists.txt
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -5,6 +5,8 @@ cmake_minimum_required(VERSION 3.4)
project(cvc4)
+include(GNUInstallDirs)
+
set(CVC4_MAJOR 1) # Major component of the version of CVC4.
set(CVC4_MINOR 9) # Minor component of the version of CVC4.
set(CVC4_RELEASE 0) # Release component of the version of CVC4.
@@ -85,12 +87,6 @@ list(APPEND CMAKE_PREFIX_PATH "${PROJECT_SOURCE_DIR}/deps/install")
#-----------------------------------------------------------------------------#
-set(INCLUDE_INSTALL_DIR include)
-set(LIBRARY_INSTALL_DIR lib)
-set(RUNTIME_INSTALL_DIR bin)
-
-#-----------------------------------------------------------------------------#
-
include(Helpers)
#-----------------------------------------------------------------------------#
@@ -315,7 +311,7 @@ if(ENABLE_SHARED)
#
# More information on RPATH in CMake:
# https://gitlab.kitware.com/cmake/community/wikis/doc/cmake/RPATH-handling
- set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${LIBRARY_INSTALL_DIR}")
+ set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}")
else()
# When building statically, we *only* want static archives/libraries
if (WIN32)
@@ -635,13 +631,13 @@ endif()
install(EXPORT cvc4-targets
FILE CVC4Targets.cmake
NAMESPACE CVC4::
- DESTINATION ${LIBRARY_INSTALL_DIR}/cmake/CVC4)
+ DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/CVC4)
configure_package_config_file(
${CMAKE_SOURCE_DIR}/cmake/CVC4Config.cmake.in
${CMAKE_BINARY_DIR}/cmake/CVC4Config.cmake
- INSTALL_DESTINATION ${LIBRARY_INSTALL_DIR}/cmake/CVC4
- PATH_VARS LIBRARY_INSTALL_DIR
+ INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/CVC4
+ PATH_VARS CMAKE_INSTALL_LIBDIR
)
write_basic_package_version_file(
@@ -653,7 +649,7 @@ write_basic_package_version_file(
install(FILES
${CMAKE_BINARY_DIR}/cmake/CVC4Config.cmake
${CMAKE_BINARY_DIR}/CVC4ConfigVersion.cmake
- DESTINATION ${LIBRARY_INSTALL_DIR}/cmake/CVC4
+ DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/CVC4
)
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -922,8 +922,8 @@ target_include_directories(cvc4
install(TARGETS cvc4
EXPORT cvc4-targets
- LIBRARY DESTINATION ${LIBRARY_INSTALL_DIR}
- ARCHIVE DESTINATION ${LIBRARY_INSTALL_DIR})
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
set_target_properties(cvc4 PROPERTIES SOVERSION ${CVC4_SOVERSION})
target_compile_definitions(cvc4
@@ -1013,27 +1013,27 @@ install(FILES
api/cvc4cpp.h
api/cvc4cppkind.h
DESTINATION
- ${INCLUDE_INSTALL_DIR}/cvc4/api)
+ ${CMAKE_INSTALL_INCLUDEDIR}/cvc4/api)
install(FILES
base/configuration.h
base/exception.h
base/listener.h
base/modal_exception.h
DESTINATION
- ${INCLUDE_INSTALL_DIR}/cvc4/base)
+ ${CMAKE_INSTALL_INCLUDEDIR}/cvc4/base)
install(FILES
context/cdhashmap_forward.h
context/cdhashset_forward.h
context/cdinsert_hashmap_forward.h
context/cdlist_forward.h
DESTINATION
- ${INCLUDE_INSTALL_DIR}/cvc4/context)
+ ${CMAKE_INSTALL_INCLUDEDIR}/cvc4/context)
install(FILES
include/cvc4.h
include/cvc4_public.h
include/cvc4parser_public.h
DESTINATION
- ${INCLUDE_INSTALL_DIR}/cvc4)
+ ${CMAKE_INSTALL_INCLUDEDIR}/cvc4)
install(FILES
expr/array.h
expr/array_store_all.h
@@ -1050,7 +1050,7 @@ install(FILES
${CMAKE_CURRENT_BINARY_DIR}/expr/kind.h
${CMAKE_CURRENT_BINARY_DIR}/expr/expr_manager.h
DESTINATION
- ${INCLUDE_INSTALL_DIR}/cvc4/expr)
+ ${CMAKE_INSTALL_INCLUDEDIR}/cvc4/expr)
install(FILES
options/language.h
options/option_exception.h
@@ -1058,7 +1058,7 @@ install(FILES
options/printer_modes.h
options/set_language.h
DESTINATION
- ${INCLUDE_INSTALL_DIR}/cvc4/options)
+ ${CMAKE_INSTALL_INCLUDEDIR}/cvc4/options)
install(FILES
parser/input.h
parser/parser.h
@@ -1066,26 +1066,26 @@ install(FILES
parser/parser_exception.h
parser/parse_op.h
DESTINATION
- ${INCLUDE_INSTALL_DIR}/cvc4/parser)
+ ${CMAKE_INSTALL_INCLUDEDIR}/cvc4/parser)
install(FILES
printer/sygus_print_callback.h
DESTINATION
- ${INCLUDE_INSTALL_DIR}/cvc4/printer)
+ ${CMAKE_INSTALL_INCLUDEDIR}/cvc4/printer)
install(FILES
proof/unsat_core.h
DESTINATION
- ${INCLUDE_INSTALL_DIR}/cvc4/proof)
+ ${CMAKE_INSTALL_INCLUDEDIR}/cvc4/proof)
install(FILES
smt/command.h
smt/logic_exception.h
smt/smt_engine.h
DESTINATION
- ${INCLUDE_INSTALL_DIR}/cvc4/smt)
+ ${CMAKE_INSTALL_INCLUDEDIR}/cvc4/smt)
install(FILES
theory/logic_info.h
theory/theory_id.h
DESTINATION
- ${INCLUDE_INSTALL_DIR}/cvc4/theory)
+ ${CMAKE_INSTALL_INCLUDEDIR}/cvc4/theory)
install(FILES
util/abstract_value.h
util/bitvector.h
@@ -1115,7 +1115,7 @@ install(FILES
${CMAKE_CURRENT_BINARY_DIR}/util/rational.h
${CMAKE_CURRENT_BINARY_DIR}/util/real_algebraic_number.h
DESTINATION
- ${INCLUDE_INSTALL_DIR}/cvc4/util)
+ ${CMAKE_INSTALL_INCLUDEDIR}/cvc4/util)
# Fix include paths for all public headers.
# Note: This is a temporary fix until the new C++ API is in place.
diff --git a/src/main/CMakeLists.txt b/src/main/CMakeLists.txt
--- a/src/main/CMakeLists.txt
+++ b/src/main/CMakeLists.txt
@@ -51,11 +51,11 @@ target_link_libraries(cvc4-bin cvc4 cvc4parser)
if(PROGRAM_PREFIX)
install(PROGRAMS
$<TARGET_FILE:cvc4-bin>
- DESTINATION ${RUNTIME_INSTALL_DIR}
+ DESTINATION ${CMAKE_INSTALL_BINDIR}
RENAME ${PROGRAM_PREFIX}cvc4)
else()
install(TARGETS cvc4-bin
- DESTINATION ${RUNTIME_INSTALL_DIR})
+ DESTINATION ${CMAKE_INSTALL_BINDIR})
endif()
# In order to get a fully static executable we have to make sure that we also
diff --git a/src/parser/CMakeLists.txt b/src/parser/CMakeLists.txt
--- a/src/parser/CMakeLists.txt
+++ b/src/parser/CMakeLists.txt
@@ -99,7 +99,7 @@ target_link_libraries(cvc4parser cvc4 ${ANTLR_LIBRARIES})
target_include_directories(cvc4parser PRIVATE ${ANTLR_INCLUDE_DIR})
install(TARGETS cvc4parser
EXPORT cvc4-targets
- DESTINATION ${LIBRARY_INSTALL_DIR})
+ DESTINATION ${CMAKE_INSTALL_LIBDIR})
# The generated lexer/parser files define some functions as
# __declspec(dllexport) via the ANTLR3_API macro, which leads to lots of