git » python-pyelftools.git » main » tree

[main] / PKGBUILD

# Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>
# Maintainer: Rémy Oudompheng <remy@archlinux.org>

pkgname=python-pyelftools
_pkgname=pyelftools
pkgver=0.31
pkgrel=3
pkgdesc='Python library for analyzing ELF files and DWARF debugging information'
url='https://github.com/eliben/pyelftools'
arch=('any')
license=('custom:Public Domain')
depends=('python')
makedepends=('python-build' 'python-installer' 'python-wheel' 'python-setuptools')
options=('!strip')
source=(https://github.com/eliben/${_pkgname}/archive/v${pkgver}/${_pkgname}-${pkgver}.tar.gz)
sha512sums=('7f4ef37da7fda75125cb95ced2f3084848943592eff7deae7ae917508f1cd5281c96960ee3bbc6e503e71a4e2196622cd68cc67e3df1f4cd99b9b675f14fd58c')
b2sums=('9e5a1e0a7b9292b30db7331e18c5c800f84eb087b58b266f3f23a7c9c5e7ea655f913788495e1df04e79c9f0a82789cad58ee2dcd8a0afb17e696d4c58679f33')


build() {
  cd ${_pkgname}-${pkgver}
  python -m build --wheel --no-isolation
}

#check() {
#  cd ${_pkgname}-${pkgver}
#  python test/run_all_unittests.py
#  python test/run_examples_test.py
#  if [ "${CARCH}" == "x86_64" ]; then
#    python test/run_readelf_tests.py
#  else
#    echo "Skipping readelf tests (require x86_64)"
#  fi
#}

package() {
  cd ${_pkgname}-${pkgver}
  python -m installer --destdir="${pkgdir}" dist/*.whl
  install -Dm 644 LICENSE -t "${pkgdir}/usr/share/licenses/${pkgname}"
  install -Dm 644 README.rst CHANGES -t "${pkgdir}/usr/share/doc/${pkgname}"
  cp -r examples "${pkgdir}/usr/share/doc/${pkgname}"
}