buildwin64.sh 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. #!/bin/bash
  2. set -e
  3. dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
  4. if [ $# -ne 1 ]; then
  5. echo "Usage: $0 <build directory>"
  6. exit 1
  7. fi
  8. builddir=$1
  9. mkdir -p $builddir
  10. builddir="$( cd "$builddir" && pwd )"
  11. packagedir=$builddir/packages
  12. libdir=$builddir/libs
  13. toolchain_file=$dir/toolchain_mingw64.cmake
  14. irrlicht_version=1.8.1
  15. ogg_version=1.3.1
  16. vorbis_version=1.3.4
  17. curl_version=7.38.0
  18. gettext_version=0.18.2
  19. freetype_version=2.5.3
  20. sqlite3_version=3.8.7.4
  21. luajit_version=2.0.3
  22. leveldb_version=1.15
  23. zlib_version=1.2.8
  24. mkdir -p $packagedir
  25. mkdir -p $libdir
  26. cd $builddir
  27. # Get stuff
  28. [ -e $packagedir/irrlicht-$irrlicht_version.zip ] || wget http://sfan5.pf-control.de/irrlicht-$irrlicht_version-win64.zip \
  29. -c -O $packagedir/irrlicht-$irrlicht_version.zip
  30. [ -e $packagedir/zlib-$zlib_version.zip ] || wget http://sfan5.pf-control.de/zlib-$zlib_version-win64.zip \
  31. -c -O $packagedir/zlib-$zlib_version.zip
  32. [ -e $packagedir/libogg-$ogg_version.zip ] || wget http://sfan5.pf-control.de/libogg-$ogg_version-win64.zip \
  33. -c -O $packagedir/libogg-$ogg_version.zip
  34. [ -e $packagedir/libvorbis-$vorbis_version.zip ] || wget http://sfan5.pf-control.de/libvorbis-$vorbis_version-win64.zip \
  35. -c -O $packagedir/libvorbis-$vorbis_version.zip
  36. [ -e $packagedir/libcurl-$curl_version.zip ] || wget http://sfan5.pf-control.de/libcurl-$curl_version-win64.zip \
  37. -c -O $packagedir/libcurl-$curl_version.zip
  38. [ -e $packagedir/gettext-$gettext_version.zip ] || wget http://sfan5.pf-control.de/gettext-$gettext_version-win64.zip \
  39. -c -O $packagedir/gettext-$gettext_version.zip
  40. [ -e $packagedir/freetype-$freetype_version.zip ] || wget http://sfan5.pf-control.de/libfreetype-$freetype_version-win64.zip \
  41. -c -O $packagedir/freetype-$freetype_version.zip
  42. [ -e $packagedir/sqlite3-$sqlite3_version.zip ] || wget http://sfan5.pf-control.de/sqlite3-$sqlite3_version-win64.zip \
  43. -c -O $packagedir/sqlite3-$sqlite3_version.zip
  44. [ -e $packagedir/luajit-$luajit_version.zip ] || wget http://sfan5.pf-control.de/luajit-$luajit_version-static-win64.zip \
  45. -c -O $packagedir/luajit-$luajit_version.zip
  46. [ -e $packagedir/libleveldb-$leveldb_version.zip ] || wget http://sfan5.pf-control.de/libleveldb-$leveldb_version-win64.zip \
  47. -c -O $packagedir/libleveldb-$leveldb_version.zip
  48. [ -e $packagedir/openal_stripped.zip ] || wget http://sfan5.pf-control.de/openal_stripped64.zip \
  49. -c -O $packagedir/openal_stripped.zip
  50. # Extract stuff
  51. cd $libdir
  52. [ -d irrlicht-$irrlicht_version ] || unzip -o $packagedir/irrlicht-$irrlicht_version.zip
  53. [ -d zlib ] || unzip -o $packagedir/zlib-$zlib_version.zip -d zlib
  54. [ -d libogg ] || unzip -o $packagedir/libogg-$ogg_version.zip -d libogg
  55. [ -d libvorbis ] || unzip -o $packagedir/libvorbis-$vorbis_version.zip -d libvorbis
  56. [ -d libcurl ] || unzip -o $packagedir/libcurl-$curl_version.zip -d libcurl
  57. [ -d gettext ] || unzip -o $packagedir/gettext-$gettext_version.zip -d gettext
  58. [ -d freetype ] || unzip -o $packagedir/freetype-$freetype_version.zip -d freetype
  59. [ -d sqlite3 ] || unzip -o $packagedir/sqlite3-$sqlite3_version.zip -d sqlite3
  60. [ -d openal_stripped ] || unzip -o $packagedir/openal_stripped.zip
  61. [ -d luajit ] || unzip -o $packagedir/luajit-$luajit_version.zip -d luajit
  62. [ -d leveldb ] || unzip -o $packagedir/libleveldb-$leveldb_version.zip -d leveldb
  63. # Get minetest
  64. cd $builddir
  65. if [ ! "x$EXISTING_MINETEST_DIR" = "x" ]; then
  66. ln -s $EXISTING_MINETEST_DIR minetest
  67. else
  68. [ -d minetest ] && (cd minetest && git pull) || (git clone https://github.com/minetest/minetest)
  69. fi
  70. cd minetest
  71. git_hash=`git show | head -c14 | tail -c7`
  72. # Get minetest_game
  73. cd games
  74. if [ "x$NO_MINETEST_GAME" = "x" ]; then
  75. [ -d minetest_game ] && (cd minetest_game && git pull) || (git clone https://github.com/minetest/minetest_game)
  76. fi
  77. cd ../..
  78. # Build the thing
  79. cd minetest
  80. [ -d _build ] && rm -Rf _build/
  81. mkdir _build
  82. cd _build
  83. cmake .. \
  84. -DCMAKE_TOOLCHAIN_FILE=$toolchain_file \
  85. -DCMAKE_INSTALL_PREFIX=/tmp \
  86. -DVERSION_EXTRA=$git_hash \
  87. -DBUILD_CLIENT=1 -DBUILD_SERVER=0 \
  88. \
  89. -DENABLE_SOUND=1 \
  90. -DENABLE_CURL=1 \
  91. -DENABLE_GETTEXT=1 \
  92. -DENABLE_FREETYPE=1 \
  93. -DENABLE_LEVELDB=1 \
  94. \
  95. -DIRRLICHT_INCLUDE_DIR=$libdir/irrlicht-$irrlicht_version/include \
  96. -DIRRLICHT_LIBRARY=$libdir/irrlicht-$irrlicht_version/lib/Win64-gcc/libIrrlicht.dll.a \
  97. -DIRRLICHT_DLL=$libdir/irrlicht-$irrlicht_version/bin/Win64-gcc/Irrlicht.dll \
  98. \
  99. -DZLIB_INCLUDE_DIR=$libdir/zlib/include \
  100. -DZLIB_LIBRARIES=$libdir/zlib/lib/libz.dll.a \
  101. -DZLIB_DLL=$libdir/zlib/bin/zlib1.dll \
  102. \
  103. -DLUA_INCLUDE_DIR=$libdir/luajit/include \
  104. -DLUA_LIBRARY=$libdir/luajit/libluajit.a \
  105. \
  106. -DOGG_INCLUDE_DIR=$libdir/libogg/include \
  107. -DOGG_LIBRARY=$libdir/libogg/lib/libogg.dll.a \
  108. -DOGG_DLL=$libdir/libogg/bin/libogg-0.dll \
  109. \
  110. -DVORBIS_INCLUDE_DIR=$libdir/libvorbis/include \
  111. -DVORBIS_LIBRARY=$libdir/libvorbis/lib/libvorbis.dll.a \
  112. -DVORBIS_DLL=$libdir/libvorbis/bin/libvorbis-0.dll \
  113. -DVORBISFILE_LIBRARY=$libdir/libvorbis/lib/libvorbisfile.dll.a \
  114. -DVORBISFILE_DLL=$libdir/libvorbis/bin/libvorbisfile-3.dll \
  115. \
  116. -DOPENAL_INCLUDE_DIR=$libdir/openal_stripped/include/AL \
  117. -DOPENAL_LIBRARY=$libdir/openal_stripped/lib/libOpenAL32.dll.a \
  118. -DOPENAL_DLL=$libdir/openal_stripped/bin/OpenAL32.dll \
  119. \
  120. -DCURL_DLL=$libdir/libcurl/bin/libcurl-4.dll \
  121. -DCURL_INCLUDE_DIR=$libdir/libcurl/include \
  122. -DCURL_LIBRARY=$libdir/libcurl/lib/libcurl.dll.a \
  123. \
  124. -DFREETYPE_INCLUDE_DIR_freetype2=$libdir/freetype/include/freetype2 \
  125. -DFREETYPE_INCLUDE_DIR_ft2build=$libdir/freetype/include/freetype2 \
  126. -DFREETYPE_LIBRARY=$libdir/freetype/lib/libfreetype.dll.a \
  127. -DFREETYPE_DLL=$libdir/freetype/bin/libfreetype-6.dll \
  128. \
  129. -DSQLITE3_INCLUDE_DIR=$libdir/sqlite3/include \
  130. -DSQLITE3_LIBRARY=$libdir/sqlite3/lib/libsqlite3.dll.a \
  131. -DSQLITE3_DLL=$libdir/sqlite3/bin/libsqlite3-0.dll \
  132. \
  133. -DLEVELDB_INCLUDE_DIR=$libdir/leveldb/include \
  134. -DLEVELDB_LIBRARY=$libdir/leveldb/lib/libleveldb.dll.a \
  135. -DLEVELDB_DLL=$libdir/leveldb/bin/libleveldb.dll \
  136. \
  137. -DCUSTOM_GETTEXT_PATH=$libdir/gettext \
  138. -DGETTEXT_MSGFMT=`which msgfmt` \
  139. -DGETTEXT_DLL=$libdir/gettext/bin/libintl-8.dll \
  140. -DGETTEXT_ICONV_DLL=$libdir/gettext/bin/libiconv-2.dll \
  141. -DGETTEXT_INCLUDE_DIR=$libdir/gettext/include \
  142. -DGETTEXT_LIBRARY=$libdir/gettext/lib/libintl.dll.a
  143. make package -j2
  144. # EOF