Allow building for F-Droid

This commit is contained in:
Miguel Horta
2022-04-19 14:54:08 +01:00
committed by pelya
parent adbe81a060
commit a92f6cf9b8
12 changed files with 56 additions and 55 deletions

View File

@@ -7,10 +7,10 @@ AppName="OpenTTD"
AppFullName=org.openttd.sdl
# Application version code (integer)
AppVersionCode=1220112
AppVersionCode=1220110
# Application user-visible version name (string)
AppVersionName="12.2.rev112"
AppVersionName="12.2.rev110"
# Specify path to download application data in zip archive in the form 'Description|URL|MirrorURL^Description2|URL2|MirrorURL2^...'
# If you'll start Description with '!' symbol it will be enabled by default, '!!' will also hide the entry from the menu, so it cannot be disabled
@@ -271,7 +271,7 @@ NDK_TOOLCHAIN_VERSION=clang
# android-16 = Android 4.1, the earliest supported version in NDK r18.
# android-18 = Android 4.3, the first version supporting GLES3.
# android-21 = Android 5.1, the first version with SO_REUSEPORT defined.
APP_PLATFORM=
APP_PLATFORM=21
# Specify architectures to compile, 'all' or 'y' to compile for all architectures.
# Available architectures: armeabi-v7a arm64-v8a x86 x86_64

View File

@@ -2,6 +2,7 @@
LOCAL_PATH=`dirname $0`
LOCAL_PATH=`cd $LOCAL_PATH && pwd`
VER=build
[ -d openttd-$VER-$1 ] || mkdir -p openttd-$VER-$1/bin/baseset
@@ -79,7 +80,13 @@ export ARCH=$1
echo "set_target_properties(${TARGET} PROPERTIES IMPORTED_LOCATION "'${'"${TARGET}"'_LIBRARY})' >> $CMAKE_SDL
done
cmake \
if [ -n "${CMAKE_BIN_LOC}" ]; then
NINJA_PATH=${CMAKE_BIN_LOC}/ninja
else
NINJA_PATH=$(which ninja)
fi
${CMAKE_BIN_LOC}cmake \
-DCMAKE_MODULE_PATH=$LOCAL_PATH/openttd-$VER-$1/cmake \
-DCMAKE_TOOLCHAIN_FILE=$NDK/build/cmake/android.toolchain.cmake \
-DANDROID_ABI=$1 \
@@ -88,7 +95,8 @@ export ARCH=$1
-DGLOBAL_DIR="." \
-DHOST_BINARY_DIR=$LOCAL_PATH/build-tools \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_MAKE_PROGRAM=$(which ninja) \
-DCMAKE_PREFIX_PATH=$LOCAL_PATH/../../iconv/src/$ARCH/ \
-DCMAKE_MAKE_PROGRAM=$NINJA_PATH \
-GNinja \
-B ./openttd-$VER-$1 -S ./src
@@ -98,9 +106,8 @@ mkdir -p staging-openttd-$VER-$1
set -e
cmake --build openttd-$VER-$1 --verbose;
cmake --install openttd-$VER-$1 --prefix ./staging-openttd-$VER-$1;
cp staging-openttd-$VER-$1/games/libapplication.so libapplication-$1.so;
${CMAKE_BIN_LOC}cmake --build openttd-$VER-$1 --verbose;
${CMAKE_BIN_LOC}cmake --install openttd-$VER-$1 --prefix ./staging-openttd-$VER-$1;
cp staging-openttd-$VER-$1/games/libapplication.so libapplication-$1.so;
mkdir -p ./data
cp -r staging-openttd-$VER-$1/share/games/application/* data/

View File

@@ -1,5 +1,5 @@
#!/bin/sh
mkdir -p build-tools
[ -e build-tools/Makefile ] || cmake -DOPTION_TOOLS_ONLY=ON -B build-tools src
[ -e build-tools/Makefile ] || ${CMAKE_BIN_LOC}cmake -DOPTION_TOOLS_ONLY=ON -B build-tools src
make -C build-tools -j8 VERBOSE=1 || exit 1

View File

@@ -3,8 +3,7 @@
IFS='
'
NDK=`which ndk-build`
NDK=`dirname $NDK`
NDK=${ANDROID_NDK_HOME:-$(dirname $(which ndk-build))}
if uname -s | grep -i "linux" > /dev/null ; then
MYARCH=linux-$(uname -m)

View File

@@ -3,8 +3,7 @@
IFS='
'
NDK=`which ndk-build`
NDK=`dirname $NDK`
NDK=${ANDROID_NDK_HOME:-$(dirname $(which ndk-build))}
if uname -s | grep -i "linux" > /dev/null ; then
MYARCH=linux-$(uname -m)
@@ -26,7 +25,7 @@ fi
ARCH=armeabi-v7a
GCCPREFIX=armv7a-linux-androideabi
BINUTILSPREFIX=arm-linux-androideabi
APILEVEL=19
APILEVEL=21
APP_MODULES=`grep 'APP_MODULES [:][=]' $LOCAL_PATH/../Settings.mk | sed 's@.*[=]\(.*\)@\1@' | sed 's@\b\(application\|sdl_main\|sdl_native_helpers\|c++_shared\)\b@@g'`

View File

@@ -3,8 +3,7 @@
IFS='
'
NDK=`which ndk-build`
NDK=`dirname $NDK`
NDK=${ANDROID_NDK_HOME:-$(dirname $(which ndk-build))}
if uname -s | grep -i "linux" > /dev/null ; then
MYARCH=linux-$(uname -m)
@@ -25,7 +24,7 @@ else
fi
ARCH=x86
GCCPREFIX=i686-linux-android
APILEVEL=19
APILEVEL=21
APP_MODULES=`grep 'APP_MODULES [:][=]' $LOCAL_PATH/../Settings.mk | sed 's@.*[=]\(.*\)@\1@' | sed 's@\b\(application\|sdl_main\|sdl_native_helpers\|c++_shared\)\b@@g'`

View File

@@ -3,11 +3,10 @@
IFS='
'
NDK=`which ndk-build`
NDK=`dirname $NDK`
NDK=${ANDROID_NDK_HOME:-$(dirname $(which ndk-build))}
if uname -s | grep -i "linux" > /dev/null ; then
MYARCH=linux-$(arch)
MYARCH=linux-$(uname -m)
NDK=`readlink -f $NDK`
elif uname -s | grep -i "darwin" > /dev/null ; then
MYARCH=darwin-x86_64