yochananmarqos

python-pysvn

Nov 7th, 2021 (edited)
814
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.47 KB | None | 0 0
  1. pkgname=python-pysvn
  2. _name=${pkgname#python-}
  3. pkgver=1.9.16
  4. pkgrel=1
  5. pkgdesc="The Pythonic interface to Subversion"
  6. arch=('x86_64')
  7. url="https://pysvn.sourceforge.io"
  8. license=('Apache')
  9. depends=('apr' 'python' 'subversion')
  10. makedepends=('python-pycxx' 'python-setuptools')
  11. provides=("_${_name}.so")
  12. source=("https://downloads.sourceforge.net/project/pysvn/pysvn/V$pkgver/$_name-$pkgver.tar.gz")
  13. sha256sums=('20fbd5ab66d38997e691f088af2b8d74be1994206afb81026198fc5424a42e0e')
  14.  
  15. prepare() {
  16.   cd "$_name-$pkgver"
  17.  
  18.   # Remove bundled libs
  19.   rm -rf Import
  20. }
  21.  
  22. build() {
  23.   cd "$_name-$pkgver"
  24.  
  25.   pushd Source
  26.   python setup.py configure --verbose --fixed-module-name --norpath
  27.  
  28.   sed -i "s/-Wall -fPIC -fexceptions -frtti/${CXXFLAGS} -fPIC -frtti/g" Makefile
  29.   make
  30.   popd
  31. }
  32.  
  33. check() {
  34.   cd "$_name-$pkgver"
  35.  
  36.   pushd Tests
  37.   # the tests expect a valid answer from locale.getdefaultlocale()
  38.   # C.UTF-8 does not work. Use en_US.utf-8.
  39.   LC_ALL=en_US.UTF-8 make
  40.   popd
  41. }
  42.  
  43. package() {
  44.   cd "$_name-$pkgver"
  45.   python setup.py install --root="$pkgdir/" --optimize=1 --skip-build
  46.  
  47.   local site_packages=$(python -c "import site; print(site.getsitepackages()[0])")
  48.  
  49.   # Fixed module name
  50.   sed -i "s/_${_name}_3_9/_${_name}/g" \
  51.     "$pkgdir$site_packages/$_name-$pkgver-py3.9.egg-info/top_level.txt"
  52.  
  53.   install -Dm644 "Source/$_name/__init__.py" -t "$pkgdir$site_packages/$_name/"
  54.   install -Dm644 "Source/$_name/_${_name}.so" -t "$pkgdir$site_packages/$_name/"
  55. }
Add Comment
Please, Sign In to add comment