python-nvchecker: 2.7 (new-package)

This commit is contained in:
Mehdi Chinoune
2022-03-31 10:40:02 +01:00
parent f22cf46103
commit c3de2f6749

View File

@@ -0,0 +1,69 @@
# Contributor: Mehdi Chinoune <mehdi.chinoune@hotmail.com>
_realname=nvchecker
pkgbase=mingw-w64-python-${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-python-${_realname}")
pkgver=2.7
pkgrel=1
pkgdesc="New version checker for software releases (mingw-w64)"
arch=('any')
mingw_arch=('mingw64' 'mingw32' 'ucrt64' 'clang64')
url="https://github.com/lilydjwg/nvchecker"
license=('MIT')
depends=("${MINGW_PACKAGE_PREFIX}-python"
"${MINGW_PACKAGE_PREFIX}-python-tomli"
"${MINGW_PACKAGE_PREFIX}-python-structlog"
"${MINGW_PACKAGE_PREFIX}-python-appdirs"
"${MINGW_PACKAGE_PREFIX}-python-tornado"
"${MINGW_PACKAGE_PREFIX}-python-pycurl")
makedepends=("${MINGW_PACKAGE_PREFIX}-python-docutils"
"${MINGW_PACKAGE_PREFIX}-python-setuptools"
"${MINGW_PACKAGE_PREFIX}-python-pygments"
"${MINGW_PACKAGE_PREFIX}-python-sphinx")
checkdepends=("${MINGW_PACKAGE_PREFIX}-python-pytest"
"${MINGW_PACKAGE_PREFIX}-python-pytest-asyncio"
"${MINGW_PACKAGE_PREFIX}-python-pytest-httpbin"
"${MINGW_PACKAGE_PREFIX}-python-flaky"
"${MINGW_PACKAGE_PREFIX}-python-lxml")
optdepends=("${MINGW_PACKAGE_PREFIX}-python-lxml: for the htmlparser source"
"${MINGW_PACKAGE_PREFIX}-python-packaging: for the pypi source"
"${MINGW_PACKAGE_PREFIX}-python-gobject: for nvchecker-notify"
"${MINGW_PACKAGE_PREFIX}-libnotify: for nvchecker-notify"
"git: support for git repositories")
source=("https://github.com/lilydjwg/nvchecker/archive/v${pkgver}.tar.gz")
sha256sums=('ca09fcee79b6bf7a7b754b36730172aba7eaa6e2d05d8ab1e5582a635afa51c3')
build() {
cp -r "${_realname}-${pkgver}" "python-build-${MSYSTEM}" && cd "python-build-${MSYSTEM}"
"${MINGW_PREFIX}"/bin/python setup.py build
}
check() {
cd "${srcdir}/python-build-${MSYSTEM}"
"${MINGW_PREFIX}"/bin/python setup.py check
}
package() {
cd "${srcdir}/python-build-${MSYSTEM}"
MSYS2_ARG_CONV_EXCL="--prefix=;--install-scripts=;--install-platlib=" \
"${MINGW_PREFIX}"/bin/python setup.py install --prefix="${MINGW_PREFIX}" \
--root="${pkgdir}" --optimize=1 --skip-build
install -Dm644 LICENSE -t "$pkgdir"${MINGW_PREFIX}/share/licenses/$_realname
for _f in "${pkgdir}${MINGW_PREFIX}"/bin/*-script.py; do
# Remove shebang line
sed -e '1 { s/^#!.*$// }' -i "${_f}"
done
for _f in ini2toml notify; do
# Remove shebang line
sed -e '1 { s/^#!.*$// }' -i "${pkgdir}${MINGW_PREFIX}/bin/nvchecker-${_f}"
done
# Docs
install -Dm644 docs/usage.rst -t "$pkgdir"${MINGW_PREFIX}/share/doc/$_realname/
install -Dm644 sample_config.toml -t "$pkgdir"${MINGW_PREFIX}/share/doc/$_realname/
}