setuptools: split package into Python 2 and Python 3 versions (#1875)

Also remove all dependencies, setuptools bundles all dependencies
by itself anyway.
This commit is contained in:
Christoph Reiter
2020-02-28 07:35:13 +01:00
committed by GitHub
parent f0bbecd78b
commit 8e911977e8
2 changed files with 68 additions and 37 deletions

View File

@@ -0,0 +1,58 @@
# Maintainer: Alexey Pavlov <alexpux@gmail.com>
_realname=setuptools
pkgbase="python2-${_realname}"
pkgname=("python2-${_realname}")
pkgver=41.6.0
pkgrel=2
pkgdesc="Easily download, build, install, upgrade, and uninstall Python packages"
arch=('any')
license=('PSF')
depends=('python2')
provides=('python2-distribute')
replaces=('python2-distribute')
url="https://pypi.python.org/pypi/setuptools"
source=("${_realname}-${pkgver}.tar.gz::https://github.com/pypa/setuptools/archive/v${pkgver}.tar.gz")
sha512sums=('27dd6762afb7cc5cf302c4086d5142490d90fcba1d4886a6c9d3c7d4bf35cd7670081f103f6f6218b5fdce13a1c461ae7b9d917d0dc60669860e581f1945478a')
prepare() {
# Don't download and install deps
sed -i '/pip.main(args)/d' setuptools-${pkgver}/bootstrap.py
# Remove post-release tag since we are using stable tags
sed -e '/tag_build = .post/d' \
-e '/tag_date = 1/d' \
-i setuptools-${pkgver}/setup.cfg
cd "${srcdir}"/setuptools-${pkgver}
sed -i -e "s|^#\!.*/usr/bin/env python|#!/usr/bin/env python2|" setuptools/command/easy_install.py
sed -i -e "s|'pip'|'pip2'|" setuptools/tests/{test_develop.py,test_namespaces.py}
export SETUPTOOLS_INSTALL_WINDOWS_SPECIFIC_FILES=0
}
build() {
# Build python 2 module
cd "${srcdir}"/setuptools-${pkgver}
python2 bootstrap.py
python2 setup.py build
}
check() { (
# Workaround UTF-8 tests by setting LC_CTYPE
export LC_CTYPE=en_US.UTF-8
# https://github.com/pypa/setuptools/pull/810
export PYTHONDONTWRITEBYTECODE=1
# Check python2 module
# cd "${srcdir}"/setuptools-${pkgver}
# python2 setup.py pytest
)}
package() {
cd "${srcdir}"/setuptools-${pkgver}
python2 setup.py install --prefix=/usr --root="${pkgdir}" --optimize=1 --skip-build
rm "${pkgdir}"/usr/bin/easy_install
}