Gentoo Archives: gentoo-commits

From: Florian Schmaus <flow@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/proj/guru:master commit in: app-office/beancount/
Date: Mon, 27 Feb 2023 15:07:02
Message-Id: 1677461750.f7dfbeb064b132fbdb4798b786110664bc782929.flow@gentoo
1 commit: f7dfbeb064b132fbdb4798b786110664bc782929
2 Author: Anna (cybertailor) Vyalkova <cyber+gentoo <AT> sysrq <DOT> in>
3 AuthorDate: Mon Feb 27 00:40:05 2023 +0000
4 Commit: Florian Schmaus <flow <AT> gentoo <DOT> org>
5 CommitDate: Mon Feb 27 01:35:50 2023 +0000
6 URL: https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=f7dfbeb0
7
8 app-office/beancount: enable py3.11
9
10 Signed-off-by: Anna (cybertailor) Vyalkova <cyber+gentoo <AT> sysrq.in>
11
12 ...t-2.3.5-r1.ebuild => beancount-2.3.5-r2.ebuild} | 57 +++++++++++++++++++---
13 1 file changed, 51 insertions(+), 6 deletions(-)
14
15 diff --git a/app-office/beancount/beancount-2.3.5-r1.ebuild b/app-office/beancount/beancount-2.3.5-r2.ebuild
16 similarity index 61%
17 rename from app-office/beancount/beancount-2.3.5-r1.ebuild
18 rename to app-office/beancount/beancount-2.3.5-r2.ebuild
19 index 296a34055..4612d6706 100644
20 --- a/app-office/beancount/beancount-2.3.5-r1.ebuild
21 +++ b/app-office/beancount/beancount-2.3.5-r2.ebuild
22 @@ -3,11 +3,11 @@
23
24 EAPI=8
25
26 -PYTHON_COMPAT=( python3_10 )
27 +PYTHON_COMPAT=( python3_{10..11} )
28 DISTUTILS_USE_PEP517=setuptools
29 DISTUTILS_SINGLE_IMPL=1
30
31 -inherit distutils-r1
32 +inherit distutils-r1 toolchain-funcs
33
34 DESCRIPTION="A double-entry accounting system that uses text files as input"
35 HOMEPAGE="https://beancount.github.io https://github.com/beancount/beancount"
36 @@ -25,32 +25,73 @@ RDEPEND="
37 dev-python/google-api-python-client[${PYTHON_USEDEP}]
38 dev-python/lxml[${PYTHON_USEDEP}]
39 dev-python/ply[${PYTHON_USEDEP}]
40 - dev-python/pytest[${PYTHON_USEDEP}]
41 dev-python/python-dateutil[${PYTHON_USEDEP}]
42 dev-python/python-magic[${PYTHON_USEDEP}]
43 dev-python/requests[${PYTHON_USEDEP}]
44 ')
45 "
46 +BDEPEND="
47 + sys-devel/bison
48 + sys-devel/flex
49 +"
50
51 EPYTEST_DESELECT=( scripts/setup_test.py )
52
53 distutils_enable_tests pytest
54
55 src_prepare() {
56 + distutils-r1_src_prepare
57 +
58 + # remove test deps from 'install_requires'
59 + sed "/pytest/d" -i setup.py || die
60 +
61 + # we'll regenerate C sources
62 + rm ${PN}/parser/grammar.{c,h} || die
63 + rm ${PN}/parser/lexer.{c,h} || die
64 +
65 + # repair tests
66 sed "/def find_repository_root/a\ return '${S}'" \
67 -i ${PN}/utils/test_utils.py || die
68 sed "s/\[PROGRAM\]/['${EPYTHON}', PROGRAM]/" \
69 -i ${PN}/tools/treeify_test.py || die
70 sed "/DATA_DIR =/c\ DATA_DIR = '${S}/${PN}/utils/file_type_testdata'" \
71 -i ${PN}/utils/file_type_test.py || die
72 - distutils-r1_src_prepare
73 +}
74 +
75 +src_configure() {
76 + tc-export CC
77 }
78
79 python_compile() {
80 distutils-r1_python_compile
81
82 # keep in sync with hashsrc.py, otherwise expect test failures
83 - cp beancount/parser/{lexer.l,grammar.y,decimal.h,decimal.c,macros.h,parser.h,parser.c,tokens.h} "${BUILD_DIR}"/install$(python_get_sitedir)/${PN}/parser || die
84 + local csources=(
85 + decimal.{c,h}
86 + grammar.y
87 + lexer.l
88 + macros.h
89 + parser.{c,h}
90 + tokens.h
91 + )
92 +
93 + for file in "${csources[@]}"; do
94 + cp ${PN}/parser/${file} "${BUILD_DIR}"/install$(python_get_sitedir)/${PN}/parser || die
95 + done
96 +}
97 +
98 +src_compile() {
99 + local mymakeflags=(
100 + PYCONFIG="$(python_get_PYTHON_CONFIG)"
101 + )
102 +
103 + emake "${mymakeflags[@]}" ${PN}/parser/grammar.c
104 + emake "${mymakeflags[@]}" ${PN}/parser/lexer.c
105 +
106 + distutils-r1_src_compile
107 +
108 + use test && \
109 + emake "${mymakeflags[@]}" ${PN}/parser/tokens_test
110 }
111
112 python_test(){
113 @@ -59,6 +100,10 @@ python_test(){
114 }
115
116 src_test() {
117 - emake ctest
118 + local mymakeflags=(
119 + PYCONFIG="$(python_get_PYTHON_CONFIG)"
120 + )
121 +
122 + emake "${mymakeflags[@]}" ctest
123 distutils-r1_src_test
124 }