summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authorHarmen Stoppels <me@harmenstoppels.nl>2024-10-15 12:31:29 +0200
committerGitHub <noreply@github.com>2024-10-15 12:31:29 +0200
commite0efd2bea295b67117b64e0e63c7beb87a3cf9f8 (patch)
tree9064c431360daa76d6d503e8e25852e99731fbfb /var
parentb9873c5cea18b3c1573b57372ed7575ca3fef151 (diff)
downloadspack-e0efd2bea295b67117b64e0e63c7beb87a3cf9f8.tar.gz
spack-e0efd2bea295b67117b64e0e63c7beb87a3cf9f8.tar.bz2
spack-e0efd2bea295b67117b64e0e63c7beb87a3cf9f8.tar.xz
spack-e0efd2bea295b67117b64e0e63c7beb87a3cf9f8.zip
support python 3.13 bootstrapping from sources (#46983)
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/clingo/PyEval_InitThreads.patch12
-rw-r--r--var/spack/repos/builtin/packages/clingo/package.py12
2 files changed, 10 insertions, 14 deletions
diff --git a/var/spack/repos/builtin/packages/clingo/PyEval_InitThreads.patch b/var/spack/repos/builtin/packages/clingo/PyEval_InitThreads.patch
deleted file mode 100644
index 61e59d1984..0000000000
--- a/var/spack/repos/builtin/packages/clingo/PyEval_InitThreads.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff --git a/libpyclingo/pyclingo.cc b/libpyclingo/pyclingo.cc
-index ec4a33c6..ee903cd0 100644
---- a/libpyclingo/pyclingo.cc
-+++ b/libpyclingo/pyclingo.cc
-@@ -10463,7 +10463,6 @@ void addEmptyClass(Reference module, char const *name) {
-
- PyObject *initclingo_() {
- PY_TRY {
-- if (!PyEval_ThreadsInitialized()) { PyEval_InitThreads(); }
- #if PY_MAJOR_VERSION >= 3
- Object m = PyModule_Create(&clingoModule);
- #else
diff --git a/var/spack/repos/builtin/packages/clingo/package.py b/var/spack/repos/builtin/packages/clingo/package.py
index cd73ed647d..73ff2b1769 100644
--- a/var/spack/repos/builtin/packages/clingo/package.py
+++ b/var/spack/repos/builtin/packages/clingo/package.py
@@ -74,12 +74,20 @@ class Clingo(CMakePackage):
patch("size-t.patch", when="%msvc")
patch("vs2022.patch", when="%msvc@19.30:")
patch("clingo_msc_1938_native_handle.patch", when="@:5.7.0 %msvc@19.38:")
- patch("PyEval_InitThreads.patch", when="@spack,5.3:5.4 ^python@3.9:")
def patch(self):
+ # In bootstrap/prototypes/*.json we don't want to have specs that work for any python
+ # version, so this conditional patch lives here instead of being its own directive.
+ if self.spec.satisfies("@spack,5.3:5.4 ^python@3.9:"):
+ filter_file(
+ "if (!PyEval_ThreadsInitialized()) { PyEval_InitThreads(); }",
+ "",
+ "libpyclingo/pyclingo.cc",
+ string=True,
+ )
# Doxygen is optional but can't be disabled with a -D, so patch
# it out if it's really supposed to be disabled
- if "+docs" not in self.spec:
+ if self.spec.satisfies("~docs"):
filter_file(
r"find_package\(Doxygen\)",
'message("Doxygen disabled for Spack build.")',