OCaml 4.14.0 rebuild
[arch-packages.git] / python2-setuptools / repos / extra-any / PKGBUILD
blob55c91dc408905e7fd1243fae67fa5b5a2b665c03
1 # Maintainer: Angel Velasquez <angvp@archlinux.org>
2 # Maintainer: Felix Yan <felixonmars@archlinux.org>
3 # Contributor: Eli Schwartz <eschwartz@archlinux.org>
5 pkgname=python2-setuptools
6 pkgver=44.1.1
7 pkgrel=1
8 epoch=2
9 pkgdesc="Easily download, build, install, upgrade, and uninstall Python packages"
10 arch=('any')
11 license=('PSF')
12 url="https://pypi.org/project/setuptools/"
13 depends=('python2-appdirs' 'python2-packaging' 'python2-ordered-set')
14 makedepends=('git')
15 provides=('python2-distribute')
16 replaces=('python2-distribute')
17 source=("$pkgname-$pkgver.tar.gz::https://github.com/pypa/setuptools/archive/v$pkgver.tar.gz")
18 sha512sums=('aabddfbd62b95ce7d8e68d582362361d32b91e65e6d00c393593521a2c1c383552e324ae64974049ae9880072c8741e2393e6482cd07ff7dd30615e91e9e1450')
20 export SETUPTOOLS_INSTALL_WINDOWS_SPECIFIC_FILES=0
22 prepare() {
23   rm -r setuptools-$pkgver/{pkg_resources,setuptools}/{extern,_vendor}
25   # Upstream devendoring logic is badly broken, see:
26   # https://bugs.archlinux.org/task/58670
27   # https://github.com/pypa/pip/issues/5429
28   # https://github.com/pypa/setuptools/issues/1383
29   # The simplest fix is to simply rewrite import paths to use the canonical
30   # location in the first place
31   for _module in setuptools pkg_resources '' ; do
32       find setuptools-$pkgver -name \*.py -exec sed -i \
33           -e 's/from '$_module.extern' import/import/' \
34           -e 's/from '$_module.extern'./from /' \
35           -e 's/import '$_module.extern'./import /' \
36           -e "s/__import__('$_module.extern./__import__('/" \
37           {} +
38     done
40   # Remove post-release tag since we are using stable tags
41   sed -e '/tag_build = .post/d' \
42       -e '/tag_date = 1/d' \
43       -i setuptools-$pkgver/setup.cfg
45   cd "$srcdir"/setuptools-$pkgver
46   sed -i -e "s|^#\!.*/usr/bin/env python|#!/usr/bin/env python2|" setuptools/command/easy_install.py
49 build() {
50   cd setuptools-$pkgver
51   python2 bootstrap.py
52   python2 setup.py build
55 package() {
56   cd setuptools-$pkgver
57   python2 setup.py install --prefix=/usr --root="$pkgdir" --optimize=1 --skip-build
58   rm "$pkgdir"/usr/bin/easy_install