Advertisement
jar3817

Quetoo MingW Cross Compile

Mar 8th, 2015
231
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 2.19 KB | None | 0 0
  1. #!/bin/sh
  2.  
  3. # building a windows 32bit binary
  4.  
  5. prefix=/build/quetoo-win32
  6. prefix_zip=/build/quetoo
  7. home=/root/quetoo
  8. homedata=/root/quetoo-data
  9. host=i686-w64-mingw32
  10. today=`date +%Y%m%d`
  11. physfs_path=/usr/x86_64-w64-mingw32/sys-root/mingw
  12. script_pwd=`pwd`
  13.  
  14.  
  15. # make sure we have all the latest commits
  16. cd $homedata
  17. git pull origin master
  18. cd $script_pwd
  19.  
  20.  
  21. # remove icon resources
  22. rm -f $home/src/tools/quemap/quemap.res
  23. rm -f $home/src/main/quetoo.res
  24. rm -f icons/quetoo-launcher.res
  25.  
  26.  
  27. # compile the resource files for the icons
  28. $host-windres icons/quemap.rc -O coff -o $home/src/tools/quemap/quemap.res || exit 1
  29. $host-windres icons/quetoo.rc -O coff -o $home/src/main/quetoo.res || exit 1
  30. $host-windres icons/quetoo-launch.rc -O coff -o icons/quetoo-launch.res || exit 1
  31.  
  32.  
  33. # make finding libraries and headers easier
  34. export PKG_CONFIG_PATH=/usr/i686-w64-mingw32/sys-root/mingw/lib/pkgconfig
  35.  
  36.  
  37. # build the actual programs
  38. cd $home
  39. hash=`git log --pretty=format:'%h' -n 1`
  40. make clean
  41. autoreconf --force -i || exit 1
  42. ./configure --host=$host --prefix=$prefix --with-physfs=$physfs_path --without-mysql || exit 1
  43. cd $home/src/main
  44. sed -i '/quetoo$(EXEEXT):/{N;N;s/$/ quetoo.res/}' Makefile || exit 1
  45. cd $home/src/tools/quemap
  46. sed -i '/quemap$(EXEEXT):/{N;N;s/$/ quemap.res/}' Makefile || exit 1
  47. cd $home
  48. make -j2 || exit 1
  49. make install || exit 1
  50.  
  51.  
  52. # copy the update script and rsync
  53. cp $home/mingw-cross/quetoo-i686/update.bat $prefix
  54. cp $home/mingw-cross/quetoo-i686/bin/rsync.exe $prefix/bin
  55.  
  56.  
  57. # copy the DLLs
  58. cp $script_pwd/dlls/* $prefix/bin
  59.  
  60.  
  61. # add game data if not present (usually won't be)
  62. if [ ! -d $prefix/share ]; then
  63.         cp -R $homedata/target $prefix/share
  64.         cp $homedata/src/default/map-* $prefix/share/default
  65. fi
  66.  
  67.  
  68. # build the launcher
  69. $host-gcc -o $prefix/quetoo-launch.exe $script_pwd/quetoo-launch.c $script_pwd/icons/quetoo-launch.res || exit 1
  70.  
  71.  
  72. # create the whole bundle
  73. mv $prefix $prefix_zip
  74. cd $prefix_zip
  75. zip -r ../quetoo-win32-$today-$hash.zip ./*
  76. cd $home
  77. mv $prefix_zip $prefix
  78.  
  79.  
  80. # send to server for downloads
  81. rsync --progress -avz -e ssh $prefix/../quetoo*.zip root@quetoo.packetflinger.com:/var/www/quetoo.packetflinger.com/dl
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement