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/cadquery-pywrap/
Date: Sun, 18 Jul 2021 08:35:37
Message-Id: 1626597285.5c39cf066074c44295f3eabbd72c3eea86e92f76.andrewammerlaan@gentoo
1 commit: 5c39cf066074c44295f3eabbd72c3eea86e92f76
2 Author: leycec <leycec <AT> gmail <DOT> com>
3 AuthorDate: Fri Jul 16 07:11:52 2021 +0000
4 Commit: Andrew Ammerlaan <andrewammerlaan <AT> gentoo <DOT> org>
5 CommitDate: Sun Jul 18 08:34:45 2021 +0000
6 URL: https://gitweb.gentoo.org/proj/sci.git/commit/?id=5c39cf06
7
8 dev-python/cadquery-pywrap: add
9
10 add pywrap, a mandatory dependency of CadQuery vis-a-vis OCP
11
12 Signed-off-by: Cecil Curry <leycec <AT> gmail.com>
13 Closes: https://github.com/gentoo/sci/pull/1098
14 Signed-off-by: Andrew Ammerlaan <andrewammerlaan <AT> gentoo.org>
15
16 .../cadquery-pywrap-7.5.2_rc20210526.ebuild | 70 ++++++++++++++++++++++
17 dev-python/cadquery-pywrap/metadata.xml | 12 ++++
18 2 files changed, 82 insertions(+)
19
20 diff --git a/dev-python/cadquery-pywrap/cadquery-pywrap-7.5.2_rc20210526.ebuild b/dev-python/cadquery-pywrap/cadquery-pywrap-7.5.2_rc20210526.ebuild
21 new file mode 100644
22 index 000000000..fc97f9db1
23 --- /dev/null
24 +++ b/dev-python/cadquery-pywrap/cadquery-pywrap-7.5.2_rc20210526.ebuild
25 @@ -0,0 +1,70 @@
26 +# Copyright 1999-2021 Gentoo Authors
27 +# Distributed under the terms of the GNU General Public License v2
28 +
29 +EAPI=7
30 +
31 +PYTHON_COMPAT=( python3_{8..9} )
32 +
33 +inherit llvm toolchain-funcs distutils-r1
34 +
35 +DESCRIPTION="C++ binding generator based on libclang and pybind11"
36 +HOMEPAGE="https://github.com/CadQuery/pywrap"
37 +
38 +#FIXME: Uncomment on bumping to the next stable release.
39 +# MY_PN=occt
40 +# MY_PV=$(ver_cut 1-2)
41 +# MY_P="${MY_PN}${MY_PV}"
42 +# SRC_URI="https://github.com/CadQuery/pywrap/archive/refs/tags/${MY_P}.tar.gz"
43 +
44 +# The official pywrap 7.4.0 tarball is broken, but pywrap 7.5.2 has yet to be
45 +# officially released. We instead package a commit known to work as expected.
46 +MY_COMMIT="f8869e5a47fd3e3e1d31e7ab89b46c158f7487bf"
47 +SRC_URI="https://github.com/CadQuery/pywrap/archive/${MY_COMMIT}.tar.gz -> ${P}.tar.gz"
48 +
49 +LICENSE="Apache-2.0"
50 +KEYWORDS="~amd64 ~x86"
51 +SLOT="0"
52 +
53 +# Dependencies are intentionally listed in "setup.py" order.
54 +RDEPEND="
55 + dev-python/click[${PYTHON_USEDEP}]
56 + dev-python/logzero[${PYTHON_USEDEP}]
57 + dev-python/path-py[${PYTHON_USEDEP}]
58 + dev-python/clang-python[${PYTHON_USEDEP}]
59 + dev-python/cymbal[${PYTHON_USEDEP}]
60 + dev-python/toml[${PYTHON_USEDEP}]
61 + dev-python/pandas[${PYTHON_USEDEP}]
62 + >=dev-python/joblib-1.0.0[${PYTHON_USEDEP}]
63 + dev-python/tqdm[${PYTHON_USEDEP}]
64 + dev-python/jinja[${PYTHON_USEDEP}]
65 + dev-python/toposort[${PYTHON_USEDEP}]
66 + dev-python/pyparsing[${PYTHON_USEDEP}]
67 + dev-python/pybind11[${PYTHON_USEDEP}]
68 + dev-python/schema[${PYTHON_USEDEP}]
69 + sci-libs/vtk
70 +"
71 +DEPEND="${RDEPEND}"
72 +
73 +S="${WORKDIR}/pywrap-${MY_COMMIT}"
74 +
75 +src_prepare() {
76 + # Relax Jinja version requirements. See also upstream pull request:
77 + # https://github.com/CadQuery/pywrap/pull/34
78 + sed -i -e "s~'jinja2==\\(.*\\)',~'jinja2>=\\1,<4',~" setup.py || die
79 + sed -i \
80 + -e 's~^\({%- macro super(cls,classes,typedefs\)\() -%}\)$~\1=[]\2~' \
81 + bindgen/macros.j2 || die
82 +
83 + #FIXME: Submit an upstream issue. This violates PEP 440 standards.
84 + # Sanitize the "bindgen" version to avoid Gentoo QA notices.
85 + sed -i -e 's~\(version=\)"0.1dev"~\1"'$(ver_rs 3 '')'"~' setup.py || die
86 +
87 + # Replace conda- with Gentoo-specific prefix dirnames.
88 + sed -i -e "s~\\bgetenv('CONDA_PREFIX')~'${EPREFIX}/usr'~" bindgen/*.py ||
89 + die
90 +
91 + # Reduce all hardcoded header includes to noops.
92 + sed -i -e 's~rv\.append(Path(prefix).*~True~' bindgen/utils.py || die
93 +
94 + distutils-r1_src_prepare
95 +}
96
97 diff --git a/dev-python/cadquery-pywrap/metadata.xml b/dev-python/cadquery-pywrap/metadata.xml
98 new file mode 100644
99 index 000000000..aef989a0c
100 --- /dev/null
101 +++ b/dev-python/cadquery-pywrap/metadata.xml
102 @@ -0,0 +1,12 @@
103 +<?xml version="1.0" encoding="UTF-8"?>
104 +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
105 +<pkgmetadata>
106 + <maintainer type="project">
107 + <email>sci@g.o</email>
108 + <name>Gentoo Science Project</name>
109 + </maintainer>
110 + <stabilize-allarches/>
111 + <upstream>
112 + <remote-id type="github">CadQuery/pywrap</remote-id>
113 + </upstream>
114 +</pkgmetadata>