Gentoo Archives: gentoo-commits

From: Arthur Zamarin <arthurzam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/berkeleydb/
Date: Fri, 21 Jan 2022 19:09:04
Message-Id: 1642792131.4eddc8adbd1f731259b52b2d66ae44ad4af3b513.arthurzam@gentoo
1 commit: 4eddc8adbd1f731259b52b2d66ae44ad4af3b513
2 Author: Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
3 AuthorDate: Fri Jan 21 18:47:51 2022 +0000
4 Commit: Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
5 CommitDate: Fri Jan 21 19:08:51 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4eddc8ad
7
8 dev-python/berkeleydb: add 18.1.5
9
10 Signed-off-by: Arthur Zamarin <arthurzam <AT> gentoo.org>
11
12 dev-python/berkeleydb/Manifest | 1 +
13 dev-python/berkeleydb/berkeleydb-18.1.5.ebuild | 62 ++++++++++++++++++++++++++
14 2 files changed, 63 insertions(+)
15
16 diff --git a/dev-python/berkeleydb/Manifest b/dev-python/berkeleydb/Manifest
17 index 486f8088b1e8..4807bdfcebfb 100644
18 --- a/dev-python/berkeleydb/Manifest
19 +++ b/dev-python/berkeleydb/Manifest
20 @@ -1 +1,2 @@
21 DIST berkeleydb-18.1.4.tar.xz 137160 BLAKE2B c93e7707bf12199c8161112accfedc3b0180b8f6edcf5c928c03f373528bb9ccb23219865344d9ed29d30b0133a2161ba0325257b6f7a2d22a58e8d9b1f82ce2 SHA512 bac2848e82ba5fdd3ca8fbf3a02d04faf270132f4b9fe93096ea57ab99fcc7eba02ff8a9638ea8e028d8bd4f16eebbefb65f33ea67e95c0a14cced05d04b23b8
22 +DIST berkeleydb-18.1.5.tar.xz 138488 BLAKE2B 1131509f30316469cfed30abdbd672ab73ef7dfc957e16935d04066b4a2efeb3c777ae4f70f821a29f4d8b8b51d649998735eb412639cc52997c9ee4a98c51db SHA512 c7a51e96cf32b74188b0cb4ed1d8b87436b30dc4929ba22180677ffb5eacd455a67eb5a231c814fc46ccc4c6a5da2f41876a343228969eab988bb0766d40a751
23
24 diff --git a/dev-python/berkeleydb/berkeleydb-18.1.5.ebuild b/dev-python/berkeleydb/berkeleydb-18.1.5.ebuild
25 new file mode 100644
26 index 000000000000..1117442721e8
27 --- /dev/null
28 +++ b/dev-python/berkeleydb/berkeleydb-18.1.5.ebuild
29 @@ -0,0 +1,62 @@
30 +# Copyright 2021-2022 Gentoo Authors
31 +# Distributed under the terms of the GNU General Public License v2
32 +
33 +EAPI=7
34 +
35 +PYTHON_COMPAT=( python3_{8..10} )
36 +PYTHON_REQ_USE="threads(+)"
37 +DISTUTILS_IN_SOURCE_BUILD=1
38 +inherit db-use distutils-r1
39 +
40 +# Tests aren't included in PyPi tarballs, so just manually clone from upstream
41 +# at https://hg.jcea.es/pybsddb/ and prepare out tarball
42 +
43 +DESCRIPTION="Python bindings for Oracle Berkeley DB"
44 +HOMEPAGE="https://www.jcea.es/programacion/pybsddb.htm https://pypi.org/project/berkeleydb/"
45 +SRC_URI="https://dev.gentoo.org/~arthurzam/distfiles/dev-python/${PN}/${P}.tar.xz"
46 +
47 +LICENSE="BSD"
48 +SLOT="0"
49 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~mips ~ppc ~ppc64 ~riscv ~sparc ~x86"
50 +
51 +RDEPEND="
52 + || (
53 + sys-libs/db:6.2
54 + sys-libs/db:5.3
55 + sys-libs/db:4.8
56 + )"
57 +DEPEND="${RDEPEND}"
58 +
59 +python_prepare_all() {
60 + # This list should be kept in sync with setup3.py.
61 + if [[ -z ${DB_VER} ]]; then
62 + for DB_VER in 6.2 5.3 4.8; do
63 + has_version "sys-libs/db:${DB_VER}" && break
64 + done
65 + fi
66 +
67 + # Force version.
68 + sed -e "s/db_ver = None/db_ver = (${DB_VER%.*}, ${DB_VER#*.})/" \
69 + -e "s/dblib = 'db'/dblib = '$(db_libname ${DB_VER})'/" \
70 + -i setup3.py || die
71 +
72 + # rename to bypass name conflict with builtin test module
73 + mv test.py test3.py || die
74 +
75 + # Adjust test3.py to look in build/lib.
76 + sed -e "s/'lib.%s' % PLAT_SPEC/'lib'/" -i test3.py || die
77 +
78 + distutils-r1_python_prepare_all
79 +}
80 +
81 +python_configure_all() {
82 + # These are needed for both build and install.
83 + export BERKELEYDB_DIR="${EPREFIX}/usr"
84 + export BERKELEYDB_INCDIR="$(db_includedir ${DB_VER})"
85 + export BERKELEYDB_LIBDIR="${EPREFIX}/usr/$(get_libdir)"
86 + export YES_I_HAVE_THE_RIGHT_TO_USE_THIS_BERKELEY_DB_VERSION=1
87 +}
88 +
89 +python_test() {
90 + "${EPYTHON}" test3.py -vv || die "Testing failed with ${EPYTHON}"
91 +}