diff options
author | Bazaah | 2024-03-18 14:44:30 +0000 |
---|---|---|
committer | Bazaah | 2024-03-23 10:38:18 +0000 |
commit | 3d35081c5a0f8aaea57f8032ce650c84610e5082 (patch) | |
tree | 6b1c51186f34071403868167fa0aaa702f372236 | |
parent | 8b874b827b07ea689ac4535690f67bad53a6d275 (diff) | |
download | aur-3d35081c5a0f8aaea57f8032ce650c84610e5082.tar.gz |
pkgbuild: add ceph_bcrypt to python-ceph-common
-rw-r--r-- | PKGBUILD | 56 |
1 files changed, 56 insertions, 0 deletions
@@ -166,6 +166,8 @@ export CXXFLAGS="${CXXFLAGS/-fno-plt/}" prepare() { cd "${srcdir}/${pkgbase}-${pkgver}" + _prepare_ceph_python_bcrypt + # apply patches from the source array local filename for filename in "${source[@]%%::*}"; do @@ -195,6 +197,8 @@ prepare() { build() { cd "${srcdir}/${pkgbase}-${pkgver}" + _build_ceph_python_bcrypt + export CFLAGS+=" ${CPPFLAGS}" export CXXFLAGS+=" ${CPPFLAGS}" export CMAKE_BUILD_TYPE='RelWithDebInfo' @@ -260,6 +264,8 @@ build() { check() { cd "${srcdir}/${pkgbase}-${pkgver}" + _check_ceph_python_bcrypt + export CTEST_PARALLEL_LEVEL=7 export CTEST_OUTPUT_ON_FAILURE=1 @@ -1040,6 +1046,9 @@ package_python-ceph-common() { ) mv __pkg__/$pkgname/* "$pkgdir" + + _package_ceph_python_bcrypt + _print } @@ -1146,4 +1155,51 @@ package_ceph() { #======================================================================================# #======================================================================================# +_prepare_ceph_python_bcrypt() { + ( + cd "${srcdir}/bcrypt-${__bcrypt_version}" + + # apply patches from the source array + local filename + for filename in "${source[@]%%::*}"; do + if [[ "${filename}" =~ \.patch$ ]] \ + && [[ "${filename}" =~ ^python-bcrypt-.* ]]; then + echo "Applying patch ${filename##*/}" + patch -p1 -N -i "${srcdir}/${filename##*/}" + fi + done + + mv -v src/{bcrypt,ceph_bcrypt} + ) +} + +_build_ceph_python_bcrypt() { + ( + cd "${srcdir}/bcrypt-${__bcrypt_version}" + + python -m build --wheel --no-isolation + ) +} + +_check_ceph_python_bcrypt() { + ( + cd "${srcdir}/bcrypt-${__bcrypt_version}" + + local _site_packages=$(python -c "import site; print(site.getsitepackages()[0])") + + python -m installer --destdir=test_dir dist/*.whl + PYTHONPATH="test_dir/$_site_packages:$PYTHONPATH" pytest + ) +} + +_package_ceph_python_bcrypt() { + ( + cd "${srcdir}/bcrypt-${__bcrypt_version}" + + python -m installer --destdir="${pkgdir}" dist/*.whl + ) +} +#======================================================================================# +#======================================================================================# + # vim:set ts=2 sw=2 et: |