mirror of
https://gitdl.cn/https://github.com/chakralinux/core.git
synced 2025-02-11 17:44:38 +08:00
98 lines
3.4 KiB
Bash
98 lines
3.4 KiB
Bash
#
|
|
# Software packages for Chakra, part of www.chakraos.org
|
|
#
|
|
# Maintainer: H W Tovetjärn (totte) <totte@tott.es>
|
|
# Contributors: A Velasquez <angvp@archlinux.org>
|
|
|
|
pkgbase=python-setuptools
|
|
pkgname=('python3-setuptools' 'python2-setuptools')
|
|
pkgver=36.6.0
|
|
pkgrel=1
|
|
pkgdesc="Easily download, build, install, upgrade, and uninstall Python packages"
|
|
arch=('any')
|
|
license=('PSF')
|
|
url="http://pypi.python.org/pypi/setuptools"
|
|
makedepends=('python3-packaging' 'python2-packaging' 'python3-appdirs' 'python2-appdirs' 'python3-pip'
|
|
'python2-pip' 'python2-six' 'python3-six' 'python2-appdirs' 'python3-appdirs')
|
|
#checkdepends=('python3-mock' 'python2-mock')
|
|
source=("$pkgbase-$pkgver.tar.gz::https://github.com/pypa/setuptools/archive/v$pkgver.tar.gz")
|
|
md5sums=('fa7051421f1e27c61f84067c5a86ca5e')
|
|
|
|
prepare() {
|
|
# Don't download and install deps
|
|
sed -i '/pip.main(args)/d' setuptools-$pkgver/bootstrap.py
|
|
|
|
rm -r setuptools-$pkgver/pkg_resources/_vendor
|
|
|
|
# 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
|
|
|
|
# 'Clean' installation is expected to fail since we removed bundled packages
|
|
sed -i '/^def test_clean_env_install/i import pytest\n\n@pytest.mark.xfail' setuptools-$pkgver/setuptools/tests/test_virtualenv.py
|
|
|
|
# Tests failed. Importing an unbundled new setuptools in a virtualenv does not work, but this won't
|
|
# affect normal virtualenv usage (which don't have to import the unbundled setuptools in *current*
|
|
# dir.
|
|
sed -e '/^def test_pip_upgrade_from_source/i @pytest.mark.xfail' \
|
|
-e '/^def test_test_command_install_requirements/i @pytest.mark.xfail' \
|
|
-i setuptools-$pkgver/setuptools/tests/test_virtualenv.py
|
|
|
|
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() {
|
|
cd "$srcdir"/setuptools-$pkgver
|
|
python3 bootstrap.py
|
|
python3 setup.py build
|
|
|
|
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
|
|
#
|
|
# cd "$srcdir"/setuptools-$pkgver
|
|
# python3 setup.py pytest
|
|
#
|
|
# cd "$srcdir"/setuptools-$pkgver-py2
|
|
# python2 setup.py pytest
|
|
#}
|
|
|
|
package_python3-setuptools() {
|
|
depends=('python3-packaging' 'python3-appdirs')
|
|
provides=('python3-distribute')
|
|
conflicts=('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=('python-distribute' 'python2-distribute')
|
|
conflicts=('python-distribute' 'python2-distribute')
|
|
replaces=('python-distribute' '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"
|
|
}
|