2014-06-15 15:34:22 +02:00
|
|
|
#!/bin/bash
|
|
|
|
set -e
|
|
|
|
|
2022-07-21 20:51:02 +02:00
|
|
|
topdir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
2014-06-15 15:34:22 +02:00
|
|
|
if [ $# -ne 1 ]; then
|
|
|
|
echo "Usage: $0 <build directory>"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
builddir=$1
|
|
|
|
mkdir -p $builddir
|
|
|
|
builddir="$( cd "$builddir" && pwd )"
|
|
|
|
libdir=$builddir/libs
|
|
|
|
|
2023-04-11 18:17:55 +02:00
|
|
|
source $topdir/common.sh
|
|
|
|
|
2024-02-16 21:36:19 +01:00
|
|
|
compiler=x86_64-w64-mingw32-clang
|
2021-06-22 19:59:09 +02:00
|
|
|
|
2024-02-16 21:36:19 +01:00
|
|
|
if ! command -v "$compiler" >/dev/null; then
|
|
|
|
echo "Unable to find $compiler"
|
2021-06-22 19:59:09 +02:00
|
|
|
exit 1
|
|
|
|
fi
|
2024-02-16 21:36:19 +01:00
|
|
|
toolchain_file=$topdir/toolchain_${compiler%-*}.cmake
|
2021-06-22 19:59:09 +02:00
|
|
|
echo "Using $toolchain_file"
|
|
|
|
|
2024-02-16 21:36:19 +01:00
|
|
|
find_runtime_dlls ${compiler%-*}
|
2021-10-25 22:33:13 +02:00
|
|
|
|
|
|
|
# Get stuff
|
2014-06-15 15:34:22 +02:00
|
|
|
mkdir -p $libdir
|
|
|
|
|
|
|
|
cd $libdir
|
2023-12-13 00:19:11 +01:00
|
|
|
libhost="http://minetest.kitsunemimi.pw"
|
2024-02-16 21:36:19 +01:00
|
|
|
download "$libhost/llvm/zlib-$zlib_version-win64.zip"
|
|
|
|
download "$libhost/llvm/zstd-$zstd_version-win64.zip"
|
|
|
|
download "$libhost/llvm/libogg-$ogg_version-win64.zip"
|
|
|
|
download "$libhost/llvm/libvorbis-$vorbis_version-win64.zip"
|
|
|
|
download "$libhost/llvm/curl-$curl_version-win64.zip"
|
2023-12-13 12:54:44 +01:00
|
|
|
download "$libhost/ucrt/gettext-$gettext_version-win64.zip"
|
2024-02-16 21:36:19 +01:00
|
|
|
download "$libhost/llvm/freetype-$freetype_version-win64.zip"
|
|
|
|
download "$libhost/llvm/sqlite3-$sqlite3_version-win64.zip"
|
|
|
|
download "$libhost/llvm/luajit-$luajit_version-win64.zip"
|
|
|
|
download "$libhost/llvm/libleveldb-$leveldb_version-win64.zip"
|
|
|
|
download "$libhost/llvm/openal-soft-$openal_version-win64.zip"
|
2024-03-21 20:43:20 +01:00
|
|
|
download "$libhost/llvm/libjpeg-$libjpeg_version-win64.zip"
|
|
|
|
download "$libhost/llvm/libpng-$libpng_version-win64.zip"
|
2024-08-11 20:18:11 +02:00
|
|
|
download "$libhost/llvm/sdl2-$sdl2_version-win64.zip"
|
2014-06-15 15:34:22 +02:00
|
|
|
|
2021-04-11 17:10:06 +02:00
|
|
|
# Set source dir, downloading Minetest as needed
|
2023-04-11 18:17:55 +02:00
|
|
|
get_sources
|
2014-06-15 15:34:22 +02:00
|
|
|
|
2021-04-11 17:10:06 +02:00
|
|
|
# Build the thing
|
2023-12-13 00:04:58 +01:00
|
|
|
cd $builddir
|
2021-04-11 17:10:06 +02:00
|
|
|
[ -d build ] && rm -rf build
|
2014-06-15 15:34:22 +02:00
|
|
|
|
2023-04-11 18:17:55 +02:00
|
|
|
cmake_args=(
|
|
|
|
-DCMAKE_TOOLCHAIN_FILE=$toolchain_file
|
|
|
|
-DCMAKE_INSTALL_PREFIX=/tmp
|
|
|
|
-DBUILD_CLIENT=1 -DBUILD_SERVER=0
|
|
|
|
-DEXTRA_DLL="$runtime_dlls"
|
|
|
|
|
|
|
|
-DENABLE_SOUND=1
|
|
|
|
-DENABLE_CURL=1
|
|
|
|
-DENABLE_GETTEXT=1
|
|
|
|
-DENABLE_LEVELDB=1
|
|
|
|
)
|
|
|
|
add_cmake_libs
|
|
|
|
cmake -S $sourcedir -B build "${cmake_args[@]}"
|
2014-06-15 15:34:22 +02:00
|
|
|
|
2022-02-01 01:42:24 +01:00
|
|
|
cmake --build build -j$(nproc)
|
2017-06-08 16:30:30 +02:00
|
|
|
|
2022-02-01 01:42:24 +01:00
|
|
|
[ -z "$NO_PACKAGE" ] && cmake --build build --target package
|
2014-06-15 15:34:22 +02:00
|
|
|
|
2017-06-09 09:40:16 +02:00
|
|
|
exit 0
|
2014-06-15 15:34:22 +02:00
|
|
|
# EOF
|