Advertisement
karamaz0v

Fixing p4vasp source to install in Arch Linux

Nov 12th, 2012
227
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.48 KB | None | 0 0
  1. #!/bin/bash
  2. ##############################################
  3. ##The script must be executed inside p4vasp-0.3.26/ source folder.
  4. ##All "python" calls will be changed to specifically be "python2" ones.
  5. ##############################################
  6. ##Required packages libx11 mesa libglapi libegl python2 python2-numpy
  7. ## and libgl (only if you're not using nvidia-utils)
  8.  
  9. a=`find ./ -iname '*.py' | xargs head -1  | awk '/python/ { print x }; { x=$2 }' | xargs ls`
  10.  
  11. echo "    "
  12. echo "Correcting in"
  13. echo $a
  14. echo 'header from "/usr/bin/python" to "/usr/bin/python2"'
  15. echo 'or header from "/usr/bin/env python" to "/usr/bin/env python2"'
  16.  
  17.  
  18. for i in $a
  19. do
  20.   sed -i 's/\/usr\/bin\/python/\/usr\/bin\/python2/' $i
  21. done
  22.  
  23.  
  24. sed -i 's/\/usr\/bin\/env python/\/usr\/bin\/env python2/' test/test.py
  25. sed -i 's/\/usr\/bin\/env python/\/usr\/bin\/env python2/' odpdom/setup.py
  26. sed -i 's/\/usr\/bin\/env python/\/usr\/bin\/env python2/' src/fltk-config.py
  27. sed -i 's/\/usr\/bin\/env python/\/usr\/bin\/env python2/' ./p4v.py
  28.  
  29. echo "    "
  30. echo "Printing header corrected "
  31.  
  32. for i in $a
  33. do
  34.   head -1 $i
  35. done
  36.  
  37. ##Fixing makefiles
  38. sed -i 's/python configure.py/python2 configure.py/' Makefile
  39. sed -i 's/python makeappletlist.py/python2 makeappletlist.py/' Makefile
  40. sed -i 's/exec python /exec python2 /' Makefile
  41. sed -i 's/python -c /python2 -c /' odpdom/Makefile
  42. sed -i 's/python fltk-config.py/python2 fltk-config.py/' src/Configuration.mk
  43. sed -i 's/python -c/python2 -c/' src/Configuration.mk
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement