Update tpt-libs
Also restructure meson.build and the ghactions workflow a bit, and enable -ffunction-sections and -fdata-sections. Note that starcatcher uploads have not been tested and most likely don't work.
This commit is contained in:
parent
ed13f33e7a
commit
513d2cae3e
390
.github/build.sh
vendored
390
.github/build.sh
vendored
@ -1,234 +1,298 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -euo pipefail
|
||||
IFS=$'\n\t'
|
||||
|
||||
if [ -z "${PLATFORM_SHORT-}" ]; then
|
||||
>&2 echo "PLATFORM_SHORT not set (lin, mac, win, and)"
|
||||
if [[ -z ${BSH_BUILD_PLATFORM-} ]]; then
|
||||
>&2 echo "BSH_BUILD_PLATFORM not set"
|
||||
exit 1
|
||||
fi
|
||||
if [ -z "${MACHINE_SHORT-}" ]; then
|
||||
>&2 echo "MACHINE_SHORT not set (x86_64, i686, arm64, arm)"
|
||||
if [[ -z ${BSH_HOST_ARCH-} ]]; then
|
||||
>&2 echo "BSH_HOST_ARCH not set"
|
||||
exit 1
|
||||
fi
|
||||
if [ -z "${TOOLSET_SHORT-}" ]; then
|
||||
>&2 echo "TOOLSET_SHORT not set (gcc, clang, mingw)"
|
||||
if [[ -z ${BSH_HOST_PLATFORM-} ]]; then
|
||||
>&2 echo "BSH_HOST_PLATFORM not set"
|
||||
exit 1
|
||||
fi
|
||||
if [ -z "${STATIC_DYNAMIC-}" ]; then
|
||||
>&2 echo "STATIC_DYNAMIC not set (static, dynamic)"
|
||||
if [[ -z ${BSH_HOST_LIBC-} ]]; then
|
||||
>&2 echo "BSH_HOST_LIBC not set"
|
||||
exit 1
|
||||
fi
|
||||
if [ -z "${RELNAME-}" ]; then
|
||||
>&2 echo "RELNAME not set"
|
||||
if [[ -z ${BSH_STATIC_DYNAMIC-} ]]; then
|
||||
>&2 echo "BSH_STATIC_DYNAMIC not set"
|
||||
exit 1
|
||||
fi
|
||||
if [ -z "${RELTYPE-}" ]; then
|
||||
>&2 echo "RELTYPE not set"
|
||||
if [[ -z ${BSH_DEBUG_RELEASE-} ]]; then
|
||||
>&2 echo "BSH_DEBUG_RELEASE not set"
|
||||
exit 1
|
||||
fi
|
||||
if [ -z "${MOD_ID-}" ]; then
|
||||
if [[ -z ${RELEASE_NAME-} ]]; then
|
||||
>&2 echo "RELEASE_NAME not set"
|
||||
exit 1
|
||||
fi
|
||||
if [[ -z ${RELEASE_TYPE-} ]]; then
|
||||
>&2 echo "RELEASE_TYPE not set"
|
||||
exit 1
|
||||
fi
|
||||
if [[ -z ${MOD_ID-} ]]; then
|
||||
>&2 echo "MOD_ID not set"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -z "${build_sh_init-}" ]; then
|
||||
if [ $TOOLSET_SHORT == "msvc" ]; then
|
||||
for i in C:/Program\ Files*/Microsoft\ Visual\ Studio/**/**/VC/Auxiliary/Build/vcvarsall.bat; do
|
||||
vcvarsall_path=$i
|
||||
done
|
||||
if [ $MACHINE_SHORT == "x86_64" ]; then
|
||||
x64_x86=x64
|
||||
else
|
||||
x64_x86=x86
|
||||
fi
|
||||
cat << BUILD_INIT_BAT > .github/build_init.bat
|
||||
@echo off
|
||||
call "${vcvarsall_path}" ${x64_x86}
|
||||
bash -c 'build_sh_init=1 ./.github/build.sh'
|
||||
BUILD_INIT_BAT
|
||||
./.github/build_init.bat
|
||||
else
|
||||
build_sh_init=1 ./.github/build.sh
|
||||
fi
|
||||
exit 0
|
||||
if [[ -z ${ASSET_PATH-} ]]; then
|
||||
>&2 echo "ASSET_PATH not set"
|
||||
exit 1
|
||||
fi
|
||||
if [[ -z ${SEPARATE_DEBUG-} ]]; then
|
||||
>&2 echo "SEPARATE_DEBUG not set"
|
||||
exit 1
|
||||
fi
|
||||
if [[ -z ${DEBUG_ASSET_PATH-} ]]; then
|
||||
>&2 echo "DEBUG_ASSET_PATH not set"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -d build ]; then
|
||||
case $BSH_HOST_ARCH-$BSH_HOST_PLATFORM-$BSH_HOST_LIBC-$BSH_STATIC_DYNAMIC in
|
||||
x86_64-linux-gnu-static) ;;
|
||||
x86_64-linux-gnu-dynamic) ;;
|
||||
x86_64-windows-mingw-static) ;;
|
||||
x86_64-windows-mingw-dynamic) ;;
|
||||
x86_64-windows-msvc-static) ;;
|
||||
x86_64-windows-msvc-dynamic) ;;
|
||||
x86-windows-msvc-static) ;;
|
||||
x86-windows-msvc-dynamic) ;;
|
||||
x86_64-darwin-macos-static) ;;
|
||||
x86_64-darwin-macos-dynamic) ;;
|
||||
aarch64-darwin-macos-static) ;;
|
||||
aarch64-darwin-macos-dynamic) ;;
|
||||
x86-android-bionic-static) ;;
|
||||
x86_64-android-bionic-static) ;;
|
||||
arm-android-bionic-static) ;;
|
||||
aarch64-android-bionic-static) ;;
|
||||
*) >&2 echo "configuration $BSH_HOST_ARCH-$BSH_HOST_PLATFORM-$BSH_HOST_LIBC-$BSH_STATIC_DYNAMIC is not supported" && exit 1;;
|
||||
esac
|
||||
|
||||
if [[ $BSH_HOST_PLATFORM == android ]]; then
|
||||
android_platform=android-30
|
||||
if [[ -z "${JAVA_HOME_8_X64-}" ]]; then
|
||||
>&2 echo "JAVA_HOME_8_X64 not set"
|
||||
exit 1
|
||||
fi
|
||||
if [[ -z "${ANDROID_SDK_ROOT-}" ]]; then
|
||||
>&2 echo "ANDROID_SDK_ROOT not set"
|
||||
exit 1
|
||||
fi
|
||||
if [[ -z "${ANDROID_NDK_LATEST_HOME-}" ]]; then
|
||||
>&2 echo "ANDROID_NDK_LATEST_HOME not set"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ $BSH_HOST_PLATFORM-$BSH_HOST_LIBC == windows-msvc ]]; then
|
||||
case $BSH_HOST_ARCH in
|
||||
x86_64) vs_env_arch=x64;;
|
||||
x86) vs_env_arch=x86;;
|
||||
esac
|
||||
. ./.github/vs-env.sh $vs_env_arch
|
||||
elif [[ $BSH_HOST_PLATFORM == darwin ]]; then
|
||||
# may need export SDKROOT=$(xcrun --show-sdk-path --sdk macosx11.1)
|
||||
CC=clang
|
||||
CXX=clang++
|
||||
if [[ $BSH_HOST_ARCH == aarch64 ]]; then
|
||||
export MACOSX_DEPLOYMENT_TARGET=11.0
|
||||
CC+=" -arch arm64"
|
||||
CXX+=" -arch arm64"
|
||||
else
|
||||
export MACOSX_DEPLOYMENT_TARGET=10.9
|
||||
CC+=" -arch x86_64"
|
||||
CXX+=" -arch x86_64"
|
||||
fi
|
||||
export CC
|
||||
export CXX
|
||||
elif [[ $BSH_HOST_PLATFORM == android ]]; then
|
||||
case $BSH_HOST_ARCH in
|
||||
x86_64) android_toolchain_prefix=x86_64-linux-android ; android_system_version=21; android_arch_abi=x86_64 ;;
|
||||
x86) android_toolchain_prefix=i686-linux-android ; android_system_version=19; android_arch_abi=x86 ;;
|
||||
aarch64) android_toolchain_prefix=aarch64-linux-android ; android_system_version=21; android_arch_abi=arm64-v8a ;;
|
||||
arm) android_toolchain_prefix=armv7a-linux-androideabi; android_system_version=19; android_arch_abi=armeabi-v7a;;
|
||||
esac
|
||||
android_toolchain_dir=$ANDROID_NDK_LATEST_HOME/toolchains/llvm/prebuilt/linux-x86_64
|
||||
CC=$android_toolchain_dir/bin/$android_toolchain_prefix$android_system_version-clang
|
||||
CXX=$android_toolchain_dir/bin/$android_toolchain_prefix$android_system_version-clang++
|
||||
LD=$android_toolchain_dir/bin/$android_toolchain_prefix-ld
|
||||
AR=$android_toolchain_dir/bin/llvm-ar
|
||||
echo $AR
|
||||
CC+=" -fPIC"
|
||||
CXX+=" -fPIC"
|
||||
LD+=" -fPIC"
|
||||
export CC
|
||||
export CXX
|
||||
export LD
|
||||
export AR
|
||||
else
|
||||
export CC=gcc
|
||||
export CXX=g++
|
||||
fi
|
||||
|
||||
if [[ -d build ]]; then
|
||||
rm -r build
|
||||
fi
|
||||
|
||||
other_flags=$'\t-Dmod_id='
|
||||
other_flags+=$MOD_ID
|
||||
bin_suffix=
|
||||
bin_prefix=
|
||||
static_flag=
|
||||
if [ $STATIC_DYNAMIC == "static" ]; then
|
||||
static_flag=-Dstatic=prebuilt
|
||||
if [ $PLATFORM_SHORT == "win" ]; then
|
||||
other_flags+=$'\t-Db_vscrt=static_from_buildtype'
|
||||
meson_configure=meson
|
||||
if [[ $BSH_DEBUG_RELEASE == release ]]; then
|
||||
meson_configure+=$'\t'-Dbuildtype=debugoptimized
|
||||
fi
|
||||
meson_configure+=$'\t'-Db_strip=false
|
||||
meson_configure+=$'\t'-Db_pie=false
|
||||
if [[ $BSH_HOST_PLATFORM-$BSH_HOST_LIBC != windows-msvc ]]; then
|
||||
meson_configure+=$'\t'-Dc_args=[\'-ffunction-sections\',\'-fdata-sections\']
|
||||
meson_configure+=$'\t'-Dcpp_args=[\'-ffunction-sections\',\'-fdata-sections\']
|
||||
if [[ $BSH_HOST_PLATFORM == darwin ]]; then
|
||||
meson_configure+=$'\t'-Dc_link_args=[\'-Wl,-dead_strip\']
|
||||
meson_configure+=$'\t'-Dcpp_link_args=[\'-Wl,-dead_strip\']
|
||||
else
|
||||
meson_configure+=$'\t'-Dc_link_args=[\'-Wl,--gc-sections\']
|
||||
meson_configure+=$'\t'-Dcpp_link_args=[\'-Wl,--gc-sections\']
|
||||
fi
|
||||
fi
|
||||
if [ $PLATFORM_SHORT == "lin" ]; then
|
||||
# We use gcc on lin; sadly, gcc + lto + libstdc++ + pthread = undefined reference to
|
||||
# pthread_create, thanks to weak symbols in libstdc++.so (or something). See
|
||||
# https://gcc.gnu.org/legacy-ml/gcc-help/2017-03/msg00081.html
|
||||
other_flags+=$'\t-Db_asneeded=false\t-Dcpp_link_args=-Wl,--no-as-needed'
|
||||
if [ $STATIC_DYNAMIC == "static" ] && [ $TOOLSET_SHORT == "gcc" ]; then
|
||||
other_flags+=$'\t-Dbuild_render=true\t-Dbuild_font=true'
|
||||
meson_configure+=$'\t'-Dworkaround_gcc_no_pie=true
|
||||
meson_configure+=$'\t'-Db_staticpic=false
|
||||
meson_configure+=$'\t'-Dinstall_check=true
|
||||
meson_configure+=$'\t'-Dmod_id=$MOD_ID
|
||||
if [[ $BSH_HOST_ARCH-$BSH_HOST_PLATFORM-$BSH_HOST_LIBC-$BSH_STATIC_DYNAMIC == x86_64-linux-gnu-static ]]; then
|
||||
meson_configure+=$'\t'-Dbuild_render=true
|
||||
meson_configure+=$'\t'-Dbuild_font=true
|
||||
fi
|
||||
if [[ $BSH_STATIC_DYNAMIC == static ]]; then
|
||||
meson_configure+=$'\t'-Dstatic=prebuilt
|
||||
if [[ $BSH_HOST_PLATFORM == windows ]]; then
|
||||
meson_configure+=$'\t'-Db_vscrt=static_from_buildtype
|
||||
fi
|
||||
fi
|
||||
if [ $TOOLSET_SHORT == "mingw" ]; then
|
||||
bin_suffix=$bin_suffix.exe
|
||||
stable_or_beta=no
|
||||
if [[ $RELEASE_TYPE == beta ]]; then
|
||||
meson_configure+=$'\t'-Dbeta=true
|
||||
stable_or_beta=yes
|
||||
fi
|
||||
if [ $PLATFORM_SHORT == "and" ]; then
|
||||
bin_suffix=$bin_suffix.apk
|
||||
if [[ $RELEASE_TYPE == stable ]]; then
|
||||
stable_or_beta=yes
|
||||
fi
|
||||
stable_or_beta="n"
|
||||
if [ "$RELTYPE" == "beta" ]; then
|
||||
other_flags+=$'\t-Dbeta=true'
|
||||
stable_or_beta="y"
|
||||
if [[ $RELEASE_TYPE == snapshot ]]; then
|
||||
meson_configure+=$'\t'-Dsnapshot=true
|
||||
meson_configure+=$'\t'-Dsnapshot_id=$(echo $RELEASE_NAME | cut -d '-' -f 2) # $RELEASE_NAME is snapshot-X
|
||||
fi
|
||||
if [ "$RELTYPE" == "stable" ]; then
|
||||
stable_or_beta="y"
|
||||
fi
|
||||
if [ "$RELTYPE" == "snapshot" ]; then
|
||||
other_flags+=$'\t-Dsnapshot=true\t-Dsnapshot_id='
|
||||
other_flags+=`echo $RELNAME | cut -d '-' -f 2` # $RELNAME is snapshot-X
|
||||
fi
|
||||
if [ "$RELTYPE" == "snapshot" ] && [ "$MOD_ID" != "0" ]; then
|
||||
if [[ $RELEASE_TYPE == snapshot ]] && [[ $MOD_ID != 0 ]]; then
|
||||
>&2 echo "mods and snapshots do not mix"
|
||||
exit 1
|
||||
fi
|
||||
if [ "$stable_or_beta" == "y" ] && [ "$MOD_ID" != "0" ]; then
|
||||
if [[ $stable_or_beta == yes ]] && [[ $MOD_ID != 0 ]]; then
|
||||
# mods and snapshots both check their snapshot_id against whatever version starcatcher.us/TPT has
|
||||
other_flags+=$'\t-Dsnapshot_id='
|
||||
other_flags+=`echo $RELNAME | cut -d '.' -f 3` # $RELNAME is vX.Y.Z
|
||||
meson_configure+=$'\t'-Dsnapshot_id=$(echo $RELEASE_NAME | cut -d '.' -f 3) # $RELEASE_NAME is vX.Y.Z
|
||||
fi
|
||||
if [ "$RELTYPE" == "snapshot" ] || [ "$MOD_ID" != "0" ]; then
|
||||
other_flags+=$'\t-Dupdate_server=starcatcher.us/TPT'
|
||||
if [[ $RELEASE_TYPE == snapshot ]] || [[ $MOD_ID != 0 ]]; then
|
||||
meson_configure+=$'\t'-Dupdate_server=starcatcher.us/TPT
|
||||
fi
|
||||
if [ "$RELTYPE" != "dev" ]; then
|
||||
other_flags+=$'\t-Dignore_updates=false'
|
||||
if [[ $RELEASE_TYPE != dev ]]; then
|
||||
meson_configure+=$'\t'-Dignore_updates=false
|
||||
fi
|
||||
lto_flag=-Db_lto=true
|
||||
if [ $TOOLSET_SHORT == "mingw" ]; then
|
||||
# This simply doesn't work with MinGW. I have no idea why and I also don't care.
|
||||
lto_flag=
|
||||
if [ $PLATFORM_SHORT == "lin" ]; then
|
||||
other_flags+=$'\t--cross-file=.github/mingw-ghactions.ini'
|
||||
if [[ $BSH_HOST_PLATFORM-$BSH_HOST_LIBC == windows-mingw ]]; then
|
||||
if [[ $BSH_HOST_PLATFORM == linux ]]; then
|
||||
meson_configure+=$'\t'--cross-file=.github/mingw-ghactions.ini
|
||||
fi
|
||||
else
|
||||
# LTO simply doesn't work with MinGW. I have no idea why and I also don't care.
|
||||
meson_configure+=$'\t'-Db_lto=true
|
||||
fi
|
||||
if [[ $BSH_HOST_PLATFORM == darwin ]]; then
|
||||
export MACOSX_DEPLOYMENT_TARGET=10.9
|
||||
if [[ $BSH_HOST_ARCH == aarch64 ]]; then
|
||||
export MACOSX_DEPLOYMENT_TARGET=11.0
|
||||
meson_configure+=$'\t'--cross-file=.github/macaa64-ghactions.ini
|
||||
fi
|
||||
fi
|
||||
if [ $PLATFORM_SHORT == "mac" ]; then
|
||||
macosx_version_min=10.9
|
||||
if [ $MACHINE_SHORT == "arm64" ]; then
|
||||
macosx_version_min=10.15
|
||||
other_flags+=$'\t--cross-file=.github/macaa64-ghactions.ini'
|
||||
fi
|
||||
export CFLAGS=-mmacosx-version-min=$macosx_version_min
|
||||
export CXXFLAGS=-mmacosx-version-min=$macosx_version_min
|
||||
export LDFLAGS=-mmacosx-version-min=$macosx_version_min
|
||||
fi
|
||||
powder_bin=${bin_prefix}powder$bin_suffix
|
||||
if [ "$RELTYPE" == "tptlibsdev" ]; then
|
||||
if [ -z "${GITHUB_REPOSITORY_OWNER-}" ]; then
|
||||
>&2 echo "GITHUB_REPOSITORY_OWNER not set (whose tpt-libs to clone?)"
|
||||
if [[ $RELEASE_TYPE == tptlibsdev ]] && ([[ $BSH_HOST_PLATFORM == windows ]] || [[ $BSH_STATIC_DYNAMIC == static ]]); then
|
||||
if [[ -z "${GITHUB_REPOSITORY_OWNER-}" ]]; then
|
||||
>&2 echo "GITHUB_REPOSITORY_OWNER not set"
|
||||
exit 1
|
||||
fi
|
||||
tptlibsbranch=`echo $RELNAME | cut -d '-' -f 2-` # $RELNAME is tptlibsdev-BRANCH
|
||||
if [ ! -d tpt-libs ]; then
|
||||
git clone https://github.com/$GITHUB_REPOSITORY_OWNER/tpt-libs --branch $tptlibsbranch
|
||||
fi
|
||||
cd tpt-libs
|
||||
quad=$MACHINE_SHORT-$PLATFORM_SHORT-$TOOLSET_SHORT-$STATIC_DYNAMIC
|
||||
if [ ! -d patches/$quad ]; then
|
||||
cd ..
|
||||
echo "no prebuilt libraries for this configuration" > $powder_bin
|
||||
if [[ "$BSH_HOST_ARCH-$BSH_HOST_PLATFORM-$BSH_HOST_LIBC-$BSH_STATIC_DYNAMIC $BSH_BUILD_PLATFORM" == "x86_64-windows-mingw-dynamic linux" ]]; then
|
||||
>&2 echo "this configuration is not supported in tptlibsdev mode"
|
||||
touch $ASSET_PATH
|
||||
exit 0
|
||||
fi
|
||||
tptlibsbranch=$(echo $RELEASE_NAME | cut -d '-' -f 2-) # $RELEASE_NAME is tptlibsdev-BRANCH
|
||||
if [[ ! -d build-tpt-libs/tpt-libs ]]; then
|
||||
mkdir -p build-tpt-libs
|
||||
cd build-tpt-libs
|
||||
git clone https://github.com/$GITHUB_REPOSITORY_OWNER/tpt-libs --branch $tptlibsbranch --depth 1
|
||||
cd ..
|
||||
fi
|
||||
tpt_libs_vtag=v00000000000000
|
||||
if [ ! -f .ok ]; then
|
||||
VTAG=$tpt_libs_vtag ./build.sh
|
||||
if [[ ! -f build-tpt-libs/tpt-libs/.ok ]]; then
|
||||
cd build-tpt-libs/tpt-libs
|
||||
BSH_VTAG=$tpt_libs_vtag ./build.sh
|
||||
touch .ok
|
||||
cd ../subprojects
|
||||
if [ -d tpt-libs-prebuilt-$quad-$tpt_libs_vtag ]; then
|
||||
rm -r tpt-libs-prebuilt-$quad-$tpt_libs_vtag
|
||||
fi
|
||||
7z x ../tpt-libs/temp/libraries.zip
|
||||
cd ../../subprojects
|
||||
for i in tpt-libs-prebuilt-*; do
|
||||
if [[ -d $i ]]; then
|
||||
rm -r $i
|
||||
fi
|
||||
done
|
||||
7z x ../build-tpt-libs/tpt-libs/temp/libraries.zip
|
||||
cd ..
|
||||
fi
|
||||
cd ..
|
||||
other_flags+=$'\t-Dtpt_libs_vtag='
|
||||
other_flags+=$tpt_libs_vtag
|
||||
meson_configure+=$'\t'-Dtpt_libs_vtag=$tpt_libs_vtag
|
||||
fi
|
||||
if [ $PLATFORM_SHORT == "and" ]; then
|
||||
ANDROIDPLATFORM=android-30 # this should come from tpt-libs, see https://github.com/The-Powder-Toy/tpt-libs/issues/2
|
||||
other_flags+=$'\t--cross-file='
|
||||
if [ $MACHINE_SHORT == "x86_64" ]; then
|
||||
other_flags+=android/cross/x86_64.ini
|
||||
fi
|
||||
if [ $MACHINE_SHORT == "i686" ]; then
|
||||
other_flags+=android/cross/x86.ini
|
||||
fi
|
||||
if [ $MACHINE_SHORT == "arm64" ]; then
|
||||
other_flags+=android/cross/arm64-v8a.ini
|
||||
fi
|
||||
if [ $MACHINE_SHORT == "arm" ]; then
|
||||
other_flags+=android/cross/armeabi-v7a.ini
|
||||
fi
|
||||
if [ -z "${JAVA_HOME_8_X64-}" ]; then
|
||||
>&2 echo "JAVA_HOME_8_X64 not set (where is your java sdk?)"
|
||||
exit 1
|
||||
fi
|
||||
if [ -z "${ANDROID_SDK_ROOT-}" ]; then
|
||||
>&2 echo "ANDROID_SDK_ROOT not set (where is your android sdk?)"
|
||||
exit 1
|
||||
fi
|
||||
if [ -z "${ANDROID_NDK_LATEST_HOME-}" ]; then
|
||||
>&2 echo "ANDROID_NDK_LATEST_HOME not set (where is your android ndk?)"
|
||||
exit 1
|
||||
fi
|
||||
if [[ $BSH_HOST_PLATFORM == android ]]; then
|
||||
android_platform=android-30
|
||||
meson_configure+=$'\t'--cross-file=android/cross/$BSH_HOST_ARCH.ini
|
||||
cat << ANDROID_INI > .github/android-ghactions.ini
|
||||
[constants]
|
||||
andriod_ndk_toolchain_bin = '$ANDROID_NDK_LATEST_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin'
|
||||
andriod_sdk_build_tools = '$ANDROID_SDK_ROOT/build-tools/32.0.0'
|
||||
|
||||
[properties]
|
||||
android_platform_jar = '$ANDROID_SDK_ROOT/platforms/$ANDROIDPLATFORM/android.jar'
|
||||
# android_ndk_toolchain_prefix comes from the correct cross-file in ./android/cross
|
||||
android_ndk_toolchain_prefix = android_ndk_toolchain_prefix
|
||||
android_platform = '$android_platform'
|
||||
android_platform_jar = '$ANDROID_SDK_ROOT/platforms/' + android_platform + '/android.jar'
|
||||
java_runtime_jar = '$JAVA_HOME_8_X64/jre/lib/rt.jar'
|
||||
|
||||
[binaries]
|
||||
# android_ndk_toolchain_prefix comes from the correct cross-file in ./android/cross
|
||||
c = andriod_ndk_toolchain_bin / (android_ndk_toolchain_prefix + 'clang')
|
||||
cpp = andriod_ndk_toolchain_bin / (android_ndk_toolchain_prefix + 'clang++')
|
||||
strip = andriod_ndk_toolchain_bin / 'llvm-strip'
|
||||
javac = '$JAVA_HOME_8_X64/bin/javac'
|
||||
jar = '$JAVA_HOME_8_X64/bin/jar'
|
||||
d8 = andriod_sdk_build_tools / 'd8'
|
||||
aapt = andriod_sdk_build_tools / 'aapt'
|
||||
aapt2 = andriod_sdk_build_tools / 'aapt2'
|
||||
zipalign = andriod_sdk_build_tools / 'zipalign'
|
||||
apksigner = andriod_sdk_build_tools / 'apksigner'
|
||||
ANDROID_INI
|
||||
other_flags+=$'\t--cross-file=.github/android-ghactions.ini'
|
||||
cat << JDK_INI > .github/jdk.ini
|
||||
[properties]
|
||||
java_runtime_jar = '$JAVA_HOME_8_X64/jre/lib/rt.jar'
|
||||
|
||||
[binaries]
|
||||
javac = '$JAVA_HOME_8_X64/bin/javac'
|
||||
jar = '$JAVA_HOME_8_X64/bin/jar'
|
||||
JDK_INI
|
||||
other_flags+=$'\t--cross-file=.github/jdk.ini'
|
||||
other_flags+=$'\t-Dhttp=false'
|
||||
meson_configure+=$'\t'--cross-file=.github/android-ghactions.ini
|
||||
meson_configure+=$'\t'-Dhttp=false
|
||||
fi
|
||||
meson -Dbuildtype=release -Db_pie=false -Dworkaround_gcc_no_pie=true -Db_staticpic=false $lto_flag $static_flag -Dinstall_check=true $other_flags build
|
||||
$meson_configure build
|
||||
cd build
|
||||
ninja
|
||||
if [ $PLATFORM_SHORT == "and" ]; then
|
||||
$ANDROID_NDK_LATEST_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-strip libpowder.so
|
||||
elif [ $PLATFORM_SHORT != "win" ]; then
|
||||
strip $powder_bin
|
||||
ninja -v
|
||||
strip=strip
|
||||
objcopy=objcopy
|
||||
strip_target=$ASSET_PATH
|
||||
if [[ $BSH_HOST_PLATFORM == android ]]; then
|
||||
strip=$ANDROID_NDK_LATEST_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-$strip
|
||||
objcopy=$ANDROID_NDK_LATEST_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-$objcopy
|
||||
strip_target=libpowder.so
|
||||
fi
|
||||
if [ $PLATFORM_SHORT == "and" ]; then
|
||||
if [[ $SEPARATE_DEBUG == yes ]] && [[ $BSH_HOST_PLATFORM-$BSH_HOST_LIBC != windows-msvc ]]; then
|
||||
$objcopy --only-keep-debug $strip_target $DEBUG_ASSET_PATH
|
||||
$strip --strip-debug --strip-unneeded $strip_target
|
||||
$objcopy --add-gnu-debuglink $DEBUG_ASSET_PATH $strip_target
|
||||
fi
|
||||
if [[ $BSH_HOST_PLATFORM == android ]]; then
|
||||
$JAVA_HOME_8_X64/bin/keytool -genkeypair -keystore keystore.jks -alias androidkey -validity 10000 -keyalg RSA -keysize 2048 -keypass bagelsbagels -storepass bagelsbagels -dname "CN=nobody"
|
||||
meson configure -Dandroid_keystore=`readlink -f keystore.jks`
|
||||
ANDROID_KEYSTORE_PASS=bagelsbagels ninja powder.apk
|
||||
meson configure -Dandroid_keystore=$(realpath keystore.jks)
|
||||
ANDROID_KEYSTORE_PASS=bagelsbagels ninja android/powder.apk
|
||||
mv android/powder.apk powder.apk
|
||||
fi
|
||||
cp $powder_bin ..
|
||||
|
27
.github/get-type.py
vendored
27
.github/get-type.py
vendored
@ -1,27 +0,0 @@
|
||||
import re
|
||||
import sys
|
||||
|
||||
ref = sys.argv[1]
|
||||
|
||||
match_stable = re.fullmatch(r'refs/tags/v([0-9]+)\.([0-9]+)\.([0-9]+)', ref)
|
||||
match_beta = re.fullmatch(r'refs/tags/v([0-9]+)\.([0-9]+)\.([0-9]+)b', ref)
|
||||
match_tptlibsdev = re.fullmatch(r'refs/heads/tptlibsdev-(.*)', ref)
|
||||
match_snapshot = re.fullmatch(r'refs/tags/snapshot-([0-9]+)', ref)
|
||||
if match_stable:
|
||||
print('::set-output name=TYPE::stable')
|
||||
print('::set-output name=NAME::v%s.%s.%s' % (match_stable.group(1), match_stable.group(2), match_stable.group(3)))
|
||||
elif match_beta:
|
||||
print('::set-output name=TYPE::beta')
|
||||
print('::set-output name=NAME::v%s.%s.%sb' % (match_beta.group(1), match_beta.group(2), match_beta.group(3)))
|
||||
elif match_snapshot:
|
||||
print('::set-output name=TYPE::snapshot')
|
||||
print('::set-output name=NAME::snapshot-%s' % match_snapshot.group(1))
|
||||
elif match_tptlibsdev:
|
||||
print('::set-output name=TYPE::tptlibsdev')
|
||||
print('::set-output name=NAME::tptlibsdev-%s' % match_tptlibsdev.group(1))
|
||||
else:
|
||||
print('::set-output name=TYPE::dev')
|
||||
print('::set-output name=NAME::dev')
|
||||
|
||||
with open('.github/mod_id.txt') as f:
|
||||
print('::set-output name=MOD_ID::' + f.read())
|
7
.github/invoke-vcvarsall.bat
vendored
7
.github/invoke-vcvarsall.bat
vendored
@ -1,7 +0,0 @@
|
||||
@echo off
|
||||
|
||||
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x86
|
||||
echo ::set-env name=PATH::%PATH%
|
||||
echo ::set-env name=CC::cl
|
||||
echo ::set-env name=CXX::cl
|
||||
exit
|
10
.github/macaa64-ghactions.ini
vendored
10
.github/macaa64-ghactions.ini
vendored
@ -1,12 +1,6 @@
|
||||
[built-in options]
|
||||
c_args = [ '-arch', 'arm64' ]
|
||||
cpp_args = [ '-arch', 'arm64' ]
|
||||
c_link_args = [ '-arch', 'arm64' ]
|
||||
cpp_link_args = [ '-arch', 'arm64' ]
|
||||
|
||||
[binaries]
|
||||
c = 'clang'
|
||||
cpp = 'clang++'
|
||||
c = [ 'clang', '-arch', 'arm64' ]
|
||||
cpp = [ 'clang++', '-arch', 'arm64' ]
|
||||
strip = 'strip'
|
||||
|
||||
[host_machine]
|
||||
|
86
.github/prepare.py
vendored
Executable file
86
.github/prepare.py
vendored
Executable file
@ -0,0 +1,86 @@
|
||||
import datetime
|
||||
import json
|
||||
import os
|
||||
import re
|
||||
import sys
|
||||
|
||||
ref = os.getenv('GITHUB_REF')
|
||||
publish_hostport = os.getenv('PUBLISH_HOSTPORT')
|
||||
|
||||
match_stable = re.fullmatch(r'refs/tags/v([0-9]+)\.([0-9]+)\.([0-9]+)', ref)
|
||||
match_beta = re.fullmatch(r'refs/tags/v([0-9]+)\.([0-9]+)\.([0-9]+)b', ref)
|
||||
match_snapshot = re.fullmatch(r'refs/tags/snapshot-([0-9]+)', ref)
|
||||
match_tptlibsdev = re.fullmatch(r'refs/heads/tptlibsdev-(.*)', ref)
|
||||
if match_stable:
|
||||
release_type = 'stable'
|
||||
release_name = 'v%s.%s.%s' % (match_stable.group(1), match_stable.group(2), match_stable.group(3))
|
||||
elif match_beta:
|
||||
release_type = 'beta'
|
||||
release_name = 'v%s.%s.%sb' % (match_beta.group(1), match_beta.group(2), match_beta.group(3))
|
||||
elif match_snapshot:
|
||||
release_type = 'snapshot'
|
||||
release_name = 'snapshot-%s' % match_snapshot.group(1)
|
||||
elif match_tptlibsdev:
|
||||
release_type = 'tptlibsdev'
|
||||
release_name = 'tptlibsdev-%s' % match_tptlibsdev.group(1)
|
||||
else:
|
||||
release_type = 'dev'
|
||||
release_name = 'dev'
|
||||
|
||||
print('::set-output name=release_type::' + release_type)
|
||||
print('::set-output name=release_name::' + release_name)
|
||||
|
||||
with open('.github/mod_id.txt') as f:
|
||||
print('::set-output name=mod_id::' + f.read())
|
||||
|
||||
configurations = []
|
||||
for bsh_host_arch, bsh_host_platform, bsh_host_libc, bsh_static_dynamic, bsh_build_platform, runs_on, package_suffix, publish, artifact, debug_suffix, starcatcher_name in [
|
||||
( 'x86_64', 'linux', 'gnu', 'static', 'linux', 'ubuntu-18.04', '', True, True, '.dbg', '' ),
|
||||
( 'x86_64', 'linux', 'gnu', 'dynamic', 'linux', 'ubuntu-18.04', '', False, False, None, '' ),
|
||||
# ubuntu-20.04 doesn't have windows TLS headers somehow and I haven't yet figured out how to get them
|
||||
# ( 'x86_64', 'windows', 'mingw', 'static', 'linux', 'ubuntu-20.04', '', False, True, '.dbg', '' ),
|
||||
( 'x86_64', 'windows', 'mingw', 'dynamic', 'linux', 'ubuntu-20.04', '', False, False, None, '' ),
|
||||
( 'x86_64', 'windows', 'mingw', 'static', 'windows', 'windows-2019', '.exe', False, True, '.dbg', '' ),
|
||||
( 'x86_64', 'windows', 'mingw', 'dynamic', 'windows', 'windows-2019', '.exe', False, False, None, '' ),
|
||||
( 'x86_64', 'windows', 'msvc', 'static', 'windows', 'windows-2019', '.exe', True, True, '.pdb', '' ),
|
||||
( 'x86_64', 'windows', 'msvc', 'dynamic', 'windows', 'windows-2019', '.exe', False, False, None, '' ),
|
||||
( 'x86', 'windows', 'msvc', 'static', 'windows', 'windows-2019', '.exe', True, True, '.pdb', '' ),
|
||||
( 'x86', 'windows', 'msvc', 'dynamic', 'windows', 'windows-2019', '.exe', False, False, None, '' ),
|
||||
# I have no idea how to separate debug info on macos
|
||||
( 'x86_64', 'darwin', 'macos', 'static', 'darwin', 'macos-11.0', '', True, True, None, '' ),
|
||||
( 'x86_64', 'darwin', 'macos', 'dynamic', 'darwin', 'macos-11.0', '', False, False, None, '' ),
|
||||
( 'aarch64', 'darwin', 'macos', 'static', 'darwin', 'macos-11.0', '', True, True, None, '' ),
|
||||
# macos-11.0 is x86_64 and I haven't yet figured out how to get homebrew to install aarch64 libs on x86_64
|
||||
# ( 'aarch64', 'darwin', 'macos', 'dynamic', 'darwin', 'macos-11.0', '', False, False, None, '' ),
|
||||
( 'x86', 'android', 'bionic', 'static', 'linux', 'ubuntu-18.04', '.apk', True, True, '.dbg', '' ),
|
||||
( 'x86_64', 'android', 'bionic', 'static', 'linux', 'ubuntu-18.04', '.apk', True, True, '.dbg', '' ),
|
||||
( 'arm', 'android', 'bionic', 'static', 'linux', 'ubuntu-18.04', '.apk', True, True, '.dbg', '' ),
|
||||
( 'aarch64', 'android', 'bionic', 'static', 'linux', 'ubuntu-18.04', '.apk', True, True, '.dbg', '' ),
|
||||
]:
|
||||
separate_debug = True
|
||||
if not debug_suffix:
|
||||
debug_suffix = ''
|
||||
separate_debug = False
|
||||
for debug_release in [ 'debug', 'release' ]:
|
||||
configurations.append({
|
||||
'bsh_build_platform': bsh_build_platform,
|
||||
'bsh_host_arch': bsh_host_arch,
|
||||
'bsh_host_platform': bsh_host_platform,
|
||||
'bsh_host_libc': bsh_host_libc,
|
||||
'bsh_static_dynamic': bsh_static_dynamic,
|
||||
'bsh_debug_release': debug_release,
|
||||
'runs_on': runs_on,
|
||||
'package_suffix': package_suffix,
|
||||
'publish': publish and 'yes' or 'no',
|
||||
'artifact': artifact and 'yes' or 'no',
|
||||
'separate_debug': separate_debug and 'yes' or 'no',
|
||||
'asset_path': f'powder{package_suffix}',
|
||||
'asset_name': f'powder-{release_name}-{bsh_host_arch}-{bsh_host_platform}-{bsh_host_libc}{package_suffix}',
|
||||
'debug_asset_path': f'powder{debug_suffix}',
|
||||
'debug_asset_name': f'powder-{release_name}-{bsh_host_arch}-{bsh_host_platform}-{bsh_host_libc}{debug_suffix}',
|
||||
'starcatcher_name': starcatcher_name,
|
||||
})
|
||||
|
||||
print('::set-output name=matrix::' + json.dumps({ 'include': configurations }))
|
||||
print('::set-output name=do_release::' + (ref.startswith('refs/tags/v') and 'yes' or 'no'))
|
||||
print('::set-output name=do_publish::' + ((publish_hostport and (match_stable or match_beta or match_snapshot)) and 'yes' or 'no'))
|
5
.github/starcatcher-check.sh
vendored
5
.github/starcatcher-check.sh
vendored
@ -1,5 +0,0 @@
|
||||
if [ ! -z "$STARCATCHER_PUBLISH_HOSTPORT" ]; then
|
||||
echo ::set-output name=can_publish::yes
|
||||
else
|
||||
echo ::set-output name=can_publish::no
|
||||
fi
|
7
.github/starcatcher-publish.sh
vendored
7
.github/starcatcher-publish.sh
vendored
@ -1,5 +1,4 @@
|
||||
#!/bin/sh
|
||||
#!/usr/bin/env bash
|
||||
|
||||
cd "$STARCATCHER_PUBLISH_FILENAME"
|
||||
mv "$1" "$STARCATCHER_PUBLISH_FILENAME"
|
||||
LFTP_PASSWORD=$STARCATCHER_PUBLISH_PASSWORD lftp -c "open --user '$STARCATCHER_PUBLISH_USERNAME' --env-password -e 'set ftp:ssl-protect-data true; set ssl:verify-certificate false; put \"$STARCATCHER_PUBLISH_FILENAME\";' ftp://$STARCATCHER_PUBLISH_HOSTPORT"
|
||||
cp "$ASSET_PATH" "$PUBLISH_FILENAME"
|
||||
LFTP_PASSWORD=$PUBLISH_PASSWORD lftp -c "open --user '$PUBLISH_USERNAME' --env-password -e 'set ftp:ssl-protect-data true; set ssl:verify-certificate false; put \"$PUBLISH_FILENAME\";' ftp://$PUBLISH_HOSTPORT"
|
||||
|
4
.github/starcatcher-release.sh
vendored
4
.github/starcatcher-release.sh
vendored
@ -1,6 +1,6 @@
|
||||
#!/bin/sh
|
||||
#!/usr/bin/env bash
|
||||
|
||||
curl $1 > perform_release
|
||||
curl "https://starcatcher.us/TPT/perform-release.lua?mod=$MOD_ID&type=$RELEASE_TYPE&name=$RELEASE_NAME&commit=$GITHUB_SHA" > perform_release
|
||||
if ! grep "Release complete" < perform_release > /dev/null; then
|
||||
cat perform_release
|
||||
exit 1
|
||||
|
28
.github/vs-env.sh
vendored
Normal file
28
.github/vs-env.sh
vendored
Normal file
@ -0,0 +1,28 @@
|
||||
set -euo pipefail
|
||||
IFS=$'\t\n'
|
||||
|
||||
IFS=$'\t\n\r'
|
||||
for i in $("$(env | grep '^ProgramFiles(x86)=' | cut -d = -f 2-)/Microsoft Visual Studio/Installer/vswhere.exe" \
|
||||
-sort \
|
||||
-prerelease \
|
||||
-requiresAny \
|
||||
-requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 \
|
||||
-requires Microsoft.VisualStudio.Workload.WDExpress \
|
||||
-products \* \
|
||||
-utf8 \
|
||||
-property installationPath); do
|
||||
if ! [ -z ${2-} ]; then
|
||||
if ! echo $i | grep $2 >/dev/null; then
|
||||
continue
|
||||
fi
|
||||
fi
|
||||
vs_install_dir=$i
|
||||
break
|
||||
done
|
||||
IFS=$'\t\n'
|
||||
|
||||
for i in $(MSYS_NO_PATHCONV=1 cmd /c "$vs_install_dir\\VC\\Auxiliary\\Build\\vcvarsall.bat" $1 \& env \& exit /b); do
|
||||
set +e
|
||||
export "$i" 2>/dev/null
|
||||
set -e
|
||||
done
|
288
.github/workflows/build.yaml
vendored
288
.github/workflows/build.yaml
vendored
@ -13,248 +13,118 @@ on:
|
||||
- '*'
|
||||
|
||||
jobs:
|
||||
release:
|
||||
prepare:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
||||
can_publish: ${{ steps.starcatcher_check.outputs.can_publish }}
|
||||
release_upload_url: ${{ steps.create_release.outputs.upload_url }}
|
||||
do_release: ${{ steps.prepare.outputs.do_release }}
|
||||
matrix: ${{ steps.prepare.outputs.matrix }}
|
||||
release_type: ${{ steps.prepare.outputs.release_type }}
|
||||
release_name: ${{ steps.prepare.outputs.release_name }}
|
||||
mod_id: ${{ steps.prepare.outputs.mod_id }}
|
||||
do_publish: ${{ steps.prepare.outputs.do_publish }}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: '3.10'
|
||||
- id: get_type
|
||||
run: python3 ./.github/get-type.py ${{ github.ref }}
|
||||
- id: create_release
|
||||
if: steps.get_type.outputs.TYPE != 'dev'
|
||||
- id: prepare
|
||||
run: python ./.github/prepare.py
|
||||
env:
|
||||
PUBLISH_HOSTPORT: ${{ secrets.STARCATCHER_PUBLISH_HOSTPORT }}
|
||||
GITHUB_REF: ${{ github.ref }}
|
||||
- if: steps.prepare.outputs.do_release == 'yes'
|
||||
id: create_release
|
||||
uses: actions/create-release@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
tag_name: ${{ github.ref }}
|
||||
release_name: ${{ steps.get_type.outputs.NAME }}
|
||||
release_name: ${{ steps.prepare.outputs.release_name }}
|
||||
draft: true
|
||||
prerelease: false
|
||||
- id: starcatcher_check
|
||||
if: steps.get_type.outputs.TYPE != 'dev'
|
||||
run: bash -c './.github/starcatcher-check.sh'
|
||||
env:
|
||||
STARCATCHER_PUBLISH_HOSTPORT: ${{ secrets.STARCATCHER_PUBLISH_HOSTPORT }}
|
||||
build:
|
||||
runs-on: ${{ matrix.os }}
|
||||
needs: [release]
|
||||
runs-on: ${{ matrix.runs_on }}
|
||||
needs: [prepare]
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
# | x86_64 | i686 | arm64 | arm
|
||||
# | lin | mac | win | and | lin | mac | win | and | lin | mac | win | and | lin | mac | win | and
|
||||
# ---------------+------+------+------+------+------+------+------+------+------+------+------+------+------+------+------+------
|
||||
# gcc | | | NO | | NO | NO | NO | | NO | | NO | | NO | NO | NO |
|
||||
# static msvc | NO | NO | | NO | NO | NO | | NO | NO | NO | NO | NO | NO | NO | NO | NO
|
||||
# mingw | | NO | | NO | NO | NO | NO | NO | NO | NO | NO | NO | NO | NO | NO | NO
|
||||
# gcc | | | NO | NO | NO | NO | NO | NO | NO |NO [1]| NO | NO | NO | NO | NO | NO
|
||||
# dynamic msvc | NO | NO | | NO | NO | NO | | NO | NO | NO | NO | NO | NO | NO | NO | NO
|
||||
# mingw | | NO | | NO | NO | NO | NO | NO | NO | NO | NO | NO | NO | NO | NO | NO
|
||||
#
|
||||
# [1] This is only required for development on ARM Macs. We have no access to such devices, so someone will
|
||||
# have to help us figure out how to get dynamic libraries.
|
||||
#
|
||||
# Please keep this matrix in sync with the other one in this file, see the ### blocks.
|
||||
# The only difference should be that the second matrix has all mingw cells disabled; we don't publish mingw builds on starcatcher.
|
||||
#########################################################
|
||||
############# BEGIN BLOCK FOR COPYING BELOW #############
|
||||
#########################################################
|
||||
machine_short: [x86_64, i686, arm64, arm]
|
||||
platform_short: [lin, mac, win, and]
|
||||
toolset_short: [gcc, msvc, mingw]
|
||||
static_dynamic: [static, dynamic]
|
||||
exclude:
|
||||
- toolset_short: mingw
|
||||
machine_short: i686 # remove this line after copying the matrix below
|
||||
- toolset_short: mingw # remove this line after copying the matrix below
|
||||
platform_short: mac # remove this line after copying the matrix below
|
||||
- machine_short: i686
|
||||
platform_short: lin
|
||||
- machine_short: i686
|
||||
platform_short: mac
|
||||
- toolset_short: msvc
|
||||
platform_short: lin
|
||||
- toolset_short: msvc
|
||||
platform_short: mac
|
||||
- toolset_short: gcc
|
||||
platform_short: win
|
||||
- platform_short: lin
|
||||
machine_short: arm64
|
||||
- platform_short: win
|
||||
machine_short: arm64
|
||||
- platform_short: mac # see [1]
|
||||
static_dynamic: dynamic
|
||||
machine_short: arm64
|
||||
- platform_short: and
|
||||
static_dynamic: dynamic
|
||||
- platform_short: and
|
||||
toolset_short: msvc
|
||||
- platform_short: and
|
||||
toolset_short: mingw
|
||||
- platform_short: lin
|
||||
machine_short: arm
|
||||
- platform_short: win
|
||||
machine_short: arm
|
||||
- platform_short: mac
|
||||
machine_short: arm
|
||||
#########################################################
|
||||
############## END BLOCK FOR COPYING BELOW ##############
|
||||
#########################################################
|
||||
include:
|
||||
- platform_short: lin
|
||||
os: ubuntu-18.04
|
||||
prefix: ''
|
||||
suffix: ''
|
||||
- platform_short: mac
|
||||
os: macos-11.0
|
||||
prefix: ''
|
||||
suffix: ''
|
||||
- platform_short: win
|
||||
os: windows-2019
|
||||
prefix: ''
|
||||
suffix: '.exe'
|
||||
- platform_short: lin
|
||||
toolset_short: mingw
|
||||
os: ubuntu-20.04
|
||||
prefix: ''
|
||||
suffix: '.exe'
|
||||
- platform_short: and
|
||||
os: ubuntu-18.04
|
||||
prefix: ''
|
||||
suffix: '.apk'
|
||||
matrix: ${{ fromJSON(needs.prepare.outputs.matrix) }}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: '3.10'
|
||||
- id: get_type
|
||||
run: python3 ./.github/get-type.py ${{ github.ref }}
|
||||
- if: matrix.platform_short == 'lin' && matrix.toolset_short == 'mingw'
|
||||
run: sudo apt update && sudo apt install g++-mingw-w64-x86-64
|
||||
- if: matrix.platform_short == 'mac'
|
||||
run: brew install pkg-config coreutils
|
||||
- if: matrix.platform_short == 'mac' && matrix.static_dynamic != 'static'
|
||||
- run: python -m pip install meson ninja
|
||||
- if: matrix.bsh_build_platform == 'darwin'
|
||||
run: brew install pkg-config coreutils binutils bash
|
||||
- if: matrix.bsh_build_platform == 'darwin' && matrix.bsh_static_dynamic != 'static'
|
||||
run: brew install luajit curl fftw zlib sdl2
|
||||
- if: matrix.platform_short == 'lin' && matrix.static_dynamic != 'static'
|
||||
- if: matrix.bsh_build_platform == 'linux' && matrix.bsh_host_libc == 'mingw'
|
||||
run: sudo apt update && sudo apt install g++-mingw-w64-x86-64
|
||||
- if: matrix.bsh_build_platform == 'linux' && matrix.bsh_static_dynamic != 'static'
|
||||
run: sudo apt update && sudo apt install libluajit-5.1-dev libcurl4-openssl-dev libfftw3-dev zlib1g-dev libsdl2-dev
|
||||
- run: python3 -m pip install meson ninja
|
||||
- if: matrix.bsh_build_platform == 'linux' && matrix.bsh_static_dynamic == 'static'
|
||||
run: sudo apt update && sudo apt install libc6-dev libc6-dev-i386
|
||||
- run: bash -c './.github/build.sh'
|
||||
env:
|
||||
PLATFORM_SHORT: ${{ matrix.platform_short }}
|
||||
MACHINE_SHORT: ${{ matrix.machine_short }}
|
||||
TOOLSET_SHORT: ${{ matrix.toolset_short }}
|
||||
STATIC_DYNAMIC: ${{ matrix.static_dynamic }}
|
||||
RELNAME: ${{ steps.get_type.outputs.NAME }}
|
||||
RELTYPE: ${{ steps.get_type.outputs.TYPE }}
|
||||
MOD_ID: ${{ steps.get_type.outputs.MOD_ID }}
|
||||
- uses: actions/upload-release-asset@v1
|
||||
if: steps.get_type.outputs.TYPE != 'dev' && matrix.static_dynamic == 'static'
|
||||
BSH_HOST_ARCH: ${{ matrix.bsh_host_arch }}
|
||||
BSH_HOST_PLATFORM: ${{ matrix.bsh_host_platform }}
|
||||
BSH_HOST_LIBC: ${{ matrix.bsh_host_libc }}
|
||||
BSH_STATIC_DYNAMIC: ${{ matrix.bsh_static_dynamic }}
|
||||
BSH_BUILD_PLATFORM: ${{ matrix.bsh_build_platform }}
|
||||
BSH_DEBUG_RELEASE: ${{ matrix.bsh_debug_release }}
|
||||
RELEASE_NAME: ${{ needs.prepare.outputs.release_name }}
|
||||
RELEASE_TYPE: ${{ needs.prepare.outputs.release_type }}
|
||||
MOD_ID: ${{ needs.prepare.outputs.mod_id }}
|
||||
ASSET_PATH: ${{ matrix.asset_path }}
|
||||
DEBUG_ASSET_PATH: ${{ matrix.debug_asset_path }}
|
||||
SEPARATE_DEBUG: ${{ matrix.separate_debug }}
|
||||
- uses: actions/upload-release-asset@v1 # TODO-NTL: ship licenses
|
||||
if: needs.prepare.outputs.do_release == 'yes' && matrix.publish == 'yes'
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
upload_url: ${{ needs.release.outputs.upload_url }}
|
||||
asset_path: ${{ matrix.prefix }}powder${{ matrix.suffix }}
|
||||
asset_name: ${{ matrix.prefix }}powder-${{ steps.get_type.outputs.NAME }}-${{ matrix.machine_short }}-${{ matrix.platform_short }}-${{ matrix.toolset_short }}-${{ matrix.static_dynamic }}${{ matrix.suffix }}
|
||||
asset_content_type: application/zip
|
||||
- uses: actions/upload-artifact@v2
|
||||
if: matrix.static_dynamic == 'static'
|
||||
with:
|
||||
path: ${{ matrix.prefix }}powder${{ matrix.suffix }}
|
||||
name: ${{ matrix.prefix }}powder-${{ steps.get_type.outputs.NAME }}-${{ matrix.machine_short }}-${{ matrix.platform_short }}-${{ matrix.toolset_short }}-${{ matrix.static_dynamic }}${{ matrix.suffix }}
|
||||
starcatcher-publish:
|
||||
runs-on: ubuntu-latest
|
||||
needs: [build, release]
|
||||
if: needs.release.outputs.can_publish == 'yes' && startsWith(github.ref, 'refs/tags/') # not a perfect match but get-type.py takes care of this in job build
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
#########################################################
|
||||
############# BEGIN BLOCK COPIED FROM ABOVE #############
|
||||
#########################################################
|
||||
machine_short: [x86_64, i686, arm64, arm]
|
||||
platform_short: [lin, mac, win, and]
|
||||
toolset_short: [gcc, msvc, mingw]
|
||||
static_dynamic: [static, dynamic]
|
||||
exclude:
|
||||
- toolset_short: mingw
|
||||
- machine_short: i686
|
||||
platform_short: lin
|
||||
- machine_short: i686
|
||||
platform_short: mac
|
||||
- toolset_short: msvc
|
||||
platform_short: lin
|
||||
- toolset_short: msvc
|
||||
platform_short: mac
|
||||
- toolset_short: gcc
|
||||
platform_short: win
|
||||
- platform_short: lin
|
||||
machine_short: arm64
|
||||
- platform_short: win
|
||||
machine_short: arm64
|
||||
- platform_short: mac # see [1]
|
||||
static_dynamic: dynamic
|
||||
machine_short: arm64
|
||||
- platform_short: and
|
||||
static_dynamic: dynamic
|
||||
- platform_short: and
|
||||
toolset_short: msvc
|
||||
- platform_short: and
|
||||
toolset_short: mingw
|
||||
- platform_short: lin
|
||||
machine_short: arm
|
||||
- platform_short: win
|
||||
machine_short: arm
|
||||
- platform_short: mac
|
||||
machine_short: arm
|
||||
#########################################################
|
||||
############## END BLOCK COPIED FROM ABOVE ##############
|
||||
#########################################################
|
||||
- static_dynamic: dynamic
|
||||
include:
|
||||
- platform_short: lin
|
||||
prefix: ''
|
||||
suffix: ''
|
||||
- platform_short: mac
|
||||
prefix: ''
|
||||
suffix: ''
|
||||
- platform_short: win
|
||||
prefix: ''
|
||||
suffix: '.exe'
|
||||
- platform_short: and
|
||||
prefix: ''
|
||||
suffix: '.apk'
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: '3.10'
|
||||
- id: get_type
|
||||
run: python3 ./.github/get-type.py ${{ github.ref }}
|
||||
- uses: actions/download-artifact@v1
|
||||
with:
|
||||
name: ${{ matrix.prefix }}powder-${{ steps.get_type.outputs.NAME }}-${{ matrix.machine_short }}-${{ matrix.platform_short }}-${{ matrix.toolset_short }}-${{ matrix.static_dynamic }}${{ matrix.suffix }}
|
||||
- run: sudo apt update && sudo apt install lftp
|
||||
- if: steps.get_type.outputs.TYPE != 'dev' && matrix.static_dynamic == 'static'
|
||||
run: bash -c './.github/starcatcher-publish.sh ${{ matrix.prefix }}powder${{ matrix.suffix }}'
|
||||
upload_url: ${{ needs.prepare.outputs.release_upload_url }}
|
||||
asset_path: build/${{ matrix.asset_path }}
|
||||
asset_name: ${{ matrix.asset_name }}
|
||||
- uses: actions/upload-release-asset@v1
|
||||
if: needs.prepare.outputs.do_release == 'yes' && matrix.publish == 'yes' && matrix.separate_debug == 'yes'
|
||||
env:
|
||||
STARCATCHER_PUBLISH_HOSTPORT: ${{ secrets.STARCATCHER_PUBLISH_HOSTPORT }}
|
||||
STARCATCHER_PUBLISH_USERNAME: ${{ secrets.STARCATCHER_PUBLISH_USERNAME }}
|
||||
STARCATCHER_PUBLISH_PASSWORD: ${{ secrets.STARCATCHER_PUBLISH_PASSWORD }}
|
||||
STARCATCHER_PUBLISH_FILENAME: ${{ matrix.prefix }}powder-${{ steps.get_type.outputs.NAME }}-${{ matrix.machine_short }}-${{ matrix.platform_short }}-${{ matrix.toolset_short }}-${{ matrix.static_dynamic }}${{ matrix.suffix }}
|
||||
starcatcher-release:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
upload_url: ${{ needs.prepare.outputs.release_upload_url }}
|
||||
asset_path: build/${{ matrix.debug_asset_path }}
|
||||
asset_name: ${{ matrix.debug_asset_name }}
|
||||
- uses: actions/upload-artifact@v2
|
||||
if: matrix.artifact == 'yes'
|
||||
with:
|
||||
path: build/${{ matrix.asset_path }}
|
||||
name: ${{ matrix.asset_name }}
|
||||
- uses: actions/upload-artifact@v2
|
||||
if: matrix.artifact == 'yes' && matrix.separate_debug == 'yes'
|
||||
with:
|
||||
path: build/${{ matrix.debug_asset_path }}
|
||||
name: ${{ matrix.debug_asset_name }}
|
||||
- if: needs.prepare.outputs.do_publish == 'yes' && matrix.publish == 'yes'
|
||||
run: sudo apt update && sudo apt install lftp && bash -c './.github/starcatcher-publish.sh
|
||||
env:
|
||||
ASSET_PATH: build/${{ matrix.asset_path }}
|
||||
PUBLISH_HOSTPORT: ${{ secrets.STARCATCHER_PUBLISH_HOSTPORT }}
|
||||
PUBLISH_USERNAME: ${{ secrets.STARCATCHER_PUBLISH_USERNAME }}
|
||||
PUBLISH_PASSWORD: ${{ secrets.STARCATCHER_PUBLISH_PASSWORD }}
|
||||
PUBLISH_FILENAME: ${{ matrix.starcatcher_name }}
|
||||
publish:
|
||||
runs-on: ubuntu-latest
|
||||
needs: [starcatcher-publish, release]
|
||||
if: needs.release.outputs.can_publish == 'yes' && startsWith(github.ref, 'refs/tags/') # not a perfect match but get-type.py takes care of this in job build
|
||||
needs: [build, prepare]
|
||||
if: needs.prepare.outputs.do_publish == 'yes'
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: '3.10'
|
||||
- id: get_type
|
||||
run: python3 ./.github/get-type.py ${{ github.ref }}
|
||||
- run: ./.github/starcatcher-release.sh "https://starcatcher.us/TPT/perform-release.lua?mod=${{ steps.get_type.outputs.MOD_ID }}&type=${{ steps.get_type.outputs.TYPE }}&name=${{ steps.get_type.outputs.NAME }}&commit=${{ github.sha }}"
|
||||
- run: ./.github/starcatcher-release.sh
|
||||
env:
|
||||
RELEASE_NAME: ${{ needs.prepare.outputs.release_name }}
|
||||
RELEASE_TYPE: ${{ needs.prepare.outputs.release_type }}
|
||||
MOD_ID: ${{ needs.prepare.outputs.mod_id }}
|
||||
GITHUB_SHA: ${{ github.sha }}
|
||||
|
@ -23,11 +23,11 @@ import sys
|
||||
*resources,
|
||||
) = sys.argv
|
||||
|
||||
if tpt_arch == 'i686':
|
||||
if tpt_arch == 'x86':
|
||||
android_arch = 'x86'
|
||||
if tpt_arch == 'arm':
|
||||
android_arch = 'armeabi-v7a'
|
||||
if tpt_arch == 'arm64':
|
||||
if tpt_arch == 'aarch64':
|
||||
android_arch = 'arm64-v8a'
|
||||
if tpt_arch == 'x86_64':
|
||||
android_arch = 'x86_64'
|
||||
|
@ -4,3 +4,96 @@ powder_jar_sources = files(
|
||||
)
|
||||
|
||||
subdir('res')
|
||||
|
||||
python3 = find_program('python3')
|
||||
android_platform_jar = meson.get_external_property('android_platform_jar')
|
||||
java_runtime_jar = meson.get_external_property('java_runtime_jar')
|
||||
android_keystore = get_option('android_keystore')
|
||||
sdl_jar = tpt_libs.get_variable('sdl_jar')
|
||||
powder_jar = custom_target(
|
||||
'powder-jar',
|
||||
output: 'powder.jar',
|
||||
command: [
|
||||
python3,
|
||||
files('powder-jar.py'),
|
||||
find_program('javac'),
|
||||
find_program('jar'),
|
||||
meson.current_source_dir(),
|
||||
meson.project_build_root(),
|
||||
'@PRIVATE_DIR@',
|
||||
'@OUTPUT@',
|
||||
android_platform_jar,
|
||||
java_runtime_jar,
|
||||
sdl_jar,
|
||||
is_debug ? 'debug' : 'release',
|
||||
powder_jar_sources,
|
||||
],
|
||||
)
|
||||
unaligned_apk = custom_target(
|
||||
'build-apk',
|
||||
output: 'powder.unaligned.apk',
|
||||
input: powder_sha,
|
||||
command: [
|
||||
python3,
|
||||
files('build-apk.py'),
|
||||
find_program('d8'),
|
||||
find_program('aapt'),
|
||||
find_program('aapt2'),
|
||||
meson.current_source_dir(),
|
||||
meson.project_build_root(),
|
||||
'@PRIVATE_DIR@',
|
||||
'@OUTPUT@',
|
||||
'@INPUT@',
|
||||
android_platform_jar,
|
||||
sdl_jar,
|
||||
powder_jar,
|
||||
host_arch,
|
||||
is_debug ? 'debug' : 'release',
|
||||
android_manifest_xml,
|
||||
android_resources,
|
||||
],
|
||||
)
|
||||
unsigned_apk = custom_target(
|
||||
'align-apk',
|
||||
output: 'powder.unsigned.apk',
|
||||
input: unaligned_apk,
|
||||
command: [
|
||||
python3,
|
||||
files('align-apk.py'),
|
||||
find_program('zipalign'),
|
||||
meson.project_build_root(),
|
||||
'@OUTPUT@',
|
||||
'@INPUT@',
|
||||
],
|
||||
)
|
||||
signed_apk = custom_target(
|
||||
'sign-apk',
|
||||
output: 'powder.apk',
|
||||
input: unsigned_apk,
|
||||
command: [
|
||||
python3,
|
||||
files('sign-apk.py'),
|
||||
find_program('apksigner'),
|
||||
meson.project_build_root(),
|
||||
'@OUTPUT@',
|
||||
'@INPUT@',
|
||||
android_keystore,
|
||||
get_option('android_keyalias'),
|
||||
],
|
||||
)
|
||||
adb = find_program('adb', required: false)
|
||||
if adb.found()
|
||||
install_apk = custom_target(
|
||||
'install-apk',
|
||||
input: signed_apk,
|
||||
output: 'install-apk',
|
||||
command: [ python3, files('install-apk.py'), adb, meson.project_build_root(), '@OUTPUT@', '@INPUT@' ],
|
||||
)
|
||||
custom_target(
|
||||
'run-apk',
|
||||
input: [ signed_apk, install_apk ],
|
||||
build_always_stale: true,
|
||||
output: 'run-apk',
|
||||
command: [ python3, files('run-apk.py'), adb, meson.project_build_root(), '@OUTPUT@', '@INPUT0@' ],
|
||||
)
|
||||
endif
|
||||
|
@ -3,11 +3,13 @@ andriod_ndk_toolchain_bin = '/opt/android-sdk/ndk-bundle/toolchains/llvm/prebuil
|
||||
|
||||
[properties]
|
||||
# only needed if you want to run the custom target powder_apk (powder.apk)
|
||||
android_platform_jar = '/opt/android-sdk/platforms/android-30/android.jar'
|
||||
# android_ndk_toolchain_prefix comes from the correct cross-file in ./android/cross
|
||||
android_ndk_toolchain_prefix = android_ndk_toolchain_prefix
|
||||
android_platform = 'android-30'
|
||||
android_platform_jar = '/opt/android-sdk/platforms/' + android_platform + '/android.jar'
|
||||
java_runtime_jar = '/usr/lib/jvm/java-8-openjdk/jre/lib/rt.jar'
|
||||
|
||||
[binaries]
|
||||
# android_ndk_toolchain_prefix comes from the correct cross-file in ./android/cross
|
||||
c = andriod_ndk_toolchain_bin / (android_ndk_toolchain_prefix + 'clang')
|
||||
# c = [ 'ccache', andriod_ndk_toolchain_bin / (android_ndk_toolchain_prefix + 'clang') ]
|
||||
cpp = andriod_ndk_toolchain_bin / (android_ndk_toolchain_prefix + 'clang++')
|
||||
|
@ -1,12 +1,6 @@
|
||||
[built-in options]
|
||||
c_args = [ '-arch', 'arm64', '-mmacosx-version-min=10.15' ]
|
||||
cpp_args = [ '-arch', 'arm64', '-mmacosx-version-min=10.15' ]
|
||||
c_link_args = [ '-arch', 'arm64', '-mmacosx-version-min=10.15' ]
|
||||
cpp_link_args = [ '-arch', 'arm64', '-mmacosx-version-min=10.15' ]
|
||||
|
||||
[binaries]
|
||||
c = 'clang'
|
||||
cpp = 'clang++'
|
||||
c = [ 'clang', '-arch', 'arm64' ]
|
||||
cpp = [ 'clang++', '-arch', 'arm64' ]
|
||||
strip = 'strip'
|
||||
|
||||
[host_machine]
|
||||
|
550
meson.build
550
meson.build
@ -1,7 +1,17 @@
|
||||
project('the-powder-toy', [ 'c', 'cpp' ], version: 'the.cake.is.a.lie', default_options: [
|
||||
'cpp_std=c++17',
|
||||
'build.cpp_std=c++17', # used when cross-compiling
|
||||
])
|
||||
project(
|
||||
'the-powder-toy',
|
||||
[ 'c', 'cpp' ],
|
||||
version: 'the.cake.is.a.lie',
|
||||
default_options: [
|
||||
'c_std=c99',
|
||||
'cpp_std=c++17',
|
||||
'cpp_rtti=false',
|
||||
'build.c_std=c99', # used by to_array
|
||||
'build.cpp_std=c++17', # used by to_array
|
||||
'build.cpp_rtti=false', # used by to_array
|
||||
],
|
||||
meson_version: '>=0.61.0',
|
||||
)
|
||||
|
||||
to_array = generator(
|
||||
executable('toarray', sources: 'data/ToArray.cpp', native: true),
|
||||
@ -10,182 +20,165 @@ to_array = generator(
|
||||
)
|
||||
|
||||
c_compiler = meson.get_compiler('c')
|
||||
copt_x86 = false
|
||||
copt_64bit = false
|
||||
copt_msvc = false
|
||||
|
||||
is_x86 = host_machine.cpu_family() in [ 'x86', 'x86_64' ]
|
||||
is_64bit = host_machine.cpu_family() in [ 'aarch64', 'x86_64' ]
|
||||
is_msvc = c_compiler.get_id() in [ 'msvc' ]
|
||||
|
||||
host_arch = host_machine.cpu_family()
|
||||
host_platform = host_machine.system()
|
||||
# educated guesses follow, PRs welcome
|
||||
if c_compiler.get_id() in [ 'msvc' ]
|
||||
copt_compiler = 'msvc'
|
||||
copt_msvc = true
|
||||
elif c_compiler.get_id() in [ 'gcc', 'clang' ]
|
||||
copt_compiler = 'gcc'
|
||||
else
|
||||
warning('unsupported compiler: ' + c_compiler.get_id() + '; you are on your own')
|
||||
copt_compiler = 'gcc'
|
||||
endif
|
||||
if host_machine.cpu_family() in [ 'x86_64' ]
|
||||
copt_architecture = 'x86_64'
|
||||
copt_x86 = true
|
||||
copt_64bit = true
|
||||
elif host_machine.cpu_family() in [ 'x86' ]
|
||||
copt_architecture = 'i686'
|
||||
copt_x86 = true
|
||||
elif host_machine.cpu_family() in [ 'aarch64' ]
|
||||
copt_architecture = 'arm64'
|
||||
copt_64bit = true
|
||||
elif host_machine.cpu_family() in [ 'arm' ]
|
||||
copt_architecture = 'arm'
|
||||
else
|
||||
warning('unsupported architecture: ' + host_machine.cpu_family() + '; you are on your own')
|
||||
copt_architecture = 'i686'
|
||||
endif
|
||||
if host_machine.system() in [ 'linux', 'freebsd' ]
|
||||
copt_platform = 'lin'
|
||||
elif host_machine.system() in [ 'windows' ]
|
||||
copt_platform = 'win'
|
||||
elif host_machine.system() in [ 'darwin' ]
|
||||
copt_platform = 'mac'
|
||||
elif host_machine.system() in [ 'android' ]
|
||||
copt_platform = 'and'
|
||||
else
|
||||
warning('unsupported platform: ' + host_machine.system() + '; you are on your own')
|
||||
copt_platform = 'lin'
|
||||
endif
|
||||
uopt_static = get_option('static')
|
||||
use_tpt_libs = 'no'
|
||||
if uopt_static == 'system'
|
||||
if copt_platform == 'win'
|
||||
error('no way to find static system libraries on windows')
|
||||
host_libc = 'msvc'
|
||||
elif c_compiler.get_id() in [ 'gcc' ] and host_platform == 'windows'
|
||||
host_libc = 'mingw'
|
||||
if get_option('b_lto')
|
||||
warning('mingw does not like static + lto')
|
||||
endif
|
||||
elif uopt_static == 'prebuilt'
|
||||
use_tpt_libs = 'static'
|
||||
elif copt_platform == 'win'
|
||||
use_tpt_libs = 'dynamic'
|
||||
elif copt_platform == 'and'
|
||||
use_tpt_libs = 'static'
|
||||
elif host_platform in [ 'darwin' ]
|
||||
host_libc = 'macos'
|
||||
elif host_platform in [ 'android' ]
|
||||
host_platform = 'android'
|
||||
host_libc = 'bionic'
|
||||
else
|
||||
host_libc = 'gnu'
|
||||
endif
|
||||
|
||||
static_variant = get_option('static')
|
||||
if static_variant != 'prebuilt' and host_platform == 'android'
|
||||
warning('only prebuilt libs are supported for android')
|
||||
static_variant = 'prebuilt'
|
||||
endif
|
||||
if static_variant == 'system' and host_platform == 'windows'
|
||||
warning('no way to find system libs on windows')
|
||||
static_variant = 'prebuilt'
|
||||
endif
|
||||
|
||||
is_static = static_variant != 'none'
|
||||
is_debug = get_option('optimization') in [ '0', 'g' ]
|
||||
|
||||
tpt_libs_static = 'none'
|
||||
if static_variant == 'prebuilt'
|
||||
tpt_libs_static = 'static'
|
||||
endif
|
||||
if static_variant == 'none' and host_platform == 'windows'
|
||||
tpt_libs_static = 'dynamic'
|
||||
endif
|
||||
tpt_libs_debug = is_debug ? 'debug' : 'release'
|
||||
tpt_libs_variant = '@0@-@1@-@2@-@3@'.format(host_arch, host_platform, host_libc, tpt_libs_static)
|
||||
tpt_libs_vtag = get_option('tpt_libs_vtag')
|
||||
if tpt_libs_vtag == ''
|
||||
tpt_libs_vtag = 'v20220901212941'
|
||||
endif
|
||||
if tpt_libs_static != 'none'
|
||||
if tpt_libs_variant not in [
|
||||
'x86_64-linux-gnu-static',
|
||||
'x86_64-windows-mingw-static',
|
||||
'x86_64-windows-mingw-dynamic',
|
||||
'x86_64-windows-msvc-static',
|
||||
'x86_64-windows-msvc-dynamic',
|
||||
'x86-windows-msvc-static',
|
||||
'x86-windows-msvc-dynamic',
|
||||
'x86_64-darwin-macos-static',
|
||||
'aarch64-darwin-macos-static',
|
||||
'x86-android-bionic-static',
|
||||
'x86_64-android-bionic-static',
|
||||
'arm-android-bionic-static',
|
||||
'aarch64-android-bionic-static',
|
||||
]
|
||||
error('no prebuilt @0@ libraries are currently provided'.format(tpt_libs_variant))
|
||||
endif
|
||||
tpt_libs = subproject('tpt-libs-prebuilt-@0@-@1@-@2@'.format(tpt_libs_variant, tpt_libs_debug, tpt_libs_vtag))
|
||||
endif
|
||||
|
||||
conf_data = configuration_data()
|
||||
conf_data.set('CURL_STATICLIB', false)
|
||||
conf_data.set('ZLIB_WINAPI', false)
|
||||
|
||||
if get_option('ogli') or get_option('oglr')
|
||||
error('OpenGL features are currently unavailable')
|
||||
x86_sse_level_str = get_option('x86_sse')
|
||||
if x86_sse_level_str == 'auto'
|
||||
x86_sse_level = 20
|
||||
if not is_x86 or not is_64bit or host_platform == 'darwin'
|
||||
x86_sse_level = 0
|
||||
endif
|
||||
elif x86_sse_level_str == 'sse3'
|
||||
x86_sse_level = 30
|
||||
elif x86_sse_level_str == 'sse2'
|
||||
x86_sse_level = 20
|
||||
elif x86_sse_level_str == 'sse'
|
||||
x86_sse_level = 10
|
||||
elif x86_sse_level_str == 'none'
|
||||
x86_sse_level = 0
|
||||
endif
|
||||
|
||||
tpt_libs_vtag = get_option('tpt_libs_vtag')
|
||||
if tpt_libs_vtag == ''
|
||||
tpt_libs_vtag = 'v20220414193335'
|
||||
lua_variant = get_option('lua')
|
||||
if lua_variant == 'auto'
|
||||
lua_variant = 'luajit'
|
||||
# TODO: sometimes luajit is not available
|
||||
endif
|
||||
if use_tpt_libs != 'no'
|
||||
nope = false
|
||||
if copt_architecture == 'i686' and not copt_msvc
|
||||
nope = true
|
||||
# TODO: check UNICODE on windows
|
||||
if lua_variant == 'none'
|
||||
lua_dep = []
|
||||
elif lua_variant == 'lua5.1' or lua_variant == 'lua5.2'
|
||||
lua_dep = dependency(lua_variant + '-c++', static: is_static, required: false)
|
||||
if not lua_dep.found()
|
||||
lua_dep = dependency(lua_variant, static: is_static)
|
||||
warning('your system @0@ might not be compatible with C++'.format(lua_variant))
|
||||
endif
|
||||
if copt_architecture == 'x86_64' and (copt_platform == 'lin' or copt_platform == 'mac') and copt_compiler != 'gcc'
|
||||
nope = true
|
||||
endif
|
||||
if copt_architecture == 'arm64' and copt_platform != 'mac'
|
||||
nope = true
|
||||
endif
|
||||
if copt_platform == 'and'
|
||||
nope = false
|
||||
endif
|
||||
quad_compiler = copt_compiler
|
||||
if copt_platform == 'win' and copt_compiler == 'gcc'
|
||||
quad_compiler = 'mingw'
|
||||
if get_option('b_lto')
|
||||
error('mingw does not like static + lto, you will have to disable this error if you want to proceed')
|
||||
endif
|
||||
endif
|
||||
if nope
|
||||
error('no prebuilt @0@-@1@-@2@-@3@ libraries are currently provided'.format(copt_architecture, copt_platform, quad_compiler, use_tpt_libs))
|
||||
endif
|
||||
tpt_libs = subproject('tpt-libs-prebuilt-@0@-@1@-@2@-@3@-@4@'.format(copt_architecture, copt_platform, quad_compiler, use_tpt_libs, tpt_libs_vtag))
|
||||
elif lua_variant == 'luajit'
|
||||
lua_dep = dependency('luajit', static: is_static)
|
||||
endif
|
||||
|
||||
uopt_native = get_option('native')
|
||||
uopt_x86_sse = get_option('x86_sse')
|
||||
if uopt_x86_sse == 'auto'
|
||||
uopt_x86_sse_level = 20
|
||||
elif uopt_x86_sse == 'sse3'
|
||||
uopt_x86_sse_level = 30
|
||||
elif uopt_x86_sse == 'sse2'
|
||||
uopt_x86_sse_level = 20
|
||||
elif uopt_x86_sse == 'sse'
|
||||
uopt_x86_sse_level = 10
|
||||
elif uopt_x86_sse == 'none'
|
||||
uopt_x86_sse_level = 0
|
||||
enable_http = get_option('http')
|
||||
if host_platform == 'android'
|
||||
enable_http = false
|
||||
endif
|
||||
if not copt_x86 or uopt_native
|
||||
uopt_x86_sse_level = 0
|
||||
if host_platform == 'android'
|
||||
android_ndk_toolchain_prefix = meson.get_external_property('android_ndk_toolchain_prefix')
|
||||
android_platform = meson.get_external_property('android_platform')
|
||||
tpt_libs_android_toolchain_prefix = tpt_libs.get_variable('android_toolchain_prefix')
|
||||
tpt_libs_android_system_version = tpt_libs.get_variable('android_system_version')
|
||||
tpt_libs_android_platform = tpt_libs.get_variable('android_platform')
|
||||
if '@0@@1@-'.format(tpt_libs_android_toolchain_prefix, tpt_libs_android_system_version) != android_ndk_toolchain_prefix
|
||||
error('tpt-libs android toolchain mismatch')
|
||||
endif
|
||||
if tpt_libs_android_platform != android_platform
|
||||
error('tpt-libs android platform mismatch')
|
||||
endif
|
||||
endif
|
||||
curl_dep = enable_http ? dependency('libcurl', static: is_static) : []
|
||||
|
||||
uopt_lua = get_option('lua')
|
||||
if copt_platform == 'and' and uopt_lua == 'luajit'
|
||||
message('LuaJIT is not supported on Android')
|
||||
uopt_lua = 'lua5.2'
|
||||
endif
|
||||
if uopt_lua == 'luajit'
|
||||
lua_opt_dep = [ use_tpt_libs != 'no' ? tpt_libs.get_variable('luajit_dep') : dependency('luajit', static: uopt_static == 'system') ]
|
||||
elif uopt_lua == 'lua5.2'
|
||||
lua_opt_dep = [ use_tpt_libs != 'no' ? tpt_libs.get_variable('lua52_dep') : dependency('lua5.2', static: uopt_static == 'system') ]
|
||||
elif uopt_lua == 'lua5.1'
|
||||
lua_opt_dep = [ use_tpt_libs != 'no' ? tpt_libs.get_variable('lua51_dep') : dependency('lua5.1', static: uopt_static == 'system') ]
|
||||
else
|
||||
lua_opt_dep = []
|
||||
endif
|
||||
|
||||
uopt_http = get_option('http')
|
||||
if uopt_http and copt_platform != 'and'
|
||||
curl_opt_dep = [ use_tpt_libs != 'no' ? tpt_libs.get_variable('libcurl_dep') : dependency('libcurl', static: uopt_static == 'system') ]
|
||||
else
|
||||
curl_opt_dep = []
|
||||
endif
|
||||
|
||||
uopt_fftw = get_option('gravfft')
|
||||
if uopt_fftw
|
||||
fftw_opt_dep = [ use_tpt_libs != 'no' ? tpt_libs.get_variable('fftw_dep') : dependency('fftw3f', static: uopt_static == 'system') ]
|
||||
else
|
||||
fftw_opt_dep = []
|
||||
endif
|
||||
enable_gravfft = get_option('gravfft')
|
||||
fftw_dep = enable_gravfft ? dependency('fftw3f', static: is_static) : []
|
||||
|
||||
threads_dep = dependency('threads')
|
||||
zlib_dep = use_tpt_libs != 'no' ? tpt_libs.get_variable('zlib_dep') : dependency('zlib', static: uopt_static == 'system')
|
||||
sdl2_dep = use_tpt_libs != 'no' ? tpt_libs.get_variable('sdl2_dep') : dependency('sdl2', static: uopt_static == 'system')
|
||||
sdl2main_dep = use_tpt_libs != 'no' ? tpt_libs.get_variable('sdl2main_dep') : []
|
||||
zlib_dep = dependency('zlib', static: is_static)
|
||||
sdl2_dep = dependency('sdl2', static: is_static) # TODO: check UNICODE on windows
|
||||
|
||||
project_link_args = []
|
||||
project_c_args = []
|
||||
project_cpp_args = []
|
||||
if copt_msvc
|
||||
if uopt_x86_sse_level >= 30
|
||||
message('SSE3 configured to be enabled but unavailable in msvc')
|
||||
uopt_x86_sse_level = 20
|
||||
if is_msvc
|
||||
if x86_sse_level >= 30
|
||||
warning('SSE3 configured to be enabled but unavailable in msvc')
|
||||
x86_sse_level = 20
|
||||
endif
|
||||
if uopt_native
|
||||
message('local machine optimization configured to be enabled but unavailable in msvc')
|
||||
uopt_native = false
|
||||
if is_64bit and x86_sse_level > 0
|
||||
warning('SSE explicitly configured but unavailable in msvc targeting 64-bit machines')
|
||||
x86_sse_level = 0
|
||||
endif
|
||||
args_msvc = [
|
||||
'/GS',
|
||||
'-D_SCL_SECURE_NO_WARNINGS',
|
||||
'-DUNICODE',
|
||||
'-D_UNICODE',
|
||||
'/D_SCL_SECURE_NO_WARNINGS',
|
||||
'/DUNICODE',
|
||||
'/D_UNICODE',
|
||||
]
|
||||
if copt_64bit
|
||||
message('SSE explicitly configured but unavailable in msvc targeting 64-bit machines')
|
||||
else
|
||||
if uopt_x86_sse_level >= 20
|
||||
args_msvc += [ '/arch:SSE2' ]
|
||||
elif uopt_x86_sse_level >= 10
|
||||
args_msvc += [ '/arch:SSE' ]
|
||||
endif
|
||||
if x86_sse_level >= 20
|
||||
args_msvc += [ '/arch:SSE2' ]
|
||||
elif x86_sse_level >= 10
|
||||
args_msvc += [ '/arch:SSE' ]
|
||||
endif
|
||||
if get_option('debug')
|
||||
project_link_args += [
|
||||
'/NODEFAULTLIB:MSVCRT',
|
||||
]
|
||||
else
|
||||
if not is_debug
|
||||
args_msvc += [
|
||||
'/Oy-',
|
||||
'/fp:fast',
|
||||
@ -198,40 +191,28 @@ if copt_msvc
|
||||
project_c_args += args_msvc
|
||||
project_cpp_args += args_msvc
|
||||
else
|
||||
args_ccomp = [ '-Wno-unused-result' ]
|
||||
if copt_platform == 'mac'
|
||||
if uopt_x86_sse_level >= 0
|
||||
message('SSE level explicitly configured but unavailable on macosx')
|
||||
uopt_x86_sse_level = 0
|
||||
endif
|
||||
if uopt_native
|
||||
message('local machine optimization configured to be enabled but unavailable on macosx')
|
||||
uopt_native = false
|
||||
endif
|
||||
else
|
||||
if uopt_x86_sse_level >= 30
|
||||
args_ccomp += [ '-msse3' ]
|
||||
endif
|
||||
if uopt_x86_sse_level >= 20
|
||||
args_ccomp += [ '-msse2' ]
|
||||
endif
|
||||
if uopt_x86_sse_level >= 10
|
||||
args_ccomp += [ '-msse' ]
|
||||
endif
|
||||
if uopt_native
|
||||
args_ccomp += [ '-march=native' ]
|
||||
endif
|
||||
args_ccomp = []
|
||||
if host_platform == 'darwin' and x86_sse_level > 0
|
||||
message('SSE level explicitly configured but unavailable on macosx')
|
||||
x86_sse_level = 0
|
||||
endif
|
||||
if copt_platform == 'win'
|
||||
if x86_sse_level >= 30
|
||||
args_ccomp += [ '-msse3' ]
|
||||
elif x86_sse_level >= 20
|
||||
args_ccomp += [ '-msse2' ]
|
||||
elif x86_sse_level >= 10
|
||||
args_ccomp += [ '-msse' ]
|
||||
endif
|
||||
if host_platform == 'windows'
|
||||
args_ccomp += [
|
||||
'-DUNICODE',
|
||||
'-D_UNICODE',
|
||||
]
|
||||
if uopt_static != 'none' and copt_platform != 'and'
|
||||
if is_static and host_platform != 'android'
|
||||
project_link_args += [ '-static', '-static-libgcc', '-static-libstdc++' ]
|
||||
endif
|
||||
endif
|
||||
if not get_option('debug')
|
||||
if not is_debug
|
||||
args_ccomp += [
|
||||
'-ftree-vectorize',
|
||||
'-funsafe-math-optimizations',
|
||||
@ -239,18 +220,23 @@ else
|
||||
'-fomit-frame-pointer',
|
||||
]
|
||||
endif
|
||||
if copt_platform == 'mac' and uopt_static == 'prebuilt'
|
||||
args_ccomp += [ '-mmacosx-version-min=10.9' ]
|
||||
project_link_args += [ '-mmacosx-version-min=10.9' ]
|
||||
if host_platform == 'darwin'
|
||||
if host_arch == 'aarch64'
|
||||
macosx_version_min = [ '-mmacosx-version-min=11.0' ]
|
||||
else
|
||||
macosx_version_min = [ '-mmacosx-version-min=10.9' ]
|
||||
endif
|
||||
args_ccomp += macosx_version_min
|
||||
project_link_args += macosx_version_min
|
||||
endif
|
||||
if copt_platform == 'and'
|
||||
if not copt_64bit
|
||||
if host_platform == 'android'
|
||||
if not is_64bit
|
||||
args_ccomp += [ '-U_FILE_OFFSET_BITS' ]
|
||||
endif
|
||||
project_link_args += [ '-static-libstdc++' ]
|
||||
else
|
||||
if not get_option('b_pie') and get_option('workaround_gcc_no_pie') # nice one, meson
|
||||
if copt_architecture != 'arm64' # no position independent executable for arm64
|
||||
if host_arch != 'aarch64' # no position independent executable for aarch64
|
||||
if c_compiler.get_id() in [ 'clang' ]
|
||||
project_link_args += [ '-Wl,-no_pie' ]
|
||||
else
|
||||
@ -259,33 +245,53 @@ else
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
project_c_args += args_ccomp
|
||||
project_cpp_args += args_ccomp + [ '-Wno-invalid-offsetof' ]
|
||||
project_c_args += args_ccomp + [
|
||||
'-Wno-implicit-fallthrough',
|
||||
'-Wno-missing-field-initializers',
|
||||
'-Wno-unused-result',
|
||||
'-Wno-unused-parameter',
|
||||
]
|
||||
project_cpp_args += args_ccomp + [
|
||||
'-Wno-invalid-offsetof',
|
||||
'-Wno-unused-result',
|
||||
'-Wno-missing-field-initializers',
|
||||
'-Wno-unused-parameter',
|
||||
]
|
||||
endif
|
||||
|
||||
if copt_platform == 'win'
|
||||
other_dep = tpt_libs.get_variable('other_dep')
|
||||
if host_platform == 'windows'
|
||||
args_ccomp_win = [ '-D_WIN32_WINNT=0x0501' ]
|
||||
project_c_args += args_ccomp_win
|
||||
project_cpp_args += args_ccomp_win
|
||||
windows_mod = import('windows')
|
||||
if uopt_static != 'none'
|
||||
if is_static
|
||||
conf_data.set('CURL_STATICLIB', true)
|
||||
if copt_architecture == 'x86_64'
|
||||
if host_arch == 'x86_64'
|
||||
conf_data.set('ZLIB_WINAPI', true)
|
||||
endif
|
||||
else
|
||||
foreach input_and_output : tpt_libs.get_variable('config_dlls')
|
||||
configure_file(input: input_and_output[0], output: input_and_output[1], copy: true)
|
||||
foreach input_output_condition : tpt_libs.get_variable('config_dlls')
|
||||
dll_input = input_output_condition[0]
|
||||
dll_output = input_output_condition[1]
|
||||
dll_condition = input_output_condition[2]
|
||||
do_copy = false
|
||||
if dll_condition == 'all'
|
||||
do_copy = true
|
||||
elif dll_condition == 'lua=' + lua_variant
|
||||
do_copy = true
|
||||
endif
|
||||
if do_copy
|
||||
configure_file(input: dll_input, output: dll_output, copy: true)
|
||||
endif
|
||||
endforeach
|
||||
endif
|
||||
elif copt_platform == 'lin'
|
||||
if uopt_static != 'none'
|
||||
elif host_platform == 'linux'
|
||||
if is_static
|
||||
project_link_args += [ '-static-libgcc', '-static-libstdc++' ]
|
||||
endif
|
||||
endif
|
||||
|
||||
if copt_platform == 'mac' and uopt_lua == 'luajit' and copt_architecture != 'arm64'
|
||||
if host_platform == 'darwin' and lua_variant == 'luajit' and host_arch != 'aarch64'
|
||||
project_link_args += [
|
||||
'-pagezero_size', '10000',
|
||||
'-image_base', '100000000',
|
||||
@ -294,40 +300,39 @@ endif
|
||||
|
||||
project_inc = include_directories([ 'src', 'data', 'resources' ])
|
||||
|
||||
if copt_platform == 'win'
|
||||
copt_identplatform = copt_64bit ? 'WIN64' : 'WIN32'
|
||||
elif copt_platform == 'lin'
|
||||
copt_identplatform = copt_64bit ? 'LIN64' : 'LIN32'
|
||||
elif copt_platform == 'mac'
|
||||
copt_identplatform = copt_architecture == 'arm64' ? 'MACOSARM' : 'MACOSX'
|
||||
if host_platform == 'windows'
|
||||
ident_platform = is_64bit ? 'WIN64' : 'WIN32'
|
||||
elif host_platform == 'linux'
|
||||
ident_platform = is_64bit ? 'LIN64' : 'LIN32'
|
||||
elif host_platform == 'darwin'
|
||||
ident_platform = host_arch == 'aarch64' ? 'MACOSARM' : 'MACOSX'
|
||||
else
|
||||
copt_identplatform = 'UNKNOWN'
|
||||
ident_platform = 'UNKNOWN'
|
||||
endif
|
||||
|
||||
conf_data.set('LIN', copt_platform == 'lin')
|
||||
conf_data.set('AND', copt_platform == 'and')
|
||||
conf_data.set('WIN', copt_platform == 'win')
|
||||
conf_data.set('MACOSX', copt_platform == 'mac')
|
||||
conf_data.set('X86', copt_x86)
|
||||
conf_data.set('X86_SSE3', uopt_x86_sse_level >= 30)
|
||||
conf_data.set('X86_SSE2', uopt_x86_sse_level >= 20)
|
||||
conf_data.set('X86_SSE', uopt_x86_sse_level >= 10)
|
||||
conf_data.set('NATIVE', uopt_native)
|
||||
conf_data.set('_64BIT', copt_64bit)
|
||||
conf_data.set('OGLI', get_option('ogli'))
|
||||
conf_data.set('OGLR', get_option('oglr'))
|
||||
conf_data.set('PIX32OGL', get_option('ogli'))
|
||||
conf_data.set('LIN', host_platform == 'linux')
|
||||
conf_data.set('AND', host_platform == 'android')
|
||||
conf_data.set('WIN', host_platform == 'windows')
|
||||
conf_data.set('MACOSX', host_platform == 'darwin')
|
||||
conf_data.set('X86', is_x86)
|
||||
conf_data.set('X86_SSE3', x86_sse_level >= 30)
|
||||
conf_data.set('X86_SSE2', x86_sse_level >= 20)
|
||||
conf_data.set('X86_SSE', x86_sse_level >= 10)
|
||||
conf_data.set('_64BIT', is_64bit)
|
||||
conf_data.set('OGLI', false)
|
||||
conf_data.set('OGLR', false)
|
||||
conf_data.set('PIX32OGL', false)
|
||||
conf_data.set('BETA', get_option('beta'))
|
||||
conf_data.set('NO_INSTALL_CHECK', not get_option('install_check'))
|
||||
conf_data.set('IGNORE_UPDATES', get_option('ignore_updates'))
|
||||
conf_data.set('MOD_ID', get_option('mod_id'))
|
||||
conf_data.set('DEBUG', get_option('debug'))
|
||||
conf_data.set('DEBUG', is_debug)
|
||||
conf_data.set('SNAPSHOT', get_option('snapshot'))
|
||||
conf_data.set('SNAPSHOT_ID', get_option('snapshot_id'))
|
||||
conf_data.set('SERVER', '"' + get_option('server') + '"')
|
||||
conf_data.set('STATICSERVER', '"' + get_option('static_server') + '"')
|
||||
conf_data.set('IDENT_PLATFORM', '"' + copt_identplatform + '"')
|
||||
conf_data.set('IDENT', '"@0@-@1@-@2@"'.format(copt_architecture, copt_platform, copt_compiler).to_upper())
|
||||
conf_data.set('IDENT_PLATFORM', '"' + ident_platform + '"')
|
||||
conf_data.set('IDENT', '"@0@-@1@-@2@"'.format(host_arch, host_platform, host_libc).to_upper())
|
||||
|
||||
if get_option('update_server') != ''
|
||||
conf_data.set('UPDATESERVER', '"' + get_option('update_server') + '"')
|
||||
@ -346,16 +351,11 @@ if get_option('build_powder')
|
||||
threads_dep,
|
||||
zlib_dep,
|
||||
sdl2_dep,
|
||||
sdl2main_dep,
|
||||
lua_opt_dep,
|
||||
curl_opt_dep,
|
||||
fftw_opt_dep,
|
||||
lua_dep,
|
||||
curl_dep,
|
||||
fftw_dep,
|
||||
]
|
||||
if copt_platform == 'win'
|
||||
powder_deps += other_dep
|
||||
endif
|
||||
if copt_platform == 'and'
|
||||
subdir('android')
|
||||
if host_platform == 'android'
|
||||
powder_sha = shared_library(
|
||||
'powder',
|
||||
sources: powder_files,
|
||||
@ -365,97 +365,7 @@ if get_option('build_powder')
|
||||
link_args: project_link_args,
|
||||
dependencies: powder_deps,
|
||||
)
|
||||
python3 = find_program('python3')
|
||||
android_platform_jar = meson.get_external_property('android_platform_jar')
|
||||
java_runtime_jar = meson.get_external_property('java_runtime_jar')
|
||||
android_keystore = get_option('android_keystore')
|
||||
sdl_jar = tpt_libs.get_variable('sdl_jar')
|
||||
powder_jar = custom_target(
|
||||
'powder-jar',
|
||||
output: 'powder.jar',
|
||||
command: [
|
||||
python3,
|
||||
files('android/powder-jar.py'),
|
||||
find_program('javac'),
|
||||
find_program('jar'),
|
||||
meson.current_source_dir(),
|
||||
meson.current_build_dir(),
|
||||
'@PRIVATE_DIR@',
|
||||
'@OUTPUT@',
|
||||
android_platform_jar,
|
||||
java_runtime_jar,
|
||||
sdl_jar,
|
||||
get_option('debug') ? 'debug' : 'release',
|
||||
powder_jar_sources,
|
||||
],
|
||||
)
|
||||
unaligned_apk = custom_target(
|
||||
'build-apk',
|
||||
output: 'powder.unaligned.apk',
|
||||
input: powder_sha,
|
||||
command: [
|
||||
python3,
|
||||
files('android/build-apk.py'),
|
||||
find_program('d8'),
|
||||
find_program('aapt'),
|
||||
find_program('aapt2'),
|
||||
meson.current_source_dir(),
|
||||
meson.current_build_dir(),
|
||||
'@PRIVATE_DIR@',
|
||||
'@OUTPUT@',
|
||||
'@INPUT@',
|
||||
android_platform_jar,
|
||||
sdl_jar,
|
||||
powder_jar,
|
||||
copt_architecture,
|
||||
get_option('debug') ? 'debug' : 'release',
|
||||
android_manifest_xml,
|
||||
android_resources,
|
||||
],
|
||||
)
|
||||
unsigned_apk = custom_target(
|
||||
'align-apk',
|
||||
output: 'powder.unsigned.apk',
|
||||
input: unaligned_apk,
|
||||
command: [
|
||||
python3,
|
||||
files('android/align-apk.py'),
|
||||
find_program('zipalign'),
|
||||
meson.current_build_dir(),
|
||||
'@OUTPUT@',
|
||||
'@INPUT@',
|
||||
],
|
||||
)
|
||||
signed_apk = custom_target(
|
||||
'sign-apk',
|
||||
output: 'powder.apk',
|
||||
input: unsigned_apk,
|
||||
command: [
|
||||
python3,
|
||||
files('android/sign-apk.py'),
|
||||
find_program('apksigner'),
|
||||
meson.current_build_dir(),
|
||||
'@OUTPUT@',
|
||||
'@INPUT@',
|
||||
android_keystore,
|
||||
get_option('android_keyalias'),
|
||||
],
|
||||
)
|
||||
adb = find_program('adb', required: false)
|
||||
if adb.found()
|
||||
install_apk = custom_target(
|
||||
'install-apk',
|
||||
input: signed_apk,
|
||||
output: 'install-apk',
|
||||
command: [ python3, files('android/install-apk.py'), adb, meson.current_build_dir(), '@OUTPUT@', '@INPUT@' ],
|
||||
)
|
||||
custom_target(
|
||||
'run-apk',
|
||||
input: [ signed_apk, install_apk ],
|
||||
output: 'run-apk',
|
||||
command: [ python3, files('android/run-apk.py'), adb, meson.current_build_dir(), '@OUTPUT@', '@INPUT0@' ],
|
||||
)
|
||||
endif
|
||||
subdir('android')
|
||||
else
|
||||
executable(
|
||||
'powder',
|
||||
@ -463,7 +373,7 @@ if get_option('build_powder')
|
||||
include_directories: [ project_inc, powder_inc ],
|
||||
c_args: project_c_args,
|
||||
cpp_args: project_cpp_args,
|
||||
gui_app: not get_option('debug'),
|
||||
win_subsystem: is_debug ? 'console' : 'windows',
|
||||
link_args: project_link_args,
|
||||
dependencies: powder_deps,
|
||||
)
|
||||
@ -491,11 +401,7 @@ if get_option('build_font')
|
||||
threads_dep,
|
||||
zlib_dep,
|
||||
sdl2_dep,
|
||||
sdl2main_dep,
|
||||
]
|
||||
if copt_platform == 'win'
|
||||
font_deps += other_dep
|
||||
endif
|
||||
executable(
|
||||
'font',
|
||||
sources: font_files,
|
||||
|
@ -58,17 +58,10 @@ option(
|
||||
option(
|
||||
'lua',
|
||||
type: 'combo',
|
||||
choices: [ 'none', 'lua5.1', 'lua5.2', 'luajit' ],
|
||||
value: 'luajit',
|
||||
choices: [ 'none', 'lua5.1', 'lua5.2', 'luajit', 'auto' ],
|
||||
value: 'auto',
|
||||
description: 'Lua library to use'
|
||||
)
|
||||
option(
|
||||
'ssl',
|
||||
type: 'combo',
|
||||
choices: [ 'openssl' ],
|
||||
value: 'openssl',
|
||||
description: 'SSL library to use'
|
||||
)
|
||||
option(
|
||||
'x86_sse',
|
||||
type: 'combo',
|
||||
@ -76,24 +69,6 @@ option(
|
||||
value: 'auto',
|
||||
description: 'Enable SSE (available only on x86)'
|
||||
)
|
||||
option(
|
||||
'native',
|
||||
type: 'boolean',
|
||||
value: false,
|
||||
description: 'Build with optimizations specific to the local machine, may not run on other machines, overrides \'x86_sse\''
|
||||
)
|
||||
option(
|
||||
'ogli',
|
||||
type: 'boolean',
|
||||
value: false,
|
||||
description: 'Enable OpenGL interface rendering (currently defunct)'
|
||||
)
|
||||
option(
|
||||
'oglr',
|
||||
type: 'boolean',
|
||||
value: false,
|
||||
description: 'Enable OpenGL particle rendering (currently defunct)'
|
||||
)
|
||||
option(
|
||||
'build_powder',
|
||||
type: 'boolean',
|
||||
|
@ -3,7 +3,7 @@ resources_files += files(
|
||||
'document.ico',
|
||||
)
|
||||
|
||||
if copt_platform == 'win'
|
||||
if host_platform == 'windows'
|
||||
powder_files += windows_mod.compile_resources(
|
||||
'powder-res.rc',
|
||||
depend_files: [ resources_files, 'resource.h' ],
|
||||
|
@ -15,7 +15,6 @@
|
||||
#mesondefine IGNORE_UPDATES
|
||||
#mesondefine LIN
|
||||
#mesondefine AND
|
||||
#mesondefine NATIVE
|
||||
#mesondefine NO_INSTALL_CHECK
|
||||
#mesondefine OGLI
|
||||
#mesondefine OGLR
|
||||
|
@ -1,5 +1,7 @@
|
||||
#include "Client.h"
|
||||
|
||||
#include "client/http/Request.h" // includes curl.h, needs to come first to silence a warning on windows
|
||||
|
||||
#include <cstdlib>
|
||||
#include <vector>
|
||||
#include <map>
|
||||
@ -45,7 +47,6 @@
|
||||
# include "lua/LuaScriptInterface.h"
|
||||
#endif
|
||||
|
||||
#include "client/http/Request.h"
|
||||
#include "client/http/RequestManager.h"
|
||||
#include "gui/preview/Comment.h"
|
||||
|
||||
|
@ -2619,6 +2619,7 @@ char * GameSave::serialiseOPS(unsigned int & dataLength)
|
||||
bson_append_string(&b, "releaseType", IDENT_RELTYPE);
|
||||
bson_append_string(&b, "platform", IDENT_PLATFORM);
|
||||
bson_append_string(&b, "builtType", IDENT_BUILD);
|
||||
bson_append_string(&b, "ident", IDENT);
|
||||
bson_append_finish_object(&b);
|
||||
if (gravityMode == 3)
|
||||
{
|
||||
|
@ -2,27 +2,24 @@
|
||||
#define REQUEST_H
|
||||
#include "Config.h"
|
||||
|
||||
#include "Config.h"
|
||||
#ifndef NOHTTP
|
||||
# include <curl/curl.h>
|
||||
# include "common/tpt-minmax.h" // for MSVC, ensures windows.h doesn't cause compile errors by defining min/max
|
||||
# include <mutex>
|
||||
# include <condition_variable>
|
||||
# if defined(CURL_AT_LEAST_VERSION) && CURL_AT_LEAST_VERSION(7, 55, 0)
|
||||
# define REQUEST_USE_CURL_OFFSET_T
|
||||
# endif
|
||||
# if defined(CURL_AT_LEAST_VERSION) && CURL_AT_LEAST_VERSION(7, 56, 0)
|
||||
# define REQUEST_USE_CURL_MIMEPOST
|
||||
# endif
|
||||
# if defined(CURL_AT_LEAST_VERSION) && CURL_AT_LEAST_VERSION(7, 61, 0)
|
||||
# define REQUEST_USE_CURL_TLSV13CL
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#include <map>
|
||||
#include "common/String.h"
|
||||
#ifndef NOHTTP
|
||||
#include "common/tpt-minmax.h" // for MSVC, ensures windows.h doesn't cause compile errors by defining min/max
|
||||
#include <mutex>
|
||||
#include <condition_variable>
|
||||
#include <curl/curl.h>
|
||||
|
||||
#if defined(CURL_AT_LEAST_VERSION) && CURL_AT_LEAST_VERSION(7, 55, 0)
|
||||
# define REQUEST_USE_CURL_OFFSET_T
|
||||
#endif
|
||||
|
||||
#if defined(CURL_AT_LEAST_VERSION) && CURL_AT_LEAST_VERSION(7, 56, 0)
|
||||
# define REQUEST_USE_CURL_MIMEPOST
|
||||
#endif
|
||||
|
||||
#if defined(CURL_AT_LEAST_VERSION) && CURL_AT_LEAST_VERSION(7, 61, 0)
|
||||
# define REQUEST_USE_CURL_TLSV13CL
|
||||
#endif
|
||||
#endif
|
||||
|
||||
namespace http
|
||||
{
|
||||
|
@ -1,11 +1,9 @@
|
||||
#ifndef NOHTTP
|
||||
#include "Request.h" // includes curl.h, needs to come first to silence a warning on windows
|
||||
#include "RequestManager.h"
|
||||
|
||||
#include <iostream>
|
||||
|
||||
#include "Request.h"
|
||||
#include "Config.h"
|
||||
|
||||
const int curl_multi_wait_timeout_ms = 100;
|
||||
const long curl_max_host_connections = 6;
|
||||
|
||||
|
@ -8,7 +8,7 @@ client_files += files(
|
||||
'ThumbnailRequest.cpp',
|
||||
)
|
||||
|
||||
if uopt_http
|
||||
if enable_http
|
||||
client_files += files(
|
||||
'RequestManager.cpp',
|
||||
)
|
||||
|
@ -1,9 +1,9 @@
|
||||
powder_conf_data = conf_data
|
||||
powder_conf_data.set('FONTEDITOR', false)
|
||||
powder_conf_data.set('RENDERER', false)
|
||||
powder_conf_data.set('LUACONSOLE', uopt_lua != 'none')
|
||||
powder_conf_data.set('NOHTTP', not uopt_http)
|
||||
powder_conf_data.set('GRAVFFT', uopt_fftw)
|
||||
powder_conf_data.set('LUACONSOLE', lua_variant != 'none')
|
||||
powder_conf_data.set('NOHTTP', not enable_http)
|
||||
powder_conf_data.set('GRAVFFT', enable_gravfft)
|
||||
configure_file(
|
||||
input: config_template,
|
||||
output: 'Config.h',
|
||||
|
@ -186,8 +186,8 @@ void FontEditor::PackData(
|
||||
fontPtrs.clear();
|
||||
fontRanges.clear();
|
||||
bool first = true;
|
||||
String::value_type rangeStart;
|
||||
String::value_type prev;
|
||||
String::value_type rangeStart = 0;
|
||||
String::value_type prev = 0;
|
||||
for(std::map<String::value_type, unsigned char>::const_iterator it = fontWidths.begin(); it != fontWidths.end(); it++)
|
||||
{
|
||||
String::value_type ch = it->first;
|
||||
|
@ -1,3 +1,5 @@
|
||||
#include "client/http/Request.h" // includes curl.h, needs to come first to silence a warning on windows
|
||||
|
||||
#include "PreviewModel.h"
|
||||
|
||||
#include <cmath>
|
||||
@ -8,7 +10,6 @@
|
||||
#include "client/Client.h"
|
||||
#include "client/GameSave.h"
|
||||
#include "client/SaveInfo.h"
|
||||
#include "client/http/Request.h"
|
||||
|
||||
#include "gui/dialogues/ErrorMessage.h"
|
||||
#include "gui/preview/Comment.h"
|
||||
|
@ -1,6 +1,7 @@
|
||||
#include "client/http/Request.h" // includes curl.h, needs to come first to silence a warning on windows
|
||||
|
||||
#include "UpdateActivity.h"
|
||||
|
||||
#include "client/http/Request.h"
|
||||
#include "bzip2/bzlib.h"
|
||||
|
||||
#include "Config.h"
|
||||
|
@ -1,5 +1,8 @@
|
||||
#include "Config.h"
|
||||
#ifdef LUACONSOLE
|
||||
|
||||
#include "client/http/Request.h" // includes curl.h, needs to come first to silence a warning on windows
|
||||
|
||||
#include <iomanip>
|
||||
#include <vector>
|
||||
#include <algorithm>
|
||||
@ -20,7 +23,6 @@
|
||||
#include "simulation/Simulation.h"
|
||||
#include "simulation/SimulationData.h"
|
||||
|
||||
#include "client/http/Request.h"
|
||||
#include "gui/dialogues/ConfirmPrompt.h"
|
||||
#include "gui/dialogues/ErrorMessage.h"
|
||||
#include "gui/dialogues/InformationMessage.h"
|
||||
|
@ -1,6 +1,8 @@
|
||||
#include "Config.h"
|
||||
#ifdef LUACONSOLE
|
||||
|
||||
#include "client/http/Request.h" // includes curl.h, needs to come first to silence a warning on windows
|
||||
|
||||
#include "LuaScriptInterface.h"
|
||||
|
||||
#include <vector>
|
||||
@ -40,7 +42,6 @@
|
||||
#include "simulation/ToolClasses.h"
|
||||
#include "simulation/SaveRenderer.h"
|
||||
|
||||
#include "client/http/Request.h"
|
||||
#include "gui/interface/Window.h"
|
||||
#include "gui/interface/Engine.h"
|
||||
#include "gui/game/GameView.h"
|
||||
|
@ -13,7 +13,7 @@ luaconsole_files = files(
|
||||
'LuaTextbox.cpp',
|
||||
'LuaWindow.cpp',
|
||||
)
|
||||
if uopt_http
|
||||
if enable_http
|
||||
luaconsole_files += files(
|
||||
'LuaTCPSocket.cpp',
|
||||
)
|
||||
|
@ -33,7 +33,7 @@ subdir('debug')
|
||||
subdir('graphics')
|
||||
subdir('gui')
|
||||
subdir('json')
|
||||
if uopt_lua != 'none'
|
||||
if lua_variant != 'none'
|
||||
subdir('lua')
|
||||
endif
|
||||
subdir('resampler')
|
||||
|
@ -0,0 +1,6 @@
|
||||
[wrap-file]
|
||||
directory = tpt-libs-prebuilt-aarch64-android-bionic-static-debug-v20220901212941
|
||||
|
||||
source_url = https://github.com/The-Powder-Toy/tpt-libs/releases/download/v20220901212941/tpt-libs-prebuilt-aarch64-android-bionic-static-debug-v20220901212941.zip
|
||||
source_filename = tpt-libs-prebuilt-aarch64-android-bionic-static-debug-v20220901212941.zip
|
||||
source_hash = 5d6d201b0872883996d0f4b68eafd4711cef223666558689f4a92ddb733fc49c
|
@ -0,0 +1,6 @@
|
||||
[wrap-file]
|
||||
directory = tpt-libs-prebuilt-aarch64-android-bionic-static-release-v20220901212941
|
||||
|
||||
source_url = https://github.com/The-Powder-Toy/tpt-libs/releases/download/v20220901212941/tpt-libs-prebuilt-aarch64-android-bionic-static-release-v20220901212941.zip
|
||||
source_filename = tpt-libs-prebuilt-aarch64-android-bionic-static-release-v20220901212941.zip
|
||||
source_hash = 2e2ee7a9a54da1e7c0dc0d2b11975ebf0e037c9a97d8295eea1ea244917344a8
|
@ -0,0 +1,6 @@
|
||||
[wrap-file]
|
||||
directory = tpt-libs-prebuilt-aarch64-darwin-macos-static-debug-v20220901212941
|
||||
|
||||
source_url = https://github.com/The-Powder-Toy/tpt-libs/releases/download/v20220901212941/tpt-libs-prebuilt-aarch64-darwin-macos-static-debug-v20220901212941.zip
|
||||
source_filename = tpt-libs-prebuilt-aarch64-darwin-macos-static-debug-v20220901212941.zip
|
||||
source_hash = 27e540962ee324d8c49f927bff0b0fdd9e7e196eeeb9b7652217f9f2d7d64efa
|
@ -0,0 +1,6 @@
|
||||
[wrap-file]
|
||||
directory = tpt-libs-prebuilt-aarch64-darwin-macos-static-release-v20220901212941
|
||||
|
||||
source_url = https://github.com/The-Powder-Toy/tpt-libs/releases/download/v20220901212941/tpt-libs-prebuilt-aarch64-darwin-macos-static-release-v20220901212941.zip
|
||||
source_filename = tpt-libs-prebuilt-aarch64-darwin-macos-static-release-v20220901212941.zip
|
||||
source_hash = c910019bbcb765236a0e26faa0e4974000411f0ca4b470d529efeb7c4c8cd008
|
@ -1,6 +0,0 @@
|
||||
[wrap-file]
|
||||
directory = tpt-libs-prebuilt-arm-and-gcc-static-v20220414193335
|
||||
|
||||
source_url = https://github.com/The-Powder-Toy/tpt-libs/releases/download/v20220414193335/tpt-libs-prebuilt-arm-and-gcc-static-v20220414193335.zip
|
||||
source_filename = tpt-libs-prebuilt-arm-and-gcc-static-v20220414193335.zip
|
||||
source_hash = 226a1b2ece17c329649d3031f6c8b893f4ce08f91323728b11aa7bbdfb581c6e
|
@ -0,0 +1,6 @@
|
||||
[wrap-file]
|
||||
directory = tpt-libs-prebuilt-arm-android-bionic-static-debug-v20220901212941
|
||||
|
||||
source_url = https://github.com/The-Powder-Toy/tpt-libs/releases/download/v20220901212941/tpt-libs-prebuilt-arm-android-bionic-static-debug-v20220901212941.zip
|
||||
source_filename = tpt-libs-prebuilt-arm-android-bionic-static-debug-v20220901212941.zip
|
||||
source_hash = 0cfde7e1afe53ed13e6ab2863ac521eaa22abb78087c7a9d0f86d9e68e2ba365
|
@ -0,0 +1,6 @@
|
||||
[wrap-file]
|
||||
directory = tpt-libs-prebuilt-arm-android-bionic-static-release-v20220901212941
|
||||
|
||||
source_url = https://github.com/The-Powder-Toy/tpt-libs/releases/download/v20220901212941/tpt-libs-prebuilt-arm-android-bionic-static-release-v20220901212941.zip
|
||||
source_filename = tpt-libs-prebuilt-arm-android-bionic-static-release-v20220901212941.zip
|
||||
source_hash = 77287c4f15480951978dbaa360e9921a2398cceae916658b3810b42f3e538cd1
|
@ -1,6 +0,0 @@
|
||||
[wrap-file]
|
||||
directory = tpt-libs-prebuilt-arm64-and-gcc-static-v20220414193335
|
||||
|
||||
source_url = https://github.com/The-Powder-Toy/tpt-libs/releases/download/v20220414193335/tpt-libs-prebuilt-arm64-and-gcc-static-v20220414193335.zip
|
||||
source_filename = tpt-libs-prebuilt-arm64-and-gcc-static-v20220414193335.zip
|
||||
source_hash = 31b9ee7abc07a13972ad346a86db1fb6e850046d4427b60eb312796c99f6069b
|
@ -1,6 +0,0 @@
|
||||
[wrap-file]
|
||||
directory = tpt-libs-prebuilt-arm64-mac-gcc-static-v20220414193335
|
||||
|
||||
source_url = https://github.com/The-Powder-Toy/tpt-libs/releases/download/v20220414193335/tpt-libs-prebuilt-arm64-mac-gcc-static-v20220414193335.zip
|
||||
source_filename = tpt-libs-prebuilt-arm64-mac-gcc-static-v20220414193335.zip
|
||||
source_hash = f904875f5d4d5ae6182a21603b768451049d19d5a7d2081907785166aba5af89
|
@ -1,6 +0,0 @@
|
||||
[wrap-file]
|
||||
directory = tpt-libs-prebuilt-i686-and-gcc-static-v20220414193335
|
||||
|
||||
source_url = https://github.com/The-Powder-Toy/tpt-libs/releases/download/v20220414193335/tpt-libs-prebuilt-i686-and-gcc-static-v20220414193335.zip
|
||||
source_filename = tpt-libs-prebuilt-i686-and-gcc-static-v20220414193335.zip
|
||||
source_hash = 469c8d4d3b4be42fc51232c89c8729286c98008fc84e6cd29417d3799a77b339
|
@ -1,6 +0,0 @@
|
||||
[wrap-file]
|
||||
directory = tpt-libs-prebuilt-i686-win-msvc-dynamic-v20220414193335
|
||||
|
||||
source_url = https://github.com/The-Powder-Toy/tpt-libs/releases/download/v20220414193335/tpt-libs-prebuilt-i686-win-msvc-dynamic-v20220414193335.zip
|
||||
source_filename = tpt-libs-prebuilt-i686-win-msvc-dynamic-v20220414193335.zip
|
||||
source_hash = 16c7818b6e2d95eb22c0a72a57c3f35ba26268615d5b7d9c9cac072fcacc156b
|
@ -1,6 +0,0 @@
|
||||
[wrap-file]
|
||||
directory = tpt-libs-prebuilt-i686-win-msvc-static-v20220414193335
|
||||
|
||||
source_url = https://github.com/The-Powder-Toy/tpt-libs/releases/download/v20220414193335/tpt-libs-prebuilt-i686-win-msvc-static-v20220414193335.zip
|
||||
source_filename = tpt-libs-prebuilt-i686-win-msvc-static-v20220414193335.zip
|
||||
source_hash = 49d93a611fee0dc2fde4e55ccd08b4ea8599a1ee295053bab790b42616d9fed5
|
@ -0,0 +1,6 @@
|
||||
[wrap-file]
|
||||
directory = tpt-libs-prebuilt-x86-android-bionic-static-debug-v20220901212941
|
||||
|
||||
source_url = https://github.com/The-Powder-Toy/tpt-libs/releases/download/v20220901212941/tpt-libs-prebuilt-x86-android-bionic-static-debug-v20220901212941.zip
|
||||
source_filename = tpt-libs-prebuilt-x86-android-bionic-static-debug-v20220901212941.zip
|
||||
source_hash = ee8496f3bbabe58f98959081913b63da099195ace0e09c0451f7410c4db42373
|
@ -0,0 +1,6 @@
|
||||
[wrap-file]
|
||||
directory = tpt-libs-prebuilt-x86-android-bionic-static-release-v20220901212941
|
||||
|
||||
source_url = https://github.com/The-Powder-Toy/tpt-libs/releases/download/v20220901212941/tpt-libs-prebuilt-x86-android-bionic-static-release-v20220901212941.zip
|
||||
source_filename = tpt-libs-prebuilt-x86-android-bionic-static-release-v20220901212941.zip
|
||||
source_hash = b1fefbb0255203e5276034e64f25d0775003077619528a8bdfd1ffcb603c4c10
|
@ -0,0 +1,6 @@
|
||||
[wrap-file]
|
||||
directory = tpt-libs-prebuilt-x86-windows-msvc-dynamic-debug-v20220901212941
|
||||
|
||||
source_url = https://github.com/The-Powder-Toy/tpt-libs/releases/download/v20220901212941/tpt-libs-prebuilt-x86-windows-msvc-dynamic-debug-v20220901212941.zip
|
||||
source_filename = tpt-libs-prebuilt-x86-windows-msvc-dynamic-debug-v20220901212941.zip
|
||||
source_hash = 0faf7eacc8189e7b1b5e881c4c30989ae54224d8b8d75b17b488bb7f5facbc94
|
@ -0,0 +1,6 @@
|
||||
[wrap-file]
|
||||
directory = tpt-libs-prebuilt-x86-windows-msvc-dynamic-release-v20220901212941
|
||||
|
||||
source_url = https://github.com/The-Powder-Toy/tpt-libs/releases/download/v20220901212941/tpt-libs-prebuilt-x86-windows-msvc-dynamic-release-v20220901212941.zip
|
||||
source_filename = tpt-libs-prebuilt-x86-windows-msvc-dynamic-release-v20220901212941.zip
|
||||
source_hash = 21c04cc1d3e9212d6728eb20a16084f093aed9d1de47cd8fadfdd277189b7462
|
@ -0,0 +1,6 @@
|
||||
[wrap-file]
|
||||
directory = tpt-libs-prebuilt-x86-windows-msvc-static-debug-v20220901212941
|
||||
|
||||
source_url = https://github.com/The-Powder-Toy/tpt-libs/releases/download/v20220901212941/tpt-libs-prebuilt-x86-windows-msvc-static-debug-v20220901212941.zip
|
||||
source_filename = tpt-libs-prebuilt-x86-windows-msvc-static-debug-v20220901212941.zip
|
||||
source_hash = fb307b0c2e007fc6cdf7e1ec3f30868cb2e458b62b1519ccf122a9747f94cc19
|
@ -0,0 +1,6 @@
|
||||
[wrap-file]
|
||||
directory = tpt-libs-prebuilt-x86-windows-msvc-static-release-v20220901212941
|
||||
|
||||
source_url = https://github.com/The-Powder-Toy/tpt-libs/releases/download/v20220901212941/tpt-libs-prebuilt-x86-windows-msvc-static-release-v20220901212941.zip
|
||||
source_filename = tpt-libs-prebuilt-x86-windows-msvc-static-release-v20220901212941.zip
|
||||
source_hash = 06d3c3d2f259ddadbdec6222d210a5cb6da5fc8679aee52eda324a189f1b60bc
|
@ -1,6 +0,0 @@
|
||||
[wrap-file]
|
||||
directory = tpt-libs-prebuilt-x86_64-and-gcc-static-v20220414193335
|
||||
|
||||
source_url = https://github.com/The-Powder-Toy/tpt-libs/releases/download/v20220414193335/tpt-libs-prebuilt-x86_64-and-gcc-static-v20220414193335.zip
|
||||
source_filename = tpt-libs-prebuilt-x86_64-and-gcc-static-v20220414193335.zip
|
||||
source_hash = 81c216cd0e12b0bfa1a29ec31553a431e53aee2c2f94e6dd69337dc949bf4957
|
@ -0,0 +1,6 @@
|
||||
[wrap-file]
|
||||
directory = tpt-libs-prebuilt-x86_64-android-bionic-static-debug-v20220901212941
|
||||
|
||||
source_url = https://github.com/The-Powder-Toy/tpt-libs/releases/download/v20220901212941/tpt-libs-prebuilt-x86_64-android-bionic-static-debug-v20220901212941.zip
|
||||
source_filename = tpt-libs-prebuilt-x86_64-android-bionic-static-debug-v20220901212941.zip
|
||||
source_hash = 554ac18bf9c062bb886f04fc83263979c674c2d55915e7e66e0fd951e955d77b
|
@ -0,0 +1,6 @@
|
||||
[wrap-file]
|
||||
directory = tpt-libs-prebuilt-x86_64-android-bionic-static-release-v20220901212941
|
||||
|
||||
source_url = https://github.com/The-Powder-Toy/tpt-libs/releases/download/v20220901212941/tpt-libs-prebuilt-x86_64-android-bionic-static-release-v20220901212941.zip
|
||||
source_filename = tpt-libs-prebuilt-x86_64-android-bionic-static-release-v20220901212941.zip
|
||||
source_hash = 5e2bbc2defec6e22c9a42179ed33b0589e47cc7c310cca291ec3e823a1f5ea5d
|
@ -0,0 +1,6 @@
|
||||
[wrap-file]
|
||||
directory = tpt-libs-prebuilt-x86_64-darwin-macos-static-debug-v20220901212941
|
||||
|
||||
source_url = https://github.com/The-Powder-Toy/tpt-libs/releases/download/v20220901212941/tpt-libs-prebuilt-x86_64-darwin-macos-static-debug-v20220901212941.zip
|
||||
source_filename = tpt-libs-prebuilt-x86_64-darwin-macos-static-debug-v20220901212941.zip
|
||||
source_hash = 1dd115e9e86b068eaf62deb3b4ee6fdd39e1e3fd1a45e4e0526115429c30258b
|
@ -0,0 +1,6 @@
|
||||
[wrap-file]
|
||||
directory = tpt-libs-prebuilt-x86_64-darwin-macos-static-release-v20220901212941
|
||||
|
||||
source_url = https://github.com/The-Powder-Toy/tpt-libs/releases/download/v20220901212941/tpt-libs-prebuilt-x86_64-darwin-macos-static-release-v20220901212941.zip
|
||||
source_filename = tpt-libs-prebuilt-x86_64-darwin-macos-static-release-v20220901212941.zip
|
||||
source_hash = 5951d2605e78c83ebf79f65a929d4dac0295e0fee58c3af8488eced1e578321b
|
@ -1,6 +0,0 @@
|
||||
[wrap-file]
|
||||
directory = tpt-libs-prebuilt-x86_64-lin-gcc-static-v20220414193335
|
||||
|
||||
source_url = https://github.com/The-Powder-Toy/tpt-libs/releases/download/v20220414193335/tpt-libs-prebuilt-x86_64-lin-gcc-static-v20220414193335.zip
|
||||
source_filename = tpt-libs-prebuilt-x86_64-lin-gcc-static-v20220414193335.zip
|
||||
source_hash = db4736e6633cedf3b920d311f137b877b3d9f4fae868076425c826217722a693
|
@ -0,0 +1,6 @@
|
||||
[wrap-file]
|
||||
directory = tpt-libs-prebuilt-x86_64-linux-gnu-static-debug-v20220901212941
|
||||
|
||||
source_url = https://github.com/The-Powder-Toy/tpt-libs/releases/download/v20220901212941/tpt-libs-prebuilt-x86_64-linux-gnu-static-debug-v20220901212941.zip
|
||||
source_filename = tpt-libs-prebuilt-x86_64-linux-gnu-static-debug-v20220901212941.zip
|
||||
source_hash = 750d9abb4b257e0f5702e3904150f9521e44ecd97a0f8af4a9262b90f4bad4da
|
@ -0,0 +1,6 @@
|
||||
[wrap-file]
|
||||
directory = tpt-libs-prebuilt-x86_64-linux-gnu-static-release-v20220901212941
|
||||
|
||||
source_url = https://github.com/The-Powder-Toy/tpt-libs/releases/download/v20220901212941/tpt-libs-prebuilt-x86_64-linux-gnu-static-release-v20220901212941.zip
|
||||
source_filename = tpt-libs-prebuilt-x86_64-linux-gnu-static-release-v20220901212941.zip
|
||||
source_hash = 0466d7309f1b9989e3ae74e67560bddb7b0a24a914b4da8901396ce8fadd80e9
|
@ -1,6 +0,0 @@
|
||||
[wrap-file]
|
||||
directory = tpt-libs-prebuilt-x86_64-mac-gcc-static-v20220414193335
|
||||
|
||||
source_url = https://github.com/The-Powder-Toy/tpt-libs/releases/download/v20220414193335/tpt-libs-prebuilt-x86_64-mac-gcc-static-v20220414193335.zip
|
||||
source_filename = tpt-libs-prebuilt-x86_64-mac-gcc-static-v20220414193335.zip
|
||||
source_hash = 92cf4a7e9260a7706af6de681bcb422e7cdf002d8fd699f6bf41248c5a0e8561
|
@ -1,6 +0,0 @@
|
||||
[wrap-file]
|
||||
directory = tpt-libs-prebuilt-x86_64-win-mingw-dynamic-v20220414193335
|
||||
|
||||
source_url = https://github.com/The-Powder-Toy/tpt-libs/releases/download/v20220414193335/tpt-libs-prebuilt-x86_64-win-mingw-dynamic-v20220414193335.zip
|
||||
source_filename = tpt-libs-prebuilt-x86_64-win-mingw-dynamic-v20220414193335.zip
|
||||
source_hash = c72b41274254728e1513ec07ecec574efb8138645aaa691bf7b3df7fe8e13ed7
|
@ -1,6 +0,0 @@
|
||||
[wrap-file]
|
||||
directory = tpt-libs-prebuilt-x86_64-win-mingw-static-v20220414193335
|
||||
|
||||
source_url = https://github.com/The-Powder-Toy/tpt-libs/releases/download/v20220414193335/tpt-libs-prebuilt-x86_64-win-mingw-static-v20220414193335.zip
|
||||
source_filename = tpt-libs-prebuilt-x86_64-win-mingw-static-v20220414193335.zip
|
||||
source_hash = 6fac58359250d7e7c8625be12f2ff05c2d8d530d37527b1171ffef9316db0c59
|
@ -1,6 +0,0 @@
|
||||
[wrap-file]
|
||||
directory = tpt-libs-prebuilt-x86_64-win-msvc-dynamic-v20220414193335
|
||||
|
||||
source_url = https://github.com/The-Powder-Toy/tpt-libs/releases/download/v20220414193335/tpt-libs-prebuilt-x86_64-win-msvc-dynamic-v20220414193335.zip
|
||||
source_filename = tpt-libs-prebuilt-x86_64-win-msvc-dynamic-v20220414193335.zip
|
||||
source_hash = 5eb84fa27e5b7eaa153143096c72878ee26aa1e00c43ce283882f7dcc47b73a2
|
@ -1,6 +0,0 @@
|
||||
[wrap-file]
|
||||
directory = tpt-libs-prebuilt-x86_64-win-msvc-static-v20220414193335
|
||||
|
||||
source_url = https://github.com/The-Powder-Toy/tpt-libs/releases/download/v20220414193335/tpt-libs-prebuilt-x86_64-win-msvc-static-v20220414193335.zip
|
||||
source_filename = tpt-libs-prebuilt-x86_64-win-msvc-static-v20220414193335.zip
|
||||
source_hash = 32f71cf6c750e0c312777538ca094a8577b4d9d27dc68e8d406aa991d1440db1
|
@ -0,0 +1,6 @@
|
||||
[wrap-file]
|
||||
directory = tpt-libs-prebuilt-x86_64-windows-mingw-dynamic-debug-v20220901212941
|
||||
|
||||
source_url = https://github.com/The-Powder-Toy/tpt-libs/releases/download/v20220901212941/tpt-libs-prebuilt-x86_64-windows-mingw-dynamic-debug-v20220901212941.zip
|
||||
source_filename = tpt-libs-prebuilt-x86_64-windows-mingw-dynamic-debug-v20220901212941.zip
|
||||
source_hash = 0c680924335e0a9dc1e9479195b764244a6f441eee4dffaf460375baf106b21d
|
@ -0,0 +1,6 @@
|
||||
[wrap-file]
|
||||
directory = tpt-libs-prebuilt-x86_64-windows-mingw-dynamic-release-v20220901212941
|
||||
|
||||
source_url = https://github.com/The-Powder-Toy/tpt-libs/releases/download/v20220901212941/tpt-libs-prebuilt-x86_64-windows-mingw-dynamic-release-v20220901212941.zip
|
||||
source_filename = tpt-libs-prebuilt-x86_64-windows-mingw-dynamic-release-v20220901212941.zip
|
||||
source_hash = 48f91167a78c7744d9cf00f79b046583268c4b9132b870560bbcf35a8d590191
|
@ -0,0 +1,6 @@
|
||||
[wrap-file]
|
||||
directory = tpt-libs-prebuilt-x86_64-windows-mingw-static-debug-v20220901212941
|
||||
|
||||
source_url = https://github.com/The-Powder-Toy/tpt-libs/releases/download/v20220901212941/tpt-libs-prebuilt-x86_64-windows-mingw-static-debug-v20220901212941.zip
|
||||
source_filename = tpt-libs-prebuilt-x86_64-windows-mingw-static-debug-v20220901212941.zip
|
||||
source_hash = 55efb0c7b45d398ee29777ff32223191a850783e0215ddcdd60c1d8dc94d7128
|
@ -0,0 +1,6 @@
|
||||
[wrap-file]
|
||||
directory = tpt-libs-prebuilt-x86_64-windows-mingw-static-release-v20220901212941
|
||||
|
||||
source_url = https://github.com/The-Powder-Toy/tpt-libs/releases/download/v20220901212941/tpt-libs-prebuilt-x86_64-windows-mingw-static-release-v20220901212941.zip
|
||||
source_filename = tpt-libs-prebuilt-x86_64-windows-mingw-static-release-v20220901212941.zip
|
||||
source_hash = 34b1b9096fb16e41c0c6f0f8cf291b333d46cda72bdbdf1009eb4fdfbc6695f6
|
@ -0,0 +1,6 @@
|
||||
[wrap-file]
|
||||
directory = tpt-libs-prebuilt-x86_64-windows-msvc-dynamic-debug-v20220901212941
|
||||
|
||||
source_url = https://github.com/The-Powder-Toy/tpt-libs/releases/download/v20220901212941/tpt-libs-prebuilt-x86_64-windows-msvc-dynamic-debug-v20220901212941.zip
|
||||
source_filename = tpt-libs-prebuilt-x86_64-windows-msvc-dynamic-debug-v20220901212941.zip
|
||||
source_hash = 6089faf76116a86c46014ec82e3922d155f3e56cef1dee70b4a311f822bc8325
|
@ -0,0 +1,6 @@
|
||||
[wrap-file]
|
||||
directory = tpt-libs-prebuilt-x86_64-windows-msvc-dynamic-release-v20220901212941
|
||||
|
||||
source_url = https://github.com/The-Powder-Toy/tpt-libs/releases/download/v20220901212941/tpt-libs-prebuilt-x86_64-windows-msvc-dynamic-release-v20220901212941.zip
|
||||
source_filename = tpt-libs-prebuilt-x86_64-windows-msvc-dynamic-release-v20220901212941.zip
|
||||
source_hash = ba3193ac2baca305a00dda577f1ddefc3209aa9bccfa197961a360a4de1b9b35
|
@ -0,0 +1,6 @@
|
||||
[wrap-file]
|
||||
directory = tpt-libs-prebuilt-x86_64-windows-msvc-static-debug-v20220901212941
|
||||
|
||||
source_url = https://github.com/The-Powder-Toy/tpt-libs/releases/download/v20220901212941/tpt-libs-prebuilt-x86_64-windows-msvc-static-debug-v20220901212941.zip
|
||||
source_filename = tpt-libs-prebuilt-x86_64-windows-msvc-static-debug-v20220901212941.zip
|
||||
source_hash = 4cd79adda8a6dd7707c2b9a55f1e9d6ffa40f1bba4d68026460046d160f5a2b1
|
@ -0,0 +1,6 @@
|
||||
[wrap-file]
|
||||
directory = tpt-libs-prebuilt-x86_64-windows-msvc-static-release-v20220901212941
|
||||
|
||||
source_url = https://github.com/The-Powder-Toy/tpt-libs/releases/download/v20220901212941/tpt-libs-prebuilt-x86_64-windows-msvc-static-release-v20220901212941.zip
|
||||
source_filename = tpt-libs-prebuilt-x86_64-windows-msvc-static-release-v20220901212941.zip
|
||||
source_hash = afa4b34d61c7ddbd6a2345beec10c107e6462fe6cafecf9e630e34d33b2ca91b
|
19
subprojects/update-wraps.sh
Executable file
19
subprojects/update-wraps.sh
Executable file
@ -0,0 +1,19 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -euo pipefail
|
||||
shopt -s globstar
|
||||
IFS=$'\n\t'
|
||||
|
||||
owner=$1
|
||||
repo=$2
|
||||
tag=$3
|
||||
|
||||
set +e
|
||||
rm *.wrap > /dev/null 2>&1
|
||||
set -e
|
||||
for wrap in $(curl -sL "https://api.github.com/repos/$owner/$repo/releases/tags/$tag" | jq -r '.assets[].browser_download_url | select(endswith("wrap"))'); do
|
||||
echo $wrap
|
||||
curl -sLO $wrap
|
||||
done
|
||||
|
||||
sed -i "s|tpt_libs_vtag = '[^']*'|tpt_libs_vtag = '$tag'|g" ../meson.build
|
Loading…
Reference in New Issue
Block a user