You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

156 lines
6.0KB

  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.4
  15. ogg_version=1.3.2
  16. vorbis_version=1.3.5
  17. curl_version=7.54.0
  18. gettext_version=0.19.8.1
  19. freetype_version=2.8
  20. sqlite3_version=3.19.2
  21. luajit_version=2.1.0-beta3
  22. leveldb_version=1.19
  23. zlib_version=1.2.11
  24. mkdir -p $packagedir
  25. mkdir -p $libdir
  26. cd $builddir
  27. # Get stuff
  28. [ -e $packagedir/irrlicht-$irrlicht_version.zip ] || wget http://minetest.kitsunemimi.pw/irrlicht-$irrlicht_version-win64.zip \
  29. -c -O $packagedir/irrlicht-$irrlicht_version.zip
  30. [ -e $packagedir/zlib-$zlib_version.zip ] || wget http://minetest.kitsunemimi.pw/zlib-$zlib_version-win64.zip \
  31. -c -O $packagedir/zlib-$zlib_version.zip
  32. [ -e $packagedir/libogg-$ogg_version.zip ] || wget http://minetest.kitsunemimi.pw/libogg-$ogg_version-win64.zip \
  33. -c -O $packagedir/libogg-$ogg_version.zip
  34. [ -e $packagedir/libvorbis-$vorbis_version.zip ] || wget http://minetest.kitsunemimi.pw/libvorbis-$vorbis_version-win64.zip \
  35. -c -O $packagedir/libvorbis-$vorbis_version.zip
  36. [ -e $packagedir/curl-$curl_version.zip ] || wget http://minetest.kitsunemimi.pw/curl-$curl_version-win64.zip \
  37. -c -O $packagedir/curl-$curl_version.zip
  38. [ -e $packagedir/gettext-$gettext_version.zip ] || wget http://minetest.kitsunemimi.pw/gettext-$gettext_version-win64.zip \
  39. -c -O $packagedir/gettext-$gettext_version.zip
  40. [ -e $packagedir/freetype2-$freetype_version.zip ] || wget http://minetest.kitsunemimi.pw/freetype2-$freetype_version-win64.zip \
  41. -c -O $packagedir/freetype2-$freetype_version.zip
  42. [ -e $packagedir/sqlite3-$sqlite3_version.zip ] || wget http://minetest.kitsunemimi.pw/sqlite3-$sqlite3_version-win64.zip \
  43. -c -O $packagedir/sqlite3-$sqlite3_version.zip
  44. [ -e $packagedir/luajit-$luajit_version.zip ] || wget http://minetest.kitsunemimi.pw/luajit-$luajit_version-win64.zip \
  45. -c -O $packagedir/luajit-$luajit_version.zip
  46. [ -e $packagedir/libleveldb-$leveldb_version.zip ] || wget http://minetest.kitsunemimi.pw/libleveldb-$leveldb_version-win64.zip \
  47. -c -O $packagedir/libleveldb-$leveldb_version.zip
  48. [ -e $packagedir/openal_stripped.zip ] || wget http://minetest.kitsunemimi.pw/openal_stripped64.zip \
  49. -c -O $packagedir/openal_stripped.zip
  50. # Extract stuff
  51. cd $libdir
  52. [ -d irrlicht ] || unzip -o $packagedir/irrlicht-$irrlicht_version.zip -d irrlicht
  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/curl-$curl_version.zip -d libcurl
  57. [ -d gettext ] || unzip -o $packagedir/gettext-$gettext_version.zip -d gettext
  58. [ -d freetype ] || unzip -o $packagedir/freetype2-$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 rev-parse --short HEAD)
  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/include \
  96. -DIRRLICHT_LIBRARY=$libdir/irrlicht/lib/Win64-gcc/libIrrlicht.dll.a \
  97. -DIRRLICHT_DLL=$libdir/irrlicht/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. -DGETTEXT_MSGFMT=`which msgfmt` \
  125. -DGETTEXT_DLL=$libdir/gettext/bin/libintl-8.dll \
  126. -DGETTEXT_ICONV_DLL=$libdir/gettext/bin/libiconv-2.dll \
  127. -DGETTEXT_INCLUDE_DIR=$libdir/gettext/include \
  128. -DGETTEXT_LIBRARY=$libdir/gettext/lib/libintl.dll.a \
  129. \
  130. -DFREETYPE_INCLUDE_DIR_freetype2=$libdir/freetype/include/freetype2 \
  131. -DFREETYPE_INCLUDE_DIR_ft2build=$libdir/freetype/include/freetype2 \
  132. -DFREETYPE_LIBRARY=$libdir/freetype/lib/libfreetype.dll.a \
  133. -DFREETYPE_DLL=$libdir/freetype/bin/libfreetype-6.dll \
  134. \
  135. -DSQLITE3_INCLUDE_DIR=$libdir/sqlite3/include \
  136. -DSQLITE3_LIBRARY=$libdir/sqlite3/lib/libsqlite3.dll.a \
  137. -DSQLITE3_DLL=$libdir/sqlite3/bin/libsqlite3-0.dll \
  138. \
  139. -DLEVELDB_INCLUDE_DIR=$libdir/leveldb/include \
  140. -DLEVELDB_LIBRARY=$libdir/leveldb/lib/libleveldb.dll.a \
  141. -DLEVELDB_DLL=$libdir/leveldb/bin/libleveldb.dll
  142. make package -j2
  143. # EOF