summaryrefslogtreecommitdiff
path: root/dev-python/berkeleydb/berkeleydb-18.1.15.ebuild
diff options
context:
space:
mode:
authorAlfred Wingate <parona@protonmail.com>2025-10-18 01:48:56 +0300
committerSam James <sam@gentoo.org>2025-10-26 06:17:56 +0000
commit5304613eb681ab19772f1e0c620023222d1b44d0 (patch)
tree866911092057703831cb4cff7da75c3852cdaf16 /dev-python/berkeleydb/berkeleydb-18.1.15.ebuild
parent3751fafbcf7611829bfc3430fce24593b9805632 (diff)
downloadgentoo-5304613eb681ab19772f1e0c620023222d1b44d0.tar.gz
gentoo-5304613eb681ab19772f1e0c620023222d1b44d0.tar.bz2
gentoo-5304613eb681ab19772f1e0c620023222d1b44d0.zip
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>
Diffstat (limited to 'dev-python/berkeleydb/berkeleydb-18.1.15.ebuild')
-rw-r--r--dev-python/berkeleydb/berkeleydb-18.1.15.ebuild75
1 files changed, 75 insertions, 0 deletions
diff --git a/dev-python/berkeleydb/berkeleydb-18.1.15.ebuild b/dev-python/berkeleydb/berkeleydb-18.1.15.ebuild
new file mode 100644
index 000000000000..c300836c33d8
--- /dev/null
+++ b/dev-python/berkeleydb/berkeleydb-18.1.15.ebuild
@@ -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}"
+}