PKGBUILDs/extra/python-setuptools/PKGBUILD

71 lines
2.2 KiB
Bash
Raw Normal View History

2016-04-20 00:41:20 +00:00
# $Id$
# Maintainer: Angel Velasquez <angvp@archlinux.org>
# Maintainer: Felix Yan <felixonmars@archlinux.org>
# ALARM: Kevin Mihelich <kevin@archlinuxarm.org>
# - revert to non-git sources, there's something wrong with building from that
pkgbase=python-setuptools
pkgname=('python-setuptools' 'python2-setuptools')
2016-05-03 01:57:35 +00:00
pkgver=21.0.0
2016-04-26 12:39:46 +00:00
pkgrel=1
2016-04-20 00:41:20 +00:00
epoch=1
pkgdesc="Easily download, build, install, upgrade, and uninstall Python packages"
arch=('any')
license=('PSF')
url="http://pypi.python.org/pypi/setuptools"
makedepends=('python-packaging' 'python2-packaging')
checkdepends=('python-mock' 'python2-mock' 'python-pytest-runner' 'python2-pytest-runner' 'git')
2016-05-03 01:57:35 +00:00
source=("https://pypi.io/packages/source/s/setuptools/setuptools-${pkgver}.tar.gz")
sha512sums=('8490858546ebb5d899ddfac734ad38f7fee8803a72f48d28e8dda654a1dfa080166d161749563203e9bd13711baab6b7bac7e173aa40b9250376365b88b59697')
2016-04-20 00:41:20 +00:00
prepare() {
# We ship separated python{,2}-{packaging,six} packages.
rm -rv setuptools-$pkgver/pkg_resources/_vendor
cp -a setuptools-${pkgver}{,-py2}
cd "$srcdir"/setuptools-$pkgver
sed -i -e "s|^#\!.*/usr/bin/env python|#!/usr/bin/env python3|" setuptools/command/easy_install.py
cd "$srcdir"/setuptools-$pkgver-py2
sed -i -e "s|^#\!.*/usr/bin/env python|#!/usr/bin/env python2|" setuptools/command/easy_install.py
}
build() {
cd "$srcdir"/setuptools-$pkgver
python3 setup.py build
cd "$srcdir"/setuptools-$pkgver-py2
python2 setup.py build
}
check() {
# Workaround UTF-8 tests by setting LC_CTYPE
cd "$srcdir"/setuptools-$pkgver
LC_CTYPE=en_US.utf8 python3 setup.py ptr
cd "$srcdir"/setuptools-$pkgver-py2
LC_CTYPE=en_US.utf8 python2 setup.py ptr
}
package_python-setuptools() {
depends=('python-packaging')
provides=('python-distribute')
replaces=('python-distribute')
cd "$srcdir"/setuptools-$pkgver
python3 setup.py install --prefix=/usr --root="$pkgdir" --optimize=1 --skip-build
}
package_python2-setuptools() {
depends=('python2-packaging')
provides=('python2-distribute' 'setuptools')
replaces=('python2-distribute' 'setuptools')
cd "$srcdir"/setuptools-$pkgver-py2
python2 setup.py install --prefix=/usr --root="$pkgdir" --optimize=1 --skip-build
rm "$pkgdir"/usr/bin/easy_install
}