66 lines
2.5 KiB
Bash
66 lines
2.5 KiB
Bash
# Maintainer: Egor Savkin <es@m-labs.hk>
|
|
|
|
_realname=lmdb
|
|
pkgbase=mingw-w64-python-${_realname}
|
|
pkgname=("${MINGW_PACKAGE_PREFIX}-python-${_realname}")
|
|
pkgver=1.4.1
|
|
pkgrel=3
|
|
pkgdesc="Universal Python binding for the LMDB 'Lightning' Database"
|
|
arch=('any')
|
|
mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clangarm64' 'clang32')
|
|
msys2_references=(
|
|
'pypi: lmdb'
|
|
"cpe: cpe:/a:py-lmdb_project:py-lmdb"
|
|
)
|
|
url="https://github.com/jnwatson/py-lmdb"
|
|
license=('OLDAP-2.8')
|
|
depends=("${MINGW_PACKAGE_PREFIX}-python" "${MINGW_PACKAGE_PREFIX}-lmdb")
|
|
makedepends=("${MINGW_PACKAGE_PREFIX}-cc"
|
|
"${MINGW_PACKAGE_PREFIX}-python-setuptools"
|
|
"${MINGW_PACKAGE_PREFIX}-python-installer"
|
|
"${MINGW_PACKAGE_PREFIX}-python-wheel"
|
|
"${MINGW_PACKAGE_PREFIX}-python-build")
|
|
source=("https://pypi.org/packages/source/${_realname::1}/${_realname}/${_realname}-${pkgver}.tar.gz"
|
|
"001-py-lmdb-1.4.1-mingw-build.patch")
|
|
sha256sums=('1f4c76af24e907593487c904ef5eba1993beb38ed385af82adb25a858f2d658d'
|
|
'231fef4195024fb3db57d853f471e8cb9ccc3e60b54b39dc18a6dc6026b37a86')
|
|
|
|
prepare() {
|
|
cd "${srcdir}"
|
|
cp -r "${_realname}-${pkgver}" "python-build-${CARCH}"
|
|
cd "python-build-${CARCH}"
|
|
patch -Np1 -i "${srcdir}"/001-py-lmdb-1.4.1-mingw-build.patch
|
|
export LMDB_FORCE_SYSTEM=1
|
|
export LMDB_BUILDLIB=build/lib.`python -c "import sysconfig;print(sysconfig.get_platform().replace('-', '_').replace('.', '_')+'-'+sysconfig.get_python_version())"`
|
|
}
|
|
|
|
build() {
|
|
cd "${srcdir}/python-build-${CARCH}"
|
|
${MINGW_PREFIX}/bin/python -m build --wheel --skip-dependency-check --no-isolation
|
|
}
|
|
|
|
check() {
|
|
cd "${srcdir}/python-build-${CARCH}"
|
|
cp -r tests ${LMDB_BUILDLIB}/tests
|
|
"${MINGW_PREFIX}"/bin/python setup.py check
|
|
cd ${LMDB_BUILDLIB}
|
|
"${MINGW_PREFIX}"/bin/python tests/crash_test.py
|
|
"${MINGW_PREFIX}"/bin/python tests/cursor_test.py
|
|
"${MINGW_PREFIX}"/bin/python tests/getmulti_test.py
|
|
"${MINGW_PREFIX}"/bin/python tests/iteration_test.py
|
|
"${MINGW_PREFIX}"/bin/python tests/package_test.py
|
|
"${MINGW_PREFIX}"/bin/python tests/tool_test.py
|
|
"${MINGW_PREFIX}"/bin/python tests/txn_test.py
|
|
"${MINGW_PREFIX}"/bin/python tests/env_test.py
|
|
rm -rf tests
|
|
}
|
|
|
|
package() {
|
|
cd "${srcdir}/python-build-${CARCH}"
|
|
MSYS2_ARG_CONV_EXCL="--prefix=;--install-scripts=;--install-purelib=;" \
|
|
${MINGW_PREFIX}/bin/python -m installer --prefix=${MINGW_PREFIX} \
|
|
--destdir="${pkgdir}" dist/*.whl
|
|
install -D -m644 LICENSE "${pkgdir}${MINGW_PREFIX}"/share/licenses/python-${_realname}/LICENSE
|
|
}
|
|
|