Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- SRCDIR=`pwd`
- mkdir -p $SRCDIR/usrfiles
- cd /usr/local/src
- rm -rf minetest-git
- unxz < $SRCDIR/minetest-git.tar.xz | tar xvf -
- chown -R root:wheel minetest-git
- chmod 755 minetest-git
- cd minetest-git
- ## Problem #1 - cmake fails on XDG_APPS_DIR not set
- ## Fixed, use proper cmake flags
- ## Problem #2 - jthread and lua libs not built x86_64, use external built libs
- rm -rf src/lua src/jthread
- patch -b -z .orig src/CMakeLists.txt < $SRCDIR/git/patch.src.CMakeLists.txt
- ## Problem #3a - jthread include files not found in proper place
- ## Fix cmake to find external files
- patch -b -z .orig cmake/Modules/FindJthread.cmake < $SRCDIR/git/patch.FindJthread.cmake
- ## 3b - Fix code includes to look in jthread subdir
- cd src
- for I in ban.cpp ban.h client.cpp client.h debug.h map.h mapblock.h mapsector.cpp \
- mapsector.h profiler.h quicktune.cpp server.cpp settings.h threads.h \
- util/container.h util/thread.h; do
- mv $I $I.orig
- sed 's/#include [<"]jmutex.h[>"]/#include <jthread\/jmutex.h>/' $I.orig |
- sed 's/#include [<"]jmutexautolock.h[>"]/#include <jthread\/jmutexautolock.h>/' |
- sed 's/#include [<"]jthread.h[>"]/#include <jthread\/jthread.h>/' > $I
- done
- cd ..
- ## 3c - stock jthread 1.3.1 uses namespace, add to code where needed
- patch src/debug.h <$SRCDIR/git/patch.debug.h
- patch src/ban.h <$SRCDIR/git/patch.ban.h
- cmake . -DRUN_IN_PLACE=1 -DCUSTOM_XDG_APPS_DIR="$SRCDIR/usrfiles"
- ## Problem #4, link issues, need to load jthread and lua
- for I in src/CMakeFiles/minetest.dir/link.txt \
- src/CMakeFiles/minetestserver.dir/link.txt; do
- cp $I $I.orig
- sed 's/$/ \/usr\/local\/lib\/libjthread.dylib \/opt\/local\/lib\/liblua.dylib/' $I.orig > $I
- done
- make
- exit
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement