diff options
author | 2024-06-13 01:30:48 +0200 | |
---|---|---|
committer | 2024-06-13 01:40:24 +0200 | |
commit | 958deb821b366d4ad159fff9ee601d2128d3dec7 (patch) | |
tree | 51ce583549e4bb25bd6aba5fb20d573b987ae3e4 /sci-mathematics | |
parent | sci-mathematics/cryptominisat: patch unistd include (diff) | |
download | gentoo-958deb821b366d4ad159fff9ee601d2128d3dec7.tar.gz gentoo-958deb821b366d4ad159fff9ee601d2128d3dec7.tar.bz2 gentoo-958deb821b366d4ad159fff9ee601d2128d3dec7.zip |
sci-mathematics/cryptominisat: enable python support
Signed-off-by: Maciej Barć <xgqt@gentoo.org>
Diffstat (limited to 'sci-mathematics')
-rw-r--r-- | sci-mathematics/cryptominisat/cryptominisat-5.11.21-r1.ebuild (renamed from sci-mathematics/cryptominisat/cryptominisat-5.11.21.ebuild) | 52 | ||||
-rw-r--r-- | sci-mathematics/cryptominisat/files/cryptominisat-5.11.21-setup-py.patch | 18 |
2 files changed, 69 insertions, 1 deletions
diff --git a/sci-mathematics/cryptominisat/cryptominisat-5.11.21.ebuild b/sci-mathematics/cryptominisat/cryptominisat-5.11.21-r1.ebuild index 7de12b4067d1..db2ca950f559 100644 --- a/sci-mathematics/cryptominisat/cryptominisat-5.11.21.ebuild +++ b/sci-mathematics/cryptominisat/cryptominisat-5.11.21-r1.ebuild @@ -3,7 +3,15 @@ EAPI=8 -inherit cmake +CMAKE_IN_SOURCE_BUILD="ON" + +PYTHON_COMPAT=( python3_{11..13} ) + +DISTUTILS_EXT="1" +DISTUTILS_OPTIONAL="1" +DISTUTILS_USE_PEP517="setuptools" + +inherit cmake distutils-r1 DESCRIPTION="Advanced SAT solver with C++ and command-line interfaces" HOMEPAGE="https://github.com/msoos/cryptominisat/" @@ -21,24 +29,66 @@ fi LICENSE="GPL-2 MIT" SLOT="0/${PV}" +IUSE="python" RESTRICT="test" # Tests require some git modules. +REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )" RDEPEND=" dev-libs/boost:= sys-libs/zlib:= + python? ( + ${PYTHON_DEPS} + $(python_gen_cond_dep ' + dev-python/tomli[${PYTHON_USEDEP}] + ') + ) " DEPEND=" ${RDEPEND} " +BDEPEND=" + python? ( + ${DISTUTILS_DEPS} + ) +" PATCHES=( + "${FILESDIR}/${PN}-5.11.21-setup-py.patch" "${FILESDIR}/${PN}-5.11.21-unistd.patch" ) +src_prepare() { + cmake_src_prepare + + if use python ; then + distutils-r1_src_prepare + fi +} + src_configure() { local -a mycmakeargs=( -DNOBREAKID=ON -DENABLE_TESTING=OFF ) cmake_src_configure + + if use python ; then + python_setup + fi +} + +src_compile() { + cmake_src_compile + + if use python ; then + distutils-r1_src_compile + fi +} + +src_install() { + cmake_src_install + + if use python ; then + distutils-r1_src_install + fi } diff --git a/sci-mathematics/cryptominisat/files/cryptominisat-5.11.21-setup-py.patch b/sci-mathematics/cryptominisat/files/cryptominisat-5.11.21-setup-py.patch new file mode 100644 index 000000000000..6b13b3e05b26 --- /dev/null +++ b/sci-mathematics/cryptominisat/files/cryptominisat-5.11.21-setup-py.patch @@ -0,0 +1,18 @@ +--- a/setup.py ++++ b/setup.py +@@ -27,13 +27,13 @@ import sys + import os + from setuptools import Extension, setup + import sysconfig +-import toml ++import tomli + import pathlib + from sys import platform + + def _parse_toml(pyproject_path): + pyproject_text = pyproject_path.read_text() +- pyproject_data = toml.loads(pyproject_text) ++ pyproject_data = tomli.loads(pyproject_text) + return pyproject_data['project']['version'] + + picosatlib = ('picosatlib', { |