mirror of
https://github.com/luanti-org/luanti.git
synced 2025-12-14 03:05:22 +01:00
Add self-extracting launcher for Windows
This commit is contained in:
@@ -2,11 +2,12 @@
|
||||
set -e
|
||||
|
||||
topdir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
if [ $# -ne 1 ]; then
|
||||
echo "Usage: $0 <build directory>"
|
||||
if [ $# -lt 1 ]; then
|
||||
echo "Usage: $0 <build directory> [extra cmake args...]"
|
||||
exit 1
|
||||
fi
|
||||
builddir=$1
|
||||
shift
|
||||
mkdir -p $builddir
|
||||
builddir="$( cd "$builddir" && pwd )"
|
||||
libdir=$builddir/libs
|
||||
@@ -63,6 +64,7 @@ cmake_args=(
|
||||
-DENABLE_LEVELDB=1
|
||||
)
|
||||
add_cmake_libs
|
||||
cmake_args+=("$@")
|
||||
cmake -S $sourcedir -B build "${cmake_args[@]}"
|
||||
|
||||
cmake --build build -j$(nproc)
|
||||
|
||||
@@ -2,11 +2,12 @@
|
||||
set -e
|
||||
|
||||
topdir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
if [ $# -ne 1 ]; then
|
||||
echo "Usage: $0 <build directory>"
|
||||
if [ $# -lt 1 ]; then
|
||||
echo "Usage: $0 <build directory> [extra cmake args...]"
|
||||
exit 1
|
||||
fi
|
||||
builddir=$1
|
||||
shift
|
||||
mkdir -p $builddir
|
||||
builddir="$( cd "$builddir" && pwd )"
|
||||
libdir=$builddir/libs
|
||||
@@ -44,7 +45,7 @@ download "$libhost/llvm/libjpeg-$libjpeg_version-win64.zip"
|
||||
download "$libhost/llvm/libpng-$libpng_version-win64.zip"
|
||||
download "$libhost/llvm/sdl2-$sdl2_version-win64.zip"
|
||||
|
||||
# Set source dir, downloading Minetest as needed
|
||||
# Set source dir, downloading Luanti as needed
|
||||
get_sources
|
||||
|
||||
# Build the thing
|
||||
@@ -63,6 +64,7 @@ cmake_args=(
|
||||
-DENABLE_LEVELDB=1
|
||||
)
|
||||
add_cmake_libs
|
||||
cmake_args+=("$@")
|
||||
cmake -S $sourcedir -B build "${cmake_args[@]}"
|
||||
|
||||
cmake --build build -j$(nproc)
|
||||
|
||||
@@ -32,6 +32,19 @@ install_linux_deps() {
|
||||
fi
|
||||
}
|
||||
|
||||
# Linux -> win32 cross-compiling only
|
||||
install_mingw_deps() {
|
||||
local bits=$1
|
||||
local nsis=$2
|
||||
|
||||
local pkgs=(gettext wine wine$bits)
|
||||
[[ "$nsis" == "true" ]] && pkgs+=(nsis ccache)
|
||||
|
||||
sudo dpkg --add-architecture i386
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y --no-install-recommends "${pkgs[@]}"
|
||||
}
|
||||
|
||||
# macOS build only
|
||||
install_macos_brew_deps() {
|
||||
# Uninstall the bundled cmake, it is outdated, and brew does not want to install the newest version with this one present since they are from different taps.
|
||||
@@ -50,8 +63,8 @@ install_macos_brew_deps() {
|
||||
}
|
||||
|
||||
install_macos_precompiled_deps() {
|
||||
osver=$1
|
||||
arch=$2
|
||||
local osver=$1
|
||||
local arch=$2
|
||||
|
||||
local pkgs=(
|
||||
cmake wget
|
||||
|
||||
Reference in New Issue
Block a user