public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/stp] rawhide: Update to 2.4.1 rhbz#2510049
@ 2026-11-07 21:28 Filipe Rosset
  0 siblings, 0 replies; only message in thread
From: Filipe Rosset @ 2026-11-07 21:28 UTC (permalink / raw)
  To: git-commits

A new commit has been pushed.

Repo   : rpms/stp
Branch : rawhide
Commit : e863f342511ece94a890b13debc125061907b932
Author : Filipe Rosset <rosset.filipe@gmail.com>
Date   : 2026-11-07T14:30:54-03:00
Stats  : +126/-81 in 8 file(s)
URL    : https://src.fedoraproject.org/rpms/stp/c/e863f342511ece94a890b13debc125061907b932?branch=rawhide

Log:
Update to 2.4.1 rhbz#2510049

---
diff --git a/sources b/sources
index 1a93f11..156db52 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-SHA512 (stp-2.3.4.tar.gz) = d4355698cd2d96199bd548d996f0c50788c0329b20e79ea0dd4d9e04b48417850041205d7d9efa342f8a362d203d434ec25aa22649f650f658acac2bfadb3ecf
+SHA512 (stp-2.4.1.tar.gz) = 8aed4ad00c626996122897a321b9d6f5d078bfd69f62191224667c74d5575e2ed1d0ce6a965903efb655c66a14af0234192674d7b6e4800a9a5c1df10e7794a5

diff --git a/stp-distutils.patch b/stp-distutils.patch
deleted file mode 100644
index 220ee1f..0000000
--- a/stp-distutils.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-From 23a6af263dd41259d3430aadee15ba41883c27ba Mon Sep 17 00:00:00 2001
-From: Jerry James <loganjerry@gmail.com>
-Date: Tue, 18 Oct 2022 11:58:54 -0600
-Subject: [PATCH] Use sysconfig, not distutils, to find python root
-
----
- bindings/python/stp/CMakeLists.txt | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/bindings/python/stp/CMakeLists.txt b/bindings/python/stp/CMakeLists.txt
-index c62c726c..40d16e6c 100644
---- a/bindings/python/stp/CMakeLists.txt
-+++ b/bindings/python/stp/CMakeLists.txt
-@@ -59,7 +59,7 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/__init__.py.in
- # Try to guess the right place by asking the current python interpreter for its
- # Python library directory
- execute_process(COMMAND ${PYTHON_EXECUTABLE} -c
--                        "from distutils.sysconfig import get_python_lib; print(get_python_lib())"
-+                        "import sys; import sysconfig; print(sysconfig.get_path('purelib', vars={'base': sys.base_prefix}))"
-                  RESULT_VARIABLE RETURN_CODE
-                  OUTPUT_VARIABLE PYTHON_LIB_DIR_DETECTED
-                  OUTPUT_STRIP_TRAILING_WHITESPACE
--- 
-2.37.3
-

diff --git a/stp-minisat-macros.patch b/stp-minisat-macros.patch
index fef16eb..cf269ee 100644
--- a/stp-minisat-macros.patch
+++ b/stp-minisat-macros.patch
@@ -1,20 +1,29 @@
---- stp-2.3.4/include/stp/Sat/CryptoMinisat5.h.orig	2024-06-10 22:53:24.000000000 -0600
-+++ stp-2.3.4/include/stp/Sat/CryptoMinisat5.h	2024-06-14 12:21:55.336965870 -0600
+Fix build failure with Fedora minisat macros.  The code assumes that
+certain minisat names are variables, but in the Fedora package, they are
+macros instead, leading to build failures.
+Rebased against 2.4.1.
+
+diff --git a/include/stp/Sat/CryptoMinisat5.h b/include/stp/Sat/CryptoMinisat5.h
+index fd0d874..c010b4c 100644
+--- a/include/stp/Sat/CryptoMinisat5.h
++++ b/include/stp/Sat/CryptoMinisat5.h
 @@ -31,6 +31,11 @@ THE SOFTWARE.
  #include "stp/Sat/SATSolver.h"
  #include <unordered_set>
  
++
 +#undef var_Undef
 +#undef l_True
 +#undef l_False
 +#undef l_Undef
-+
  namespace CMSat
  {
  class SATSolver;
---- stp-2.3.4/lib/Sat/MinisatCore.cpp.orig	2024-06-10 22:53:24.000000000 -0600
-+++ stp-2.3.4/lib/Sat/MinisatCore.cpp	2024-06-14 12:23:46.487500797 -0600
-@@ -78,7 +78,7 @@ bool MinisatCore::propagateWithAssumptio
+diff --git a/lib/Sat/MinisatCore.cpp b/lib/Sat/MinisatCore.cpp
+index e4029e7..39cf810 100644
+--- a/lib/Sat/MinisatCore.cpp
++++ b/lib/Sat/MinisatCore.cpp
+@@ -79,7 +79,7 @@ bool MinisatCore::propagateWithAssumptions(
    setMaxConflicts(0);
    Minisat::lbool ret = s->solveLimited(assumps);
    assert(s->conflicts ==0);
@@ -22,8 +31,8 @@
 +  return ret != (Minisat::lbool)l_False;
  }
  
- bool MinisatCore::solve(bool& timeout_expired) // Search without assumptions.
-@@ -88,12 +88,12 @@ bool MinisatCore::solve(bool& timeout_ex
+ bool MinisatCore::solveInternal(bool& timeout_expired)
+@@ -89,12 +89,12 @@ bool MinisatCore::solveInternal(bool& timeout_expired)
  
    Minisat::vec<Minisat::Lit> assumps;
    Minisat::lbool ret = s->solveLimited(assumps);
@@ -38,9 +47,11 @@
  }
  
  uint8_t MinisatCore::modelValue(uint32_t x) const
---- stp-2.3.4/lib/Sat/SimplifyingMinisat.cpp.orig	2024-06-10 22:53:24.000000000 -0600
-+++ stp-2.3.4/lib/Sat/SimplifyingMinisat.cpp	2024-06-14 12:24:20.791048657 -0600
-@@ -71,7 +71,7 @@ bool SimplifyingMinisat::solve(
+diff --git a/lib/Sat/SimplifyingMinisat.cpp b/lib/Sat/SimplifyingMinisat.cpp
+index 613041b..fc6872a 100644
+--- a/lib/Sat/SimplifyingMinisat.cpp
++++ b/lib/Sat/SimplifyingMinisat.cpp
+@@ -73,7 +73,7 @@ bool SimplifyingMinisat::solveInternal(bool& timeout_expired)
  
    Minisat::vec<Minisat::Lit> assumps;
    Minisat::lbool ret = s->solveLimited(assumps);

diff --git a/stp-private-libs.patch b/stp-private-libs.patch
deleted file mode 100644
index 9a87ce8..0000000
--- a/stp-private-libs.patch
+++ /dev/null
@@ -1,18 +0,0 @@
---- stp-2.3.3/lib/CMakeLists.txt.orig	2019-03-02 07:26:01.000000000 -0700
-+++ stp-2.3.3/lib/CMakeLists.txt	2021-07-14 09:03:32.415946180 -0600
-@@ -139,9 +139,15 @@ if (USE_RISS)
-         ${stp_link_libs} -lriss-coprocessor)
- endif()
- 
-+if (STATICCOMPILE)
- target_link_libraries(stp
-     LINK_PUBLIC ${stp_link_libs}
- )
-+else()
-+target_link_libraries(stp
-+    LINK_PRIVATE ${stp_link_libs}
-+)
-+endif()
- 
- install(TARGETS stp
-     EXPORT ${STP_EXPORT_NAME}

diff --git a/stp-system-gtest.patch b/stp-system-gtest.patch
new file mode 100644
index 0000000..2f9aa88
--- /dev/null
+++ b/stp-system-gtest.patch
@@ -0,0 +1,40 @@
+Use the system GTest for the test suite.  The upstream build
+requires a vendored copy cloned over the network at build time,
+which is not allowed in the Fedora chroot.
+
+diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
+index 78a55c7..9a59f57 100644
+--- a/tests/CMakeLists.txt
++++ b/tests/CMakeLists.txt
+@@ -55,10 +55,9 @@ set(LIT_ARGS -s CACHE STRING "Arguments to pass to lit")
+ # is what happens here: scripts/deps/setup-gtest.sh clones upstream googletest
+ # at a pinned tag into deps/gtest, and it is built from source as part of this
+ # build. Everyone therefore compiles the same GTest with the same flags as STP.
+-set(GTEST_PREFIX ${PROJECT_SOURCE_DIR}/deps/gtest)
+-if (NOT EXISTS "${GTEST_PREFIX}/CMakeLists.txt")
+-    message(FATAL_ERROR "Could not find GTest. Did you run scripts/deps/setup-gtest.sh?")
+-endif()
++# Fedora: use the system GTest instead of the vendored copy, which would
++# require a network git clone at build time.
++find_package(GTest REQUIRED)
+ 
+ if (MSVC)
+   # STP is built with the shared version of the CRT, gtest defaults to the
+@@ -79,16 +78,8 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-format-nonliteral -Wno-missing-fiel
+ if (WERROR AND NOT MSVC)
+   set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-error")
+ endif()
+-add_subdirectory(${GTEST_PREFIX} gtest)
+ set(CMAKE_CXX_FLAGS "${PREV_CMAKE_CXX_FLAGS}")
+-set(GTEST_BOTH_LIBRARIES gtest gtest_main)
+-
+-# SYSTEM so warnings surfacing inside GTest's headers/macros (e.g. a
+-# -Wsign-compare in an EXPECT_EQ comparison helper) don't trip -Werror in
+-# STP's own test translation units that include them. The gtest target carries
+-# the same directory as a SYSTEM INTERFACE include, so this is belt and braces
+-# for any test target that includes the header without linking the library.
+-include_directories(SYSTEM ${GTEST_PREFIX}/googletest/include)
++set(GTEST_BOTH_LIBRARIES GTest::gtest GTest::gtest_main)
+ 
+ # Add handy macros/functions
+ include(AddSTPGTest)

diff --git a/stp-test-compat.patch b/stp-test-compat.patch
new file mode 100644
index 0000000..079c711
--- /dev/null
+++ b/stp-test-compat.patch
@@ -0,0 +1,37 @@
+Fix the test suite for modern Fedora dependencies.  Python 3.12
+replaced the deprecated ast.Num node with ast.Constant, which the
+AST-to-STP converter did not handle; and lit 23 (LLVM-23) rejects
+the deprecated external shell in favor of the internal one.
+
+diff --git a/bindings/python/stp/stp.py.in b/bindings/python/stp/stp.py.in
+index ffb110f..0eb340e 100644
+--- a/bindings/python/stp/stp.py.in
++++ b/bindings/python/stp/stp.py.in
+@@ -821,6 +821,12 @@ class ASTtoSTP(ast.NodeVisitor):
+     def visit_Num(self, node):
+         return node.n
+ 
++    # Python 3.12 and later removed the deprecated ast.Num node; integer and
++    # other literals are now parsed as ast.Constant.
++    if hasattr(ast, 'Constant'):
++        def visit_Constant(self, node):
++            return node.value
++
+     def visit_BoolOp(self, node):
+         ops = {
+             ast.And: self.s.and_,
+diff --git a/tests/query-files/lit.cfg b/tests/query-files/lit.cfg
+index a64a912..f9ded24 100644
+--- a/tests/query-files/lit.cfg
++++ b/tests/query-files/lit.cfg
+@@ -25,7 +25,9 @@ else:
+     execute_external = (not sys.platform in ['win32'])
+ 
+ # testFormat: The test format to use to interpret tests.
+-config.test_format = lit.formats.ShTest(execute_external)
++# lit 23 (LLVM-23) deprecates the external shell and raises on
++# execute_external=True; use the internal shell instead.
++config.test_format = lit.formats.ShTest(execute_external=False)
+ 
+ # suffixes: A list of file extensions to treat as test files. This is overriden
+ # by individual lit.local.cfg files in the test subdirectories.

diff --git a/stp-threads-cmake.patch b/stp-threads-cmake.patch
deleted file mode 100644
index 568d0ff..0000000
--- a/stp-threads-cmake.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff --git a/CMakeLists.txt b/CMakeLists.txt
-index 617596c9..279257ee 100644
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -479,6 +479,7 @@ option(NOCRYPTOMINISAT "Don't try to use cryptominisat" OFF)
- if (NOT NOCRYPTOMINISAT)
-   set(cryptominisat5_DIR "" CACHE PATH "Path to directory containing cryptominisat5Config.cmake")
-   find_package(GMP REQUIRED)
-+  find_packagE(Threads REQUIRED)
-   message(STATUS "GMP includes: ${GMP_INCLUDE_DIRS}")
-   message(STATUS "GMP libraries: ${GMP_LIBRARIES}")
-   include_directories(SYSTEM ${GMP_INCLUDE_DIRS})

diff --git a/stp.spec b/stp.spec
index d834fdc..ca91cb0 100644
--- a/stp.spec
+++ b/stp.spec
@@ -1,8 +1,10 @@
 %global giturl  https://github.com/stp/stp
 %global _cmake_generator "Unix Makefiles"
 
+%bcond_with tests
+
 Name:		stp
-Version:	2.3.4
+Version:	2.4.1
 Release:	%autorelease
 Summary:	Constraint solver/decision procedure
 
@@ -17,14 +19,14 @@ Source0:	%{giturl}/archive/%{version}/%{name}-%{version}.tar.gz
 # The code assumes that certain minisat names are variables, but in the Fedora
 # package, they are macros instead, leading to build failures
 Patch0:		%{name}-minisat-macros.patch
-# Do not declare cryptominisat and minisat as public libs
-# See https://bugzilla.redhat.com/show_bug.cgi?id=1981466
-Patch1:		%{name}-private-libs.patch
-# Distutils has been deprecated.  Use sysconfig instead.
-# https://github.com/stp/stp/pull/450
-Patch2:		%{name}-distutils.patch
-# The Threads::Threads is required in cryptominisat cmake but never imported.
-Patch3:     %{name}-threads-cmake.patch
+# Use the system GTest for the test suite.  The upstream build requires a
+# vendored copy cloned over the network at build time, which is not allowed
+# in the Fedora chroot.
+%{?with_tests:Patch1:		%{name}-system-gtest.patch}
+# Fix the test suite for modern Fedora dependencies: Python 3.12 replaced the
+# deprecated ast.Num node with ast.Constant, and lit 23 (LLVM-23) rejects the
+# deprecated external shell in favor of the internal one.
+%{?with_tests:Patch2:		%{name}-test-compat.patch}
 
 # See https://fedoraproject.org/wiki/Changes/EncourageI686LeafRemoval
 ExcludeArch:	%{ix86}
@@ -36,13 +38,16 @@ BuildRequires:	cmake(cryptominisat5)
 BuildRequires:	cryptominisat
 BuildRequires:	flex
 BuildRequires:	gcc-c++
+BuildRequires:	git
 BuildRequires:	help2man
 BuildRequires:	make
 BuildRequires:	minisat2-devel
+%{?with_tests:BuildRequires:	gtest-devel}
 BuildRequires:	perl(Getopt::Long)
 BuildRequires:	pkgconfig(gmp)
 BuildRequires:	pkgconfig(sqlite3)
 BuildRequires:	python3-devel
+%{?with_tests:BuildRequires:	python3-lit}
 
 %description
 STP (Simple Theorem Prover) is a constraint solver (also referred to as
@@ -86,9 +91,6 @@ Python 3 interface to STP.
 # We do not want to know about the order of member initializers
 sed -i "s/-Wno-deprecated/-Wno-reorder/" CMakeLists.txt
 
-# Fix the version number
-sed -i 's/2\.3\.3/%{version}/' CMakeLists.txt
-
 # Prevent useless rpaths
 sed -e '/CMAKE_SKIP_BUILD_RPATH/s/FALSE/TRUE/' \
     -e '/SET(CMAKE_INSTALL_RPATH .*)/d' \
@@ -99,9 +101,11 @@ sed -e '/CMAKE_SKIP_BUILD_RPATH/s/FALSE/TRUE/' \
 %build
 export CFLAGS='%{build_cflags} -I %{_includedir}/minisat'
 export CXXFLAGS='%{build_cxxflags} -I %{_includedir}/minisat'
-%cmake -DPYTHON_EXECUTABLE:FILEPATH=%{_bindir}/python%{python3_version} \
+%cmake -DSTP_ALLOCATOR=system \
+       -DPYTHON_EXECUTABLE:FILEPATH=%{_bindir}/python%{python3_version} \
        -DPYTHON_LIBRARY:FILEPATH=%{_libdir}/libpython%{python3_version}.so \
-       -DPYTHON_INCLUDE_DIR:FILEPATH=%{_includedir}/python%{python3_version}
+       -DPYTHON_INCLUDE_DIR:FILEPATH=%{_includedir}/python%{python3_version} \
+       -DENABLE_TESTING=%{?with_tests:ON}%{!?with_tests:OFF}
 
 # Fix the help2man invocation
 sed -i "s,help2man,LD_LIBRARY_PATH=$PWD/%{_vpath_builddir}/lib &," \
@@ -109,6 +113,14 @@ sed -i "s,help2man,LD_LIBRARY_PATH=$PWD/%{_vpath_builddir}/lib &," \
 
 %cmake_build
 
+%check
+%if 0%{?without_tests}
+%else
+# The build rpath is stripped in %%prep, so point at the built lib
+export LD_LIBRARY_PATH=$PWD/%{_vpath_builddir}/lib:$LD_LIBRARY_PATH
+%ctest
+%endif
+
 %install
 %cmake_install
 

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-11-07 21:28 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-07 21:28 [rpms/stp] rawhide: Update to 2.4.1 rhbz#2510049 Filipe Rosset

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox