Advertisement
Guest User

instmtg

a guest
Jan 20th, 2013
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.69 KB | None | 0 0
  1. #!/bin/sh
  2.  
  3. SRCDIR=`pwd`
  4.  
  5. mkdir -p $SRCDIR/usrfiles
  6.  
  7. cd /usr/local/src
  8.  
  9. rm -rf minetest-git
  10.  
  11. unxz < $SRCDIR/minetest-git.tar.xz | tar xvf -
  12. chown -R root:wheel minetest-git
  13. chmod 755 minetest-git
  14. cd minetest-git
  15.  
  16. ## Problem #1 - cmake fails on XDG_APPS_DIR not set
  17. ## Fixed, use proper cmake flags
  18.  
  19. ## Problem #2 - jthread and lua libs not built x86_64, use external built libs
  20. rm -rf src/lua src/jthread
  21. patch -b -z .orig src/CMakeLists.txt < $SRCDIR/git/patch.src.CMakeLists.txt
  22.  
  23. ## Problem #3a - jthread include files not found in proper place
  24. ## Fix cmake to find external files
  25. patch -b -z .orig cmake/Modules/FindJthread.cmake < $SRCDIR/git/patch.FindJthread.cmake
  26.  
  27. ## 3b - Fix code includes to look in jthread subdir
  28. cd src
  29. for I in ban.cpp ban.h client.cpp client.h debug.h map.h mapblock.h mapsector.cpp \
  30. mapsector.h profiler.h quicktune.cpp server.cpp settings.h threads.h \
  31. util/container.h util/thread.h; do
  32. mv $I $I.orig
  33. sed 's/#include [<"]jmutex.h[>"]/#include <jthread\/jmutex.h>/' $I.orig |
  34. sed 's/#include [<"]jmutexautolock.h[>"]/#include <jthread\/jmutexautolock.h>/' |
  35. sed 's/#include [<"]jthread.h[>"]/#include <jthread\/jthread.h>/' > $I
  36. done
  37. cd ..
  38.  
  39. ## 3c - stock jthread 1.3.1 uses namespace, add to code where needed
  40. patch src/debug.h <$SRCDIR/git/patch.debug.h
  41. patch src/ban.h <$SRCDIR/git/patch.ban.h
  42.  
  43. cmake . -DRUN_IN_PLACE=1 -DCUSTOM_XDG_APPS_DIR="$SRCDIR/usrfiles"
  44.  
  45. ## Problem #4, link issues, need to load jthread and lua
  46. for I in src/CMakeFiles/minetest.dir/link.txt \
  47. src/CMakeFiles/minetestserver.dir/link.txt; do
  48. cp $I $I.orig
  49. sed 's/$/ \/usr\/local\/lib\/libjthread.dylib \/opt\/local\/lib\/liblua.dylib/' $I.orig > $I
  50. done
  51.  
  52. make
  53.  
  54. exit
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement