diff options
author | Pellegrino Prevete | 2023-06-26 01:24:08 +0200 |
---|---|---|
committer | Pellegrino Prevete | 2023-06-26 01:24:08 +0200 |
commit | 04cf4bfa52095664c0f4eca8b85be6859e89ce4a (patch) | |
tree | d321c8c5ff03c90ab0cce593a43f804f601053ea | |
parent | 310f2661e4ca344562b63dcbc8ad604a677e7b9a (diff) | |
download | aur-04cf4bfa52095664c0f4eca8b85be6859e89ce4a.tar.gz |
make compatible with python build and python installer
-rw-r--r-- | .SRCINFO | 2 | ||||
-rw-r--r-- | PKGBUILD | 31 |
2 files changed, 30 insertions, 3 deletions
@@ -9,6 +9,8 @@ pkgbase = python-lvm arch = aarch64 arch = armv7h license = LGPL2.1 + makedepends = python-build + makedepends = python-installer depends = python depends = lvm2 source = https://ftp.gwdg.de/pub/linux/sources.redhat.com/lvm2/LVM2.2.02.188.tgz @@ -5,6 +5,7 @@ _py="python" _pkg="lvm" pkgname="${_py}-${_pkg}" pkgver=2.02.188 +_pkgver="2.02.188(2) (2021-05-07)" pkgrel=1 arch=( x86_64 @@ -16,6 +17,8 @@ url="http://sourceware.org/${_pkg}2/" license=('LGPL2.1') pkgdesc="Python 3 bindings for LVM" depends=("${_py}" "${_pkg}2") +makedepends=("${_py}-build" + "${_py}-installer") _url="https://ftp.gwdg.de/pub/linux/sources.redhat.com" source=("${_url}/${_pkg}2/LVM2.${pkgver}.tgz"{,.asc}) sha256sums=( @@ -25,6 +28,23 @@ validpgpkeys=( '88437EF5C077BD113D3B7224228191C1567E2C17' # Alasdair G Kergon <agk@redhat.com> 'D501A478440AE2FD130A1BE8B9112431E509039F') # Marian Csontos <mcsontos@redhat.com> +prepare() { + local _old_build_cmd="setup.py build" \ + _new_build_cmd="-m build --wheel --no-isolation" \ + _old_install_cmd='setup.py install --skip-build --prefix $(pythonprefix)' \ + _new_install_cmd='-m installer --destdir=$(DESTDIR) dist/*.whl' \ + _makefile="${srcdir}/LVM2.${pkgver}/${_py}/Makefile.in" \ + _setup="${srcdir}/LVM2.${pkgver}/${_py}/setup.py.in" + cd "LVM2.${pkgver}" + + sed -i "s%${_old_build_cmd}%${_new_build_cmd}%g" \ + "${_makefile}" + sed -i "s%${_old_install_cmd}%${_new_install_cmd}%g" \ + "${_makefile}" + sed -i "s%${_pkgver}%${pkgver}%g" \ + "${_setup}" +} + build() { local _configure_opts=( '--prefix=/usr' @@ -43,11 +63,16 @@ build() { cd "LVM2.${pkgver}" ./configure "${_configure_opts[@]}" - make python + make "${_py}" } package() { - cd "LVM2.${pkgver}" + local _get_site_packages="import site; print(site.getsitepackages())" + local _site_packages="$("${_py}" -c "${_get_site_packages}")" - make -C python DESTDIR="${pkgdir}" install + cd "LVM2.${pkgver}" + + make -C "${_py}" DESTDIR="${pkgdir}" \ + PYTHON_PATH="${_site_packages}" \ + install } |