Advertisement
Drommer

python2-chardet PKGBUILD

Oct 18th, 2022
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.22 KB | Software | 0 0
  1. # Contributor: Marcell Meszaros < marcell.meszaros AT runbox.eu >
  2. # Contributor: Felix Yan <[email protected]>
  3. # Contributor: Ionut Biru <[email protected]>
  4. # Contributor: William Rea <[email protected]>
  5. # Contributor: Drommer <[email protected]>
  6.  
  7. _pkgname=chardet
  8. pkgname=python2-chardet
  9. pkgver=4.0.0
  10. pkgrel=1
  11. pkgdesc='Python 2 module for character encoding auto-detection'
  12. arch=('any')
  13. url="https://pypi.org/project/chardet"
  14. license=('LGPL')
  15. depends=('python2')
  16. makedepends=('python2-setuptools')
  17. source=("https://github.com/${_pkgname}/${_pkgname}/archive/refs/tags/${pkgver}.tar.gz")
  18. sha256sums=('67bbe3eb02691d38831ddf2719c40fe09381bc17f15321946f6cd71dc274e530')
  19.  
  20. prepare() {
  21. cd ${_pkgname}-${pkgver}
  22. sed -e 's|#![ ]*/usr/bin/python$|#!/usr/bin/python2|' \
  23. -e 's|#![ ]*/usr/bin/env python$|#!/usr/bin/env python2|' \
  24. -e 's|#![ ]*/bin/env python$|#!/usr/bin/env python2|' \
  25. -i $(find . -name '*.py')
  26. }
  27.  
  28. build() {
  29. cd ${_pkgname}-${pkgver}
  30. python2 setup.py build
  31. }
  32.  
  33. package() {
  34. cd ${_pkgname}-${pkgver}
  35. python2 setup.py install --root="${pkgdir}" --optimize=1
  36. # To avoid file conflict with the python3 version
  37. mv "${pkgdir}/usr/bin/chardetect"{,-py2}
  38. }
  39.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement