aboutsummaryrefslogtreecommitdiffstats
path: root/main/py-flake8/APKBUILD
diff options
context:
space:
mode:
Diffstat (limited to 'main/py-flake8/APKBUILD')
-rw-r--r--main/py-flake8/APKBUILD58
1 files changed, 58 insertions, 0 deletions
diff --git a/main/py-flake8/APKBUILD b/main/py-flake8/APKBUILD
new file mode 100644
index 0000000000..57450d4fc7
--- /dev/null
+++ b/main/py-flake8/APKBUILD
@@ -0,0 +1,58 @@
+# Contributor: Peter Bui <pnutzh4x0r@gmail.com>
+# Maintainer: Fabian Affolter <fabian@affolter-engineering.ch>
+pkgname=py-flake8
+_pkgname=${pkgname#py-}
+pkgver=3.4.1
+pkgrel=0
+pkgdesc="A modular source code checker"
+url="https://gitlab.com/pycqa/flake8"
+arch="noarch"
+license="MIT"
+depends="py-mccabe py-pep8 py-pyflakes"
+makedepends="python2-dev python3-dev py-setuptools"
+subpackages="py2-${pkgname#py-}:_py2 py3-${pkgname#py-}:_py3"
+options="!check" #no testsuite
+source="https://pypi.io/packages/source/f/$_pkgname/$_pkgname-$pkgver.tar.gz"
+builddir="$srcdir/$_pkgname-$pkgver"
+
+build() {
+ cd "$builddir"
+ python2 setup.py build
+ python3 setup.py build
+}
+
+package() {
+ cd "$builddir"
+ mkdir -p "$pkgdir"/usr/bin
+}
+
+_py2() {
+ replaces=flake8
+ provides="flake8-$pkgver-r$pkgrel"
+ depends="${depends//py-/py2-}"
+ _py python2
+}
+
+_py3() {
+ depends="${depends//py-/py3-}"
+ _py python3
+}
+
+_py() {
+ local python="$1"
+ local pyver="${1:6:1}"
+ pkgdesc="$pkgdesc (for $python)"
+ depends="$depends $python"
+ install_if="$pkgname=$pkgver-r$pkgrel $python"
+
+ cd "$builddir"
+ $python setup.py --quiet install --prefix=/usr --root="$subpkgdir"
+ #Add version suffix to executable files.
+ local path; for path in "$subpkgdir"/usr/bin/*; do
+ mv -f "$path" "${path%%}"
+ mv -f "${path%%}" "${path%%}-$pyver"
+ done
+}
+
+
+sha512sums="42df8fa0cf6f4bb4f3e52143028dee14d51a645aef19a0bab05000fef577e5bea3cc29f961acb0c98d92b76e635fdd2f0d689e23663a6c14d435d0410be94c87 flake8-3.4.1.tar.gz"