mirror of
https://gitdl.cn/https://github.com/chakralinux/desktop.git
synced 2025-01-23 18:14:51 +08:00
59 lines
1.9 KiB
Bash
59 lines
1.9 KiB
Bash
|
pkgbase=python-setuptools-scm
|
||
|
pkgname=(python3-setuptools-scm python2-setuptools-scm)
|
||
|
pkgver=1.15.6
|
||
|
pkgrel=1
|
||
|
pkgdesc="Handles managing your python package versions in scm metadata."
|
||
|
arch=('any')
|
||
|
url="https://github.com/pypa/setuptools_scm"
|
||
|
license=('MIT')
|
||
|
makedepends=('python3-setuptools' 'python2-setuptools')
|
||
|
checkdepends=('python3-pytest' 'python2-pytest' 'mercurial' 'git' 'python3-pip' 'python2-pip')
|
||
|
source=("$pkgbase-$pkgver.tar.gz::https://github.com/pypa/setuptools_scm/archive/v$pkgver.tar.gz")
|
||
|
sha512sums=('c97669232a492e19bdb073c48f9e792ee029ee2af2191da65461436e2a66a3adf5ad490f0a1429c33a5574d4afeb0d54afedfe78f581fff890ecfc787d08ef5a')
|
||
|
|
||
|
prepare() {
|
||
|
cp -a setuptools_scm-$pkgver{,-py2}
|
||
|
|
||
|
export SETUPTOOLS_SCM_PRETEND_VERSION=$pkgver
|
||
|
}
|
||
|
|
||
|
build() {
|
||
|
cd "$srcdir"/setuptools_scm-$pkgver
|
||
|
python3 setup.py build
|
||
|
python3 setup.py egg_info
|
||
|
|
||
|
cd "$srcdir"/setuptools_scm-$pkgver-py2
|
||
|
python2 setup.py build
|
||
|
python2 setup.py egg_info
|
||
|
}
|
||
|
rm
|
||
|
check() {
|
||
|
# Hack entry points by installing it
|
||
|
|
||
|
cd "$srcdir"/setuptools_scm-$pkgver
|
||
|
python3 setup.py install --root="$PWD/tmp_install" --optimize=1
|
||
|
SETUPTOOLS_SCM_PRETEND_VERSION= PYTHONPATH="$PWD/tmp_install/usr/lib/python3.6/site-packages:$PYTHONPATH" py.test
|
||
|
|
||
|
cd "$srcdir"/setuptools_scm-$pkgver-py2
|
||
|
python2 setup.py install --root="$PWD/tmp_install" --optimize=1
|
||
|
SETUPTOOLS_SCM_PRETEND_VERSION= PYTHONPATH="$PWD/tmp_install/usr/lib/python2.7/site-packages:$PYTHONPATH" py.test2
|
||
|
}
|
||
|
|
||
|
package_python3-setuptools-scm() {
|
||
|
depends=('python3-setuptools')
|
||
|
|
||
|
cd "$srcdir"/setuptools_scm-$pkgver
|
||
|
python3 setup.py install --root "$pkgdir"
|
||
|
|
||
|
install -Dm644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
|
||
|
}
|
||
|
|
||
|
package_python2-setuptools-scm() {
|
||
|
depends=('python2-setuptools')
|
||
|
|
||
|
cd "$srcdir"/setuptools_scm-$pkgver-py2
|
||
|
python2 setup.py install --root "$pkgdir"
|
||
|
|
||
|
install -Dm644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
|
||
|
}
|