diff options
Diffstat (limited to 'dev-python/berkeleydb/berkeleydb-18.1.16.ebuild')
| -rw-r--r-- | dev-python/berkeleydb/berkeleydb-18.1.16.ebuild | 75 |
1 files changed, 75 insertions, 0 deletions
diff --git a/dev-python/berkeleydb/berkeleydb-18.1.16.ebuild b/dev-python/berkeleydb/berkeleydb-18.1.16.ebuild new file mode 100644 index 000000000000..f4173794e751 --- /dev/null +++ b/dev-python/berkeleydb/berkeleydb-18.1.16.ebuild @@ -0,0 +1,75 @@ +# Copyright 2025-2026 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_{13..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}" +} |
