2017-01-27 16:43:49 -05:00
|
|
|
================================================================================
|
|
|
|
|
|
|
|
SUPERTUXKART
|
|
|
|
|
|
|
|
================================================================================
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
--------------------------------------------------------------------------------
|
|
|
|
SYSTEM REQUIREMENTS
|
|
|
|
--------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
To run SuperTuxKart on Android, you need a device that meets following
|
|
|
|
requirements:
|
|
|
|
|
|
|
|
- Android 4.4 or later
|
|
|
|
- Processor compatible with armv7 or x86
|
|
|
|
- GPU that supports OpenGL ES 3.0
|
|
|
|
- 1 GB RAM (STK uses ~150 MB in minimal configuration)
|
|
|
|
- 300 MB of free space on internal storage
|
|
|
|
- Touch screen or external keyboard
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
--------------------------------------------------------------------------------
|
|
|
|
COMPILATION
|
|
|
|
--------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
The build scripts are designed to run under linux. They may work under cygwin
|
|
|
|
after some tweaks, but atm. only linux is supported.
|
|
|
|
|
|
|
|
Dependencies list (may be incomplete):
|
|
|
|
|
2017-06-13 16:04:55 -04:00
|
|
|
autoconf, automake, make, python, gradle, ant, imagemagick, cmake,
|
|
|
|
vorbis-tools
|
2017-01-27 16:43:49 -05:00
|
|
|
|
|
|
|
Additionally some dependencies for optimize_data script:
|
|
|
|
|
|
|
|
advancecomp, libjpeg-progs, optipng
|
|
|
|
|
|
|
|
Before compilation you must download the package with dependencies from:
|
|
|
|
https://github.com/supertuxkart/dependencies
|
|
|
|
and extract it to stk-code/lib. It contains sources of libraries that are used
|
|
|
|
in STK, but are not availiable in stk-code repository (curl, freetype, openal).
|
|
|
|
|
|
|
|
You need also Android SDK for android-19 platform (the API for Android 4.4) and
|
2017-08-29 15:59:44 -04:00
|
|
|
Android NDK. Note that NDK >= r15b is atm. not supported. Version r12b is
|
|
|
|
strongly recommended, because it's known that it works without issues.
|
2017-01-27 16:43:49 -05:00
|
|
|
|
|
|
|
You need to create proper "android-sdk" and "android-ndk" symlinks in the
|
|
|
|
directory with Android project, so that the compilation script will have access
|
2017-08-06 17:15:08 -04:00
|
|
|
to the SDK and NDK. These paths can be also set in SDK_PATH and NDK_PATH
|
|
|
|
environmental variables.
|
2017-01-27 16:43:49 -05:00
|
|
|
|
|
|
|
Before running the compilation, run the generate_assets script, so that
|
|
|
|
selected assets will be copied to "assets" directory, and then included in the
|
|
|
|
apk file.
|
|
|
|
|
|
|
|
You can select different karts and tracks by setting KARTS and TRACKS variables
|
|
|
|
in the generate_assets.sh script at the beginning of file.
|
|
|
|
|
|
|
|
When you are creating the assets directory manually, note that the
|
|
|
|
directories.txt file is urgently needed and it is used by the application for
|
|
|
|
extracting assets.
|
|
|
|
|
|
|
|
If the assets directory is already prepared, you can run "./make.sh" command to
|
|
|
|
build the project and create an apk file. Note that all arguments are passed to
|
|
|
|
the make command, so that you can run "./make.sh -j5" for multi-threaded build.
|
|
|
|
|
|
|
|
If you want to prepare a package for particular architecture, you can choose it
|
|
|
|
by setting the COMPILE_ARCH environmental variable. At this stage, supported
|
|
|
|
architectures are "armv7", "x86" and "aarch64". The default is "armv7".
|
|
|
|
|
2017-03-05 16:02:50 -05:00
|
|
|
You can choose build type by setting BUILD_TYPE environment variable to "debug"
|
|
|
|
or "release". The default is debug build. Note that if you choose release build,
|
|
|
|
you have to manually sign the apk with your key and run zipalign.
|
|
|
|
|
2017-06-13 16:04:55 -04:00
|
|
|
Additionally you can choose the build tool by setting BUILD_TOOL environment
|
|
|
|
variable to "gradle" or "ant". Note that ant has been already removed from
|
|
|
|
Android SDK, so you have to use SDK <= 25.2.5 for building with ant. By default
|
2017-08-06 17:15:08 -04:00
|
|
|
the BUILD_TOOL is set to "gradle".
|
|
|
|
|
|
|
|
You can override the SDK build-tools version by setting the BUILD_TOOLS_VER
|
|
|
|
environment variable.
|
2017-06-13 16:04:55 -04:00
|
|
|
|
2017-01-27 16:43:49 -05:00
|
|
|
Basically if all dependencies are installed in the system, it should be enough
|
|
|
|
to just run:
|
|
|
|
|
|
|
|
export SDK_PATH=/path/to/your/android/sdk
|
|
|
|
export NDK_PATH=/path/to/your/android/ndk
|
|
|
|
./generate_assets.sh
|
|
|
|
./make.sh -j5
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-04-09 15:48:15 -04:00
|
|
|
--------------------------------------------------------------------------------
|
|
|
|
RELEASE BUILD
|
|
|
|
--------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
Making a release build is similar to typical compilation, but there are few
|
|
|
|
additional things to do.
|
|
|
|
|
|
|
|
You have to change version numbers. This is important, because assets manager
|
|
|
|
in STK checks these numbers and detects if already extracted data files are
|
|
|
|
up to date. So that when you will install new STK version, this will force new
|
|
|
|
data extraction automatically.
|
|
|
|
|
|
|
|
So that you have to:
|
|
|
|
|
|
|
|
1. Change "data/supertuxkart.git" to "data/supertuxkart.VERSION_NUMBER"
|
|
|
|
|
|
|
|
2. Open "src/utils/constants.cpp" and change:
|
|
|
|
|
|
|
|
const char STK_VERSION[] = "git";
|
|
|
|
|
|
|
|
to
|
|
|
|
|
|
|
|
const char STK_VERSION[] = "VERSION_NUMBER";
|
|
|
|
|
|
|
|
where "VERSION_NUMBER" is for example "0.9.3" or "git20170409" or whatever.
|
|
|
|
|
|
|
|
3. You can also update these lines in "android/AndroidManifest.xml":
|
|
|
|
android:versionCode="1"
|
|
|
|
android:versionName="1.0"
|
|
|
|
|
|
|
|
|
|
|
|
Before compilation you have to set:
|
|
|
|
|
|
|
|
export BUILD_TYPE=release
|
|
|
|
|
|
|
|
and then you make standard compilation with:
|
|
|
|
|
|
|
|
./generate_assets.sh
|
|
|
|
./make.sh -j5
|
|
|
|
|
|
|
|
|
|
|
|
The compiled apk is unsigned, so you have to sign it with your key. To sign it,
|
|
|
|
you have to run:
|
|
|
|
|
|
|
|
jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore \
|
|
|
|
my-release-key.keystore SuperTuxKart-release-unsigned.apk alias_name
|
|
|
|
|
|
|
|
and then:
|
|
|
|
|
|
|
|
zipalign -v 4 SuperTuxKart-release-unsigned.apk SuperTuxKart-release.apk
|