# Maintainer: Sam # Contributor: Mark Wagie # shellcheck disable=2034,2148,2154 pkgname=pyinstaller-hooks-contrib _pkgname=pyinstaller-hooks-contrib pkgver=2022.9 pkgrel=1 pkgdesc="Community maintained hooks for PyInstaller" arch=('any') url="https://github.com/pyinstaller/pyinstaller-hooks-contrib" license=('custom:PyInstaller') makedepends=("python-pip") _pkgname_prefix="${_pkgname:0:1}" _pkgname_underscored="${_pkgname//-/_}" _py="py2.py3" _py_hosted_url="https://files.pythonhosted.org/packages/$_py" _pkg_whlname="$_pkgname_underscored-$pkgver-$_py-none-any.whl" source=("$_py_hosted_url/$_pkgname_prefix/$_pkgname/$_pkg_whlname") sha512sums=('a75702605fefc4c7c67e152f18d8affda65cc6cbf83aa42dffec53fb7a0826020791edcbddeafbde58e7df1f6442bea7b8b5a598e6bca2e159221e4a3cbdcb9b') package() { cd "$srcdir" || exit PIP_CONFIG_FILE=/dev/null pip install \ --root="$pkgdir" \ --isolated \ --ignore-installed \ --no-deps \ --no-compile \ --no-warn-script-location \ "${_pkg_whlname}" python -O -m compileall -s "$pkgdir" "$pkgdir/usr/lib/" mapfile -t direct_url_file < <(find "$pkgdir"/usr/lib -type f -name 'direct_url.json') rm -rvf "${direct_url_file[@]}" || true install -Dm644 "${_pkgname//-/_}-$pkgver.dist-info/LICENSE" "$pkgdir/usr/share/licenses/$pkgname/LICENSE" install -Dm644 "${_pkgname//-/_}-$pkgver.dist-info/LICENSE.GPL.txt" "$pkgdir/usr/share/licenses/$pkgname/LICENSE.GPL.txt" install -Dm644 "${_pkgname//-/_}-$pkgver.dist-info/LICENSE.APL.txt" "$pkgdir/usr/share/licenses/$pkgname/LICENSE.APL.txt" }