dev-python/berkeleydb: new package, add 18.1.15

Readd as a stopgap to allow users to upgrade to the sqlite backend in
exaile.

https://github.com/exaile/exaile/wiki/Exaile-4.2-release-notes#for-packagers

Bug: https://bugs.gentoo.org/892854
Signed-off-by: Alfred Wingate <parona@protonmail.com>
Part-of: https://github.com/gentoo/gentoo/pull/44231
Signed-off-by: Sam James <sam@gentoo.org>
This commit is contained in:
Alfred Wingate 2025-10-18 01:48:56 +03:00 committed by Sam James
parent 3751fafbcf
commit 5304613eb6
No known key found for this signature in database
GPG Key ID: 738409F520DF9190
4 changed files with 92 additions and 0 deletions

View File

@ -0,0 +1 @@
DIST berkeleydb-18.1.15.tar.gz 188446 BLAKE2B e018ad0afb557b866121a267e5b64d627c5c3752f5929652f2e291f9ff67c8e5bb7319fbade04ec0ecfac3aefe58c3497745f5c9b467aa2dd30c01297679ac53 SHA512 60d987851febb158888d2a5fe35bc9169e4855fcfc40b836f0d089db9cc6a0da2c7032b348ac486a7d873eae6999d6d8ce3833461d50fe8afbcf498d37b5afa2

View File

@ -0,0 +1,75 @@
# Copyright 2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
DISTUTILS_EXT=1
DISTUTILS_USE_PEP517=setuptools
PYTHON_COMPAT=( python3_{11..14} )
inherit db-use distutils-r1 pypi
DESCRIPTION="Python bindings for Oracle Berkeley DB"
HOMEPAGE="
https://www.jcea.es/programacion/pybsddb.htm
https://pypi.org/project/berkeleydb/
"
LICENSE="BSD"
SLOT="0"
KEYWORDS="~amd64"
IUSE="test"
RESTRICT="!test? ( test )"
RDEPEND="
<sys-libs/db-6.0:=
|| (
sys-libs/db:5.3
sys-libs/db:4.8
)
"
BDEPEND="
test? (
dev-python/packaging[${PYTHON_USEDEP}]
dev-python/test[${PYTHON_USEDEP}]
)
"
python_prepare_all() {
distutils-r1_python_prepare_all
# This list should be kept in sync with setup.py.
if [[ -z ${DB_VER} ]]; then
for DB_VER in 5.3 4.8; do
has_version "sys-libs/db:${DB_VER}" && break
done
fi
# Force version.
sed -e "s/db_ver = None/db_ver = (${DB_VER%.*}, ${DB_VER#*.})/" \
-e "s/dblib = 'db'/dblib = '$(db_libname ${DB_VER})'/" \
-i setup3.py || die
# Fix the build
mv setup3.py setup.py || die
sed -e 's|setuptools.build_meta:__legacy__|setuptools.build_meta|' -i pyproject.toml || die
# no build dir
sed -e "/os.chdir('build')/d" -i test.py || die
# Set it ourselves in the test phase
sed -e "/os.environ\['BERKELEYDB_SO_PATH'\]/d" -i test.py || die
}
python_configure_all() {
DISTUTILS_ARGS=(
--berkeley-db="${EPREFIX}/usr"
--berkeley-db-incdir="$(db_includedir ${DB_VER})"
--berkeley-db-libdir="${EPREFIX}/usr/$(get_libdir)"
)
}
python_test() {
local -x BERKELEYDB_SO_PATH="${BUILD_DIR}"
"${EPYTHON}" test.py -vv || die "Testing failed with ${EPYTHON}"
}

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="project">
<email>python@gentoo.org</email>
</maintainer>
<upstream>
<doc>https://docs.jcea.es/berkeleydb/latest/</doc>
<remote-id type="pypi">berkeleydb</remote-id>
</upstream>
</pkgmetadata>

View File

@ -17,6 +17,11 @@
#--- END OF EXAMPLES ---
# Alfred Wingate <parona@protonmail.com> (2025-10-18)
# Only exists temporarily to facilitate upgrades for exaile.
# Bug 892854
dev-python/berkeleydb
# Michał Górny <mgorny@gentoo.org> (2025-10-01)
# dev-python/passlib is unmaintained upstream (last release in 2020),
# and we keep having to patch breakage out. Packages really need