mirror of
https://github.com/void-linux/void-packages.git
synced 2025-06-07 07:33:48 +02:00
python-chardet: use alternatives
This commit is contained in:
parent
a03e7c267f
commit
e11f2bf9b9
1 changed files with 7 additions and 33 deletions
|
@ -1,13 +1,13 @@
|
||||||
# Template file for 'python-chardet'
|
# Template file for 'python-chardet'
|
||||||
pkgname=python-chardet
|
pkgname=python-chardet
|
||||||
version=2.3.0
|
version=2.3.0
|
||||||
revision=1
|
revision=2
|
||||||
noarch=yes
|
noarch=yes
|
||||||
wrksrc="chardet-${version}"
|
wrksrc="chardet-${version}"
|
||||||
build_style="python-module"
|
build_style=python-module
|
||||||
python_versions="2.7 3.4"
|
python_versions="2.7 3.4"
|
||||||
hostmakedepends="python-setuptools python3.4-setuptools"
|
hostmakedepends="python-setuptools python3.4-setuptools"
|
||||||
depends="python"
|
depends="python-setuptools"
|
||||||
pycompile_module="chardet"
|
pycompile_module="chardet"
|
||||||
short_desc="Universal encoding detector for Python 2 and 3 (Python2)"
|
short_desc="Universal encoding detector for Python 2 and 3 (Python2)"
|
||||||
maintainer="Alessio Sergi <al3hex@gmail.com>"
|
maintainer="Alessio Sergi <al3hex@gmail.com>"
|
||||||
|
@ -15,43 +15,17 @@ homepage="https://github.com/chardet/chardet"
|
||||||
license="LGPL-2.1"
|
license="LGPL-2.1"
|
||||||
distfiles="${PYPI_SITE}/c/chardet/chardet-${version}.tar.gz"
|
distfiles="${PYPI_SITE}/c/chardet/chardet-${version}.tar.gz"
|
||||||
checksum=e53e38b3a4afe6d1132de62b7400a4ac363452dc5dfcf8d88e8e0cce663c68aa
|
checksum=e53e38b3a4afe6d1132de62b7400a4ac363452dc5dfcf8d88e8e0cce663c68aa
|
||||||
|
alternatives="chardet:chardetect:/usr/bin/chardetect2.7"
|
||||||
post_extract() {
|
|
||||||
cp -a ${wrksrc} /tmp/python2.7-build
|
|
||||||
cp -a ${wrksrc} /tmp/python3.4-build
|
|
||||||
mv /tmp/python{2.7,3.4}-build ${wrksrc}
|
|
||||||
}
|
|
||||||
|
|
||||||
pre_build() {
|
|
||||||
cd ${wrksrc}/python3.4-build
|
|
||||||
sed -i 's,chardetect ,chardetect3 ,' setup.py
|
|
||||||
sed -i 's,#!/usr/bin/env python,&3.4,' chardet/chardetect.py
|
|
||||||
}
|
|
||||||
|
|
||||||
do_build() {
|
|
||||||
cd ${wrksrc}/python2.7-build
|
|
||||||
python setup.py build
|
|
||||||
|
|
||||||
cd ${wrksrc}/python3.4-build
|
|
||||||
python3.4 setup.py build
|
|
||||||
}
|
|
||||||
|
|
||||||
do_install() {
|
|
||||||
cd ${wrksrc}/python2.7-build
|
|
||||||
python setup.py install --root=${DESTDIR}
|
|
||||||
|
|
||||||
cd ${wrksrc}/python3.4-build
|
|
||||||
python3.4 setup.py install --root=${DESTDIR}
|
|
||||||
}
|
|
||||||
|
|
||||||
python3.4-chardet_package() {
|
python3.4-chardet_package() {
|
||||||
noarch=yes
|
noarch=yes
|
||||||
depends="python3.4"
|
depends="python3.4-setuptools"
|
||||||
pycompile_version="3.4"
|
pycompile_version="3.4"
|
||||||
pycompile_module="chardet"
|
pycompile_module="chardet"
|
||||||
short_desc="${short_desc/Python2/Python3.4}"
|
short_desc="${short_desc/Python2/Python3.4}"
|
||||||
|
alternatives="chardet:chardetect:/usr/bin/chardetect3.4"
|
||||||
pkg_install() {
|
pkg_install() {
|
||||||
vmove usr/bin/chardetect3
|
vmove usr/bin/chardetect3.4
|
||||||
vmove usr/lib/python3.4
|
vmove usr/lib/python3.4
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue