Gentoo Archives: gentoo-commits

From: Andrew Ammerlaan <andrewammerlaan@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/sci:master commit in: dev-python/numba/
Date: Wed, 15 Sep 2021 18:39:39
Message-Id: 1631731129.74cb9c3f95a52e96d5c0e204c38d2bd27f4b5d51.andrewammerlaan@gentoo
1 commit: 74cb9c3f95a52e96d5c0e204c38d2bd27f4b5d51
2 Author: Andrew Ammerlaan <andrewammerlaan <AT> gentoo <DOT> org>
3 AuthorDate: Wed Sep 15 18:38:49 2021 +0000
4 Commit: Andrew Ammerlaan <andrewammerlaan <AT> gentoo <DOT> org>
5 CommitDate: Wed Sep 15 18:38:49 2021 +0000
6 URL: https://gitweb.gentoo.org/proj/sci.git/commit/?id=74cb9c3f
7
8 dev-python/numba: add version 0.54.0
9
10 Package-Manager: Portage-3.0.23, Repoman-3.0.3
11 RepoMan-Options: --force
12 Signed-off-by: Andrew Ammerlaan <andrewammerlaan <AT> gentoo.org>
13
14 dev-python/numba/numba-0.54.0.ebuild | 84 ++++++++++++++++++++++++++++++++++++
15 1 file changed, 84 insertions(+)
16
17 diff --git a/dev-python/numba/numba-0.54.0.ebuild b/dev-python/numba/numba-0.54.0.ebuild
18 new file mode 100644
19 index 000000000..125b20daf
20 --- /dev/null
21 +++ b/dev-python/numba/numba-0.54.0.ebuild
22 @@ -0,0 +1,84 @@
23 +# Copyright 1999-2021 Gentoo Authors
24 +# Distributed under the terms of the GNU General Public License v2
25 +
26 +EAPI=8
27 +
28 +PYTHON_COMPAT=( python3_{8..9} )
29 +
30 +DISTUTILS_USE_SETUPTOOLS=rdepend
31 +inherit optfeature multiprocessing distutils-r1
32 +
33 +DESCRIPTION="NumPy aware dynamic Python compiler using LLVM"
34 +HOMEPAGE="https://numba.pydata.org/
35 + https://github.com/numba"
36 +SRC_URI="https://github.com/numba/numba/archive/${PV}.tar.gz -> ${P}.tar.gz"
37 +
38 +LICENSE="BSD"
39 +SLOT="0"
40 +KEYWORDS="~amd64 ~arm ~arm64 ~x86"
41 +IUSE="openmp threads"
42 +
43 +RDEPEND="
44 + >=dev-python/llvmlite-0.37.0[${PYTHON_USEDEP}]
45 + <dev-python/llvmlite-0.38.0
46 + >=dev-python/numpy-1.17.0[${PYTHON_USEDEP}]
47 + threads? ( >=dev-cpp/tbb-2019.5 )
48 +"
49 +BDEPEND="
50 + dev-python/pip[${PYTHON_USEDEP}]
51 + dev-python/versioneer[${PYTHON_USEDEP}]
52 +"
53 +
54 +DISTUTILS_IN_SOURCE_BUILD=1
55 +distutils_enable_tests unittest
56 +distutils_enable_sphinx docs/source dev-python/numpydoc dev-python/sphinx_rtd_theme
57 +
58 +PATCHES=(
59 + "${FILESDIR}/${PN}-0.52.0-skip_tests.patch"
60 +)
61 +
62 +pkg_setup() {
63 + if ! use openmp; then
64 + export NUMBA_DISABLE_OPENMP=1 || die
65 + else
66 + unset NUMBA_DISABLE_OPENMP || die
67 + fi
68 + if ! use threads; then
69 + export NUMBA_DISABLE_TBB=1 || die
70 + else
71 + unset NUMBA_DISABLE_TBB || die
72 + export TBBROOT="${EPREFIX}/usr" || die
73 + fi
74 +}
75 +
76 +python_prepare_all() {
77 + # This conf.py only works in a git repo
78 + if use doc; then
79 + git init -q || die
80 + git config user.email "larry@g.o" || die
81 + git config user.name "Larry the Cow" || die
82 + git add . || die
83 + git commit -m "init" || die
84 + fi
85 + distutils-r1_python_prepare_all
86 +}
87 +
88 +python_compile() {
89 + # FIXME: parallel python building fails. See Portage bug #614464 and
90 + # gentoo/sci issue #1080.
91 + export MAKEOPTS=-j1 || die
92 + distutils-r1_python_compile
93 +}
94 +
95 +# https://numba.pydata.org/numba-doc/latest/developer/contributing.html?highlight=test#running-tests
96 +python_test() {
97 + distutils_install_for_testing
98 + ${EPYTHON} setup.py build_ext --inplace || die \
99 + "${EPYTHON} failed to build_ext"
100 + ${EPYTHON} runtests.py -m $(makeopts_jobs) || die \
101 + "${EPYTHON} failed unittests"
102 +}
103 +
104 +pkg_postinst() {
105 + optfeature "compile cuda code" dev-util/nvidia-cuda-sdk
106 +}