summaryrefslogtreecommitdiff
path: root/python-pyshortcuts
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2019-02-06 09:15:53 +0100
committerErich Eckner <git@eckner.net>2019-02-06 09:25:09 +0100
commit29add3245cbbb24df03350a621e2803d52e4f120 (patch)
tree42e7227f9903526256ca11bfe416494b0f4ef5c1 /python-pyshortcuts
parent03c046958d029cb8ae17b67c137b20fd0b8d69d2 (diff)
downloadarchlinuxewe.git.save-29add3245cbbb24df03350a621e2803d52e4f120.tar.xz
python-pyshortcuts neu
Diffstat (limited to 'python-pyshortcuts')
-rw-r--r--python-pyshortcuts/PKGBUILD91
1 files changed, 91 insertions, 0 deletions
diff --git a/python-pyshortcuts/PKGBUILD b/python-pyshortcuts/PKGBUILD
new file mode 100644
index 00000000..8c09bb05
--- /dev/null
+++ b/python-pyshortcuts/PKGBUILD
@@ -0,0 +1,91 @@
+# Maintainer: Erich Eckner <arch at eckner dot net>
+
+pkgbase=python-pyshortcuts
+pkgname=('python-pyshortcuts' 'python2-pyshortcuts')
+_pkgname='pyshortcuts'
+pkgver=1.3
+pkgrel=1
+pkgdesc='create desktop shortcuts to python scripts on Windows, Mac, or Linux'
+arch=('any')
+url='https://github.com/newville/pyshortcuts'
+license=('MIT')
+_deppy2=(
+ 'python2>=2.7'
+ 'python2<2.8'
+)
+_deppy=(
+ 'python>=3.7'
+ 'python<3.8'
+)
+_depends=(
+ 'python-six')
+_makedepends=(
+ 'python-setuptools')
+makedepends=(
+ "${_deppy[@]}"
+ "${_deppy2[@]}"
+ "${_depends[@]}"
+ "${_depends[@]/python/python2}"
+ "${_makedepends[@]}"
+ "${_makedepends[@]/python/python2}"
+)
+source=("${_pkgname}-${pkgver}.tar.gz::https://github.com/newville/${_pkgname}/archive/${pkgver}.tar.gz")
+sha512sums=('98273aa874bc0eee987bebb08e072a84207cc0fde3e943c5c202c9e6085eed99c88228a491965dc120effc98f6c5c227b3401009f74f011b6f6145e80a2df067')
+
+prepare() {
+ cd "${srcdir}"
+
+ cp -a "${_pkgname}-${pkgver}" "${pkgname[0]}"
+ mv "${_pkgname}-${pkgver}" "${pkgname[1]}"
+}
+
+build() {
+ cd "${srcdir}/${pkgname[0]}"
+ python setup.py build
+
+ cd "${srcdir}/${pkgname[1]}"
+ python2 setup.py build
+}
+
+package_python-pyshortcuts() {
+ depends=(
+ "${_deppy[@]}"
+ "${_depends[@]}"
+ )
+
+ cd "${srcdir}/${pkgname[0]}"
+ python setup.py install --prefix=/usr --root="${pkgdir}" --optimize=1
+ errors=$(
+ find "${pkgdir}/usr/lib"/python*/site-packages/pyshortcuts-*.egg-info -name 'requires.txt' -execdir cat {} \; \
+ | sed 's/^/python-/' \
+ | grep -vxF "$(printf '%s\n' "${depends[@]}")"
+ ) || true
+ if [ -n "${errors}" ]; then
+ echo 'missing dependencies:'
+ printf '%s\n' "${errors}"
+ return 1
+ fi
+ rm -rf --one-file-system "${pkgdir}/usr/lib"/python*/site-packages/pyshortcuts-*.egg-info "${pkgdir}/usr/bin"
+}
+
+package_python2-pyshortcuts() {
+ depends=(
+ "${_deppy2[@]}"
+ "${_depends[@]/python/python2}"
+ )
+
+ cd "${srcdir}/${pkgname[1]}"
+ python2 setup.py install --prefix=/usr --root="${pkgdir}" --optimize=1
+ errors=$(
+ find "${pkgdir}/usr/lib"/python*/site-packages/pyshortcuts-*.egg-info -name 'requires.txt' -execdir cat {} \; \
+ | sed 's/^/python2-/' \
+ | grep -vxF "$(printf '%s\n' "${depends[@]}")"
+ ) || true
+ if [ -n "${errors}" ]; then
+ echo 'missing dependencies:'
+ printf '%s\n' "${errors}"
+ return 1
+ fi
+ rm -rf --one-file-system "${pkgdir}/usr/lib"/python*/site-packages/pyshortcuts-*.egg-info "${pkgdir}/usr/bin"
+}
+