diff options
author | Michał Górny <mgorny@gentoo.org> | 2024-03-21 16:08:31 +0100 |
---|---|---|
committer | Michał Górny <mgorny@gentoo.org> | 2024-03-21 16:12:34 +0100 |
commit | 78d6e5ecf75c437da0aa47231e1302b5c514a8f4 (patch) | |
tree | b7cc57b1ee856843c0b3ccd024406d776aa9c4b2 | |
parent | dev-python/python-dbusmock: Add upower test dep (diff) | |
download | gentoo-78d6e5ecf75c437da0aa47231e1302b5c514a8f4.tar.gz gentoo-78d6e5ecf75c437da0aa47231e1302b5c514a8f4.tar.bz2 gentoo-78d6e5ecf75c437da0aa47231e1302b5c514a8f4.zip |
dev-python/pyopengl_accelerate: Add a flag to control numpy ext
Closes: https://bugs.gentoo.org/927302
Signed-off-by: Michał Górny <mgorny@gentoo.org>
-rw-r--r-- | dev-python/pyopengl_accelerate/metadata.xml | 3 | ||||
-rw-r--r-- | dev-python/pyopengl_accelerate/pyopengl_accelerate-3.1.7.ebuild | 23 |
2 files changed, 22 insertions, 4 deletions
diff --git a/dev-python/pyopengl_accelerate/metadata.xml b/dev-python/pyopengl_accelerate/metadata.xml index eb43714c001e..daac0a05e972 100644 --- a/dev-python/pyopengl_accelerate/metadata.xml +++ b/dev-python/pyopengl_accelerate/metadata.xml @@ -10,4 +10,7 @@ <remote-id type="sourceforge">pyopengl</remote-id> <remote-id type="github">mcfletch/pyopengl</remote-id> </upstream> + <use> + <flag name="numpy">Building NumPy native format handlers.</flag> + </use> </pkgmetadata> diff --git a/dev-python/pyopengl_accelerate/pyopengl_accelerate-3.1.7.ebuild b/dev-python/pyopengl_accelerate/pyopengl_accelerate-3.1.7.ebuild index 177f6781c3a1..6dcc9b5597e5 100644 --- a/dev-python/pyopengl_accelerate/pyopengl_accelerate-3.1.7.ebuild +++ b/dev-python/pyopengl_accelerate/pyopengl_accelerate-3.1.7.ebuild @@ -1,4 +1,4 @@ -# Copyright 1999-2023 Gentoo Authors +# Copyright 1999-2024 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=8 @@ -24,21 +24,36 @@ S=${WORKDIR}/${MY_P}/accelerate LICENSE="BSD" SLOT="0" KEYWORDS="amd64 x86 ~amd64-linux ~x86-linux" +IUSE="numpy" +DEPEND=" + numpy? ( + dev-python/numpy[${PYTHON_USEDEP}] + ) +" RDEPEND=" + ${DEPEND} dev-python/pyopengl[${PYTHON_USEDEP}] " BDEPEND=" dev-python/cython[${PYTHON_USEDEP}] - test? ( - dev-python/numpy[${PYTHON_USEDEP}] - ) " distutils_enable_tests pytest src_configure() { rm src/*.c || die + + if ! use numpy; then + cat > "${T}"/numpy.py <<-EOF || die + raise ImportError("building numpy extension disabled") + EOF + fi +} + +python_compile() { + local -x PYTHONPATH=${T}:${PYTHONPATH} + distutils-r1_python_compile } python_test() { |