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/llvmlite/
Date: Tue, 30 Nov 2021 13:24:38
Message-Id: 1638278579.0d75713d0f438263bb8fcbee0662e6ffe0a77159.andrewammerlaan@gentoo
1 commit: 0d75713d0f438263bb8fcbee0662e6ffe0a77159
2 Author: Andrew Ammerlaan <andrewammerlaan <AT> gentoo <DOT> org>
3 AuthorDate: Tue Nov 30 13:22:59 2021 +0000
4 Commit: Andrew Ammerlaan <andrewammerlaan <AT> gentoo <DOT> org>
5 CommitDate: Tue Nov 30 13:22:59 2021 +0000
6 URL: https://gitweb.gentoo.org/proj/sci.git/commit/?id=0d75713d
7
8 dev-python/llvmlite: last-rites from ::gentoo
9
10 Package-Manager: Portage-3.0.28, Repoman-3.0.3
11 Signed-off-by: Andrew Ammerlaan <andrewammerlaan <AT> gentoo.org>
12
13 dev-python/llvmlite/llvmlite-0.37.0.ebuild | 60 ++++++++++++++++++++++++++++++
14 dev-python/llvmlite/metadata.xml | 18 +++++++++
15 2 files changed, 78 insertions(+)
16
17 diff --git a/dev-python/llvmlite/llvmlite-0.37.0.ebuild b/dev-python/llvmlite/llvmlite-0.37.0.ebuild
18 new file mode 100644
19 index 000000000..d76175444
20 --- /dev/null
21 +++ b/dev-python/llvmlite/llvmlite-0.37.0.ebuild
22 @@ -0,0 +1,60 @@
23 +# Copyright 1999-2021 Gentoo Authors
24 +# Distributed under the terms of the GNU General Public License v2
25 +
26 +EAPI=7
27 +
28 +PYTHON_COMPAT=( python3_{8..10} )
29 +inherit distutils-r1 llvm
30 +
31 +DESCRIPTION="Python wrapper around the llvm C++ library"
32 +HOMEPAGE="https://llvmlite.pydata.org/"
33 +SRC_URI="https://github.com/numba/llvmlite/archive/v${PV/_/}.tar.gz -> ${P/_/}.gh.tar.gz"
34 +S="${WORKDIR}/${P/_/}"
35 +
36 +LICENSE="BSD"
37 +SLOT="0"
38 +KEYWORDS="~amd64 ~arm ~arm64 ~x86"
39 +IUSE="examples"
40 +
41 +LLVM_MAX_SLOT=11
42 +
43 +RDEPEND="
44 + sys-devel/llvm:${LLVM_MAX_SLOT}
45 + sys-libs/zlib:0=
46 +"
47 +DEPEND="${RDEPEND}"
48 +
49 +src_prepare() {
50 + sed -i -e '/max_python/s:3\.10:3.11:' setup.py || die
51 + distutils-r1_src_prepare
52 +}
53 +
54 +python_configure_all() {
55 + # upstream's build system is just horrible, and they ignored the PR
56 + # fixing it, so let's build the shared lib properly using implicit
57 + # make rules
58 +
59 + export LDLIBS=$(llvm-config --libs all)
60 + export CXXFLAGS="$(llvm-config --cxxflags) -fPIC ${CXXFLAGS}"
61 + export LDFLAGS="$(llvm-config --ldflags) ${LDFLAGS}"
62 +
63 + local files=( ffi/*.cpp )
64 + emake -f - <<EOF
65 +ffi/libllvmlite.so: ${files[*]/.cpp/.o}
66 + \$(CXX) -shared \$(CXXFLAGS) \$(LDFLAGS) -o \$@ \$^ \$(LDLIBS)
67 +EOF
68 +
69 + export LLVMLITE_SKIP_LLVM_VERSION_CHECK=1
70 +}
71 +
72 +python_test() {
73 + "${EPYTHON}" runtests.py -v || die "Tests failed under ${EPYTHON}"
74 +}
75 +
76 +python_install_all() {
77 + distutils-r1_python_install_all
78 + if use examples; then
79 + dodoc -r examples
80 + docompress -x /usr/share/doc/${PF}/examples
81 + fi
82 +}
83
84 diff --git a/dev-python/llvmlite/metadata.xml b/dev-python/llvmlite/metadata.xml
85 new file mode 100644
86 index 000000000..0983f7a41
87 --- /dev/null
88 +++ b/dev-python/llvmlite/metadata.xml
89 @@ -0,0 +1,18 @@
90 +<?xml version="1.0" encoding="UTF-8"?>
91 +<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
92 +<pkgmetadata>
93 + <maintainer type="project">
94 + <email>sci@g.o</email>
95 + <name>Gentoo Science Project</name>
96 + </maintainer>
97 + <longdescription>
98 + llvmlite uses the LLVM library for JIT (just-in-time) compilation of
99 + Python code into native machine instructions during runtime. Instead
100 + of exposing large parts of the LLVM C++ API for direct calls into the
101 + LLVM library, llvmlite follows a lightweight multi-layered approach.
102 + </longdescription>
103 + <upstream>
104 + <remote-id type="pypi">llvmlite</remote-id>
105 + <remote-id type="github">numba/llvmlite</remote-id>
106 + </upstream>
107 +</pkgmetadata>