Similar to https://github.com/Alexpux/MINGW-packages/pull/2878 this adjusts the pkgbase names of all packages to match the directory name the PKGBUILD is in. The motivation for this is to provide links to PKGBUILD sources and git history from the web interface. The "dwz" directory is deleted as it just contains an older copy of the elfutils PKGBUILD (elfutils isn't in the repo)
84 lines
2.5 KiB
Bash
84 lines
2.5 KiB
Bash
# Maintainer: Alexey Pavlov <alexpux@gmail.com>
|
|
|
|
_realname=setuptools
|
|
pkgbase="python-${_realname}"
|
|
pkgname=("python3-${_realname}" "python2-${_realname}")
|
|
pkgver=36.4.0
|
|
pkgrel=2
|
|
pkgdesc="Easily download, build, install, upgrade, and uninstall Python packages"
|
|
arch=('any')
|
|
license=('PSF')
|
|
url="https://pypi.python.org/pypi/setuptools"
|
|
makedepends=('python3-packaging' 'python2-packaging' 'python3-appdirs' 'python2-appdirs' 'python3-pip'
|
|
'python2-pip')
|
|
source=("$_realname-$pkgver.tar.gz::https://github.com/pypa/setuptools/archive/v$pkgver.tar.gz")
|
|
sha512sums=('86bad0c16b7bde4c0a37867db04d76a90a7c968a8926611f4ad26f3d9185b33aa040072ecd7d23540a1434d19a742db3667387d4df975de489b494103b2df0e9')
|
|
|
|
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
|
|
|
|
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
|
|
sed -i -e "s|'pip'|'pip2'|" setuptools/tests/{test_develop.py,test_namespaces.py}
|
|
|
|
export SETUPTOOLS_INSTALL_WINDOWS_SPECIFIC_FILES=0
|
|
}
|
|
|
|
build() {
|
|
# Build python 3 module
|
|
cd "$srcdir"/setuptools-$pkgver
|
|
python3 bootstrap.py
|
|
python3 setup.py build
|
|
|
|
# Build python 2 module
|
|
cd "$srcdir"/setuptools-$pkgver-py2
|
|
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 python3 module
|
|
cd "$srcdir"/setuptools-$pkgver
|
|
python3 setup.py pytest
|
|
|
|
# Check python2 module
|
|
cd "$srcdir"/setuptools-$pkgver-py2
|
|
python2 setup.py pytest
|
|
)}
|
|
|
|
package_python3-setuptools() {
|
|
depends=('python3-packaging' 'python3-appdirs')
|
|
provides=('python3-distribute')
|
|
replaces=('python3-distribute')
|
|
|
|
cd "$srcdir"/setuptools-$pkgver
|
|
python3 setup.py install --prefix=/usr --root="$pkgdir" --optimize=1 --skip-build
|
|
}
|
|
|
|
package_python2-setuptools() {
|
|
depends=('python2-packaging' 'python2-appdirs')
|
|
provides=('python2-distribute')
|
|
replaces=('python2-distribute')
|
|
|
|
cd "$srcdir"/setuptools-$pkgver-py2
|
|
python2 setup.py install --prefix=/usr --root="$pkgdir" --optimize=1 --skip-build
|
|
rm "$pkgdir"/usr/bin/easy_install
|
|
}
|