Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
kimden committed Mar 5, 2022
2 parents d444c90 + 854c31b commit 6409e31
Show file tree
Hide file tree
Showing 69 changed files with 1,521 additions and 321 deletions.
14 changes: 8 additions & 6 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
if: ${{ matrix.os == 'windows-latest' }}
run: |
echo "wget=C:\msys64\usr\bin\wget.exe" >> $GITHUB_ENV
echo "unzip=C:\msys64\usr\bin\unzip.exe" >> $GITHUB_ENV
echo "unzip=unzip" >> $GITHUB_ENV
if [ ${{ matrix.arch }} = "i686" ]; then
echo "cmake_arch=Win32" >> $GITHUB_ENV
elif [ ${{ matrix.arch }} = "x86_64" ]; then
Expand Down Expand Up @@ -118,7 +118,7 @@ jobs:
run: |
mkdir -Force build
cd build
cmake .. -G "Visual Studio 16 2019" -DCMAKE_SYSTEM_NAME=Windows -DCMAKE_SYSTEM_PROCESSOR=${{ matrix.arch }} -A ${{ env.cmake_arch }} -DCHECK_ASSETS=OFF
cmake .. -G "Visual Studio 17 2022" -DCMAKE_SYSTEM_NAME=Windows -DCMAKE_SYSTEM_PROCESSOR=${{ matrix.arch }} -A ${{ env.cmake_arch }} -DCHECK_ASSETS=OFF
- name: Configure bulid for MinGW (i686 or x86_64)
if: ${{ matrix.os == 'ubuntu-latest' && matrix.arch != 'aarch64' }}
run: |
Expand Down Expand Up @@ -213,7 +213,8 @@ jobs:
- name: Generate .pdb files
if: ${{ env.release_tag != '' }}
run: |
C:\msys64\usr\bin\wget.exe https://github.com/supertuxkart/dependencies/releases/download/preview/cv2pdb.exe
C:\msys64\usr\bin\wget.exe https://github.com/rainers/cv2pdb/releases/download/v0.50/cv2pdb-0.50.zip
unzip cv2pdb-0.50.zip
cd i686
..\cv2pdb.exe supertuxkart.exe
cd ..
Expand Down Expand Up @@ -246,7 +247,7 @@ jobs:
- name: Start packaging STK
if: ${{ env.release_tag != '' }}
run: |
C:\msys64\usr\bin\zip.exe -r SuperTuxKart-${{ env.release_tag }}-win.zip SuperTuxKart-${{ env.release_tag }}-win
Compress-Archive -LiteralPath SuperTuxKart-${{ env.release_tag }}-win -DestinationPath SuperTuxKart-${{ env.release_tag }}-win.zip
- name: Configure NSIS script
shell : bash
if: ${{ env.release_tag != '' && startsWith(github.ref, 'refs/tags/') }}
Expand All @@ -258,11 +259,12 @@ jobs:
cp supertuxkart-github-actions.nsi $arch.nsi
sed -i "s/define APPNAMEANDVERSION \"\"/define APPNAMEANDVERSION \"SuperTuxKart ${{ env.release_tag }}\"/g" $arch.nsi
sed -i "s/define ARCH \"\"/define ARCH \"$arch\"/g" $arch.nsi
sed -i "s/define VERSION \"\"/define VERSION \"${{ env.release_tag }}\"/g" $arch.nsi
sed -i "s/OutFile \"\"/OutFile \"SuperTuxKart-${{ env.release_tag }}-installer-$arch.exe\"/g" $arch.nsi
for filename in $(ls ../../build-$arch/bin)
do
file="\\\\$filename"
sed -i "286a\ DELETE /REBOOTOK \"\$INSTDIR$file\"" $arch.nsi
sed -i "288a\ DELETE /REBOOTOK \"\$INSTDIR$file\"" $arch.nsi
done
# Print result
#cat $arch.nsi
Expand All @@ -273,7 +275,7 @@ jobs:
run: |
cd SuperTuxKart-${{ env.release_tag }}-win\stk-code\tools\windows_installer
C:\msys64\usr\bin\wget.exe https://nsis.sourceforge.io/mediawiki/images/6/6c/Shelllink.zip
C:\msys64\usr\bin\unzip.exe Shelllink.zip
unzip Shelllink.zip
Move-Item Unicode\Plugins\ShellLink.dll .
& "C:\Program Files (x86)\NSIS\makensis.exe" i686.nsi
& "C:\Program Files (x86)\NSIS\makensis.exe" x86_64.nsi
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ stk-editor/
.vscode/
tags.*

# clangd
.cache/
compile_commands.json

.config/
supertuxkart-64
make*.bat
Expand Down
11 changes: 10 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ if(UNIX OR MINGW)
endif()
endif()

if(UNIX AND NOT APPLE)
if(UNIX AND NOT APPLE AND NOT ${CMAKE_SYSTEM_NAME} MATCHES "SunOS")
find_package(PkgConfig REQUIRED)

if(NOT PKGCONFIG_FOUND)
Expand Down Expand Up @@ -363,6 +363,11 @@ elseif(MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP") # Enable multi-processor compilation (faster)
endif()

if (${CMAKE_SYSTEM_NAME} MATCHES "SunOs")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m64")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m64")
endif()


# Build the angelscript library if not in system
if(USE_SYSTEM_ANGELSCRIPT)
Expand Down Expand Up @@ -691,6 +696,10 @@ if(NOT SERVER_ONLY)
endif()
endif()

if (${CMAKE_SYSTEM_NAME} MATCHES "SunOS")
target_link_libraries(supertuxkart nsl socket vorbisfile)
endif()

if (USE_DNS_C)
target_link_libraries(supertuxkart dnsc)
else()
Expand Down
18 changes: 3 additions & 15 deletions android/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -240,19 +240,6 @@ include $(BUILD_STATIC_LIBRARY)
include $(CLEAR_VARS)


# hidapi
LOCAL_MODULE := libhidapi
LOCAL_CPPFLAGS += -std=c++11
LOCAL_SRC_FILES := ../lib/sdl2/src/hidapi/android/hid.cpp
LOCAL_LDLIBS := -llog

ifeq ($(TARGET_ARCH_ABI), armeabi-v7a)
LOCAL_ARM_NEON := false
endif
include $(BUILD_SHARED_LIBRARY)
include $(CLEAR_VARS)


# SDL2
LOCAL_MODULE := SDL2
LOCAL_PATH := .
Expand All @@ -271,13 +258,15 @@ LOCAL_SRC_FILES := $(wildcard ../lib/sdl2/src/*.c) \
$(wildcard ../lib/sdl2/src/file/*.c) \
$(wildcard ../lib/sdl2/src/haptic/*.c) \
$(wildcard ../lib/sdl2/src/haptic/android/*.c) \
$(wildcard ../lib/sdl2/src/hidapi/*.c) \
$(wildcard ../lib/sdl2/src/hidapi/android/*.cpp) \
$(wildcard ../lib/sdl2/src/joystick/*.c) \
$(wildcard ../lib/sdl2/src/joystick/android/*.c) \
$(wildcard ../lib/sdl2/src/joystick/hidapi/*.c) \
$(wildcard ../lib/sdl2/src/joystick/virtual/*.c) \
$(wildcard ../lib/sdl2/src/loadso/dlopen/*.c) \
$(wildcard ../lib/sdl2/src/locale/android/*.c) \
$(wildcard ../lib/sdl2/src/locale/*.c) \
$(wildcard ../lib/sdl2/src/loadso/dlopen/*.c) \
$(wildcard ../lib/sdl2/src/misc/*.c) \
$(wildcard ../lib/sdl2/src/misc/android/*.c) \
$(wildcard ../lib/sdl2/src/power/*.c) \
Expand All @@ -297,7 +286,6 @@ LOCAL_SRC_FILES := $(wildcard ../lib/sdl2/src/*.c) \
$(wildcard ../lib/sdl2/src/video/yuv2rgb/*.c)
LOCAL_CFLAGS := -I../lib/sdl2/include/ -DGL_GLEXT_PROTOTYPES
LOCAL_LDLIBS := -ldl -lGLESv1_CM -lGLESv2 -lOpenSLES -llog -landroid
LOCAL_SHARED_LIBRARIES := hidapi
LOCAL_STATIC_LIBRARIES := cpufeatures

ifeq ($(TARGET_ARCH_ABI), armeabi-v7a)
Expand Down
14 changes: 11 additions & 3 deletions android/README.ANDROID
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ directory will have following structure:
> ...

You also need Android SDK for android-26 platform or later (SDL2 requirement) and
Android NDK. Version r22 is recommended, because it's known that it works
Android NDK. Version r23 is recommended, because it's known that it works
without issues. r24 or later is not compatible because it removes Android 4.1
support (https://github.com/android/ndk/wiki/Changelog-r23#announcements)

Expand Down Expand Up @@ -91,11 +91,18 @@ to just run:

export SDK_PATH=/path/to/your/android/sdk
export NDK_PATH=/path/to/your/android/ndk
# Optional for STK_MIN_ANDROID_SDK, STK_TARGET_ANDROID_SDK and STK_NDK_VERSION
# If unset it will use the below values
export STK_MIN_ANDROID_SDK=16
export STK_TARGET_ANDROID_SDK=30
export STK_NDK_VERSION=23.1.7779620
./generate_assets.sh
./make_deps.sh
./make.sh


You may need to add org.gradle.jvmargs=-XX:MaxHeapSize=2048m -Xmx2048m to
.gradle/gradle.properties if you see java.lang.OutOfMemoryError / Java heap
space execption error.

--------------------------------------------------------------------------------
ENVIRONMENT VARIABLES
Expand All @@ -114,7 +121,8 @@ BUILD_TOOLS_VER - Allows to override the SDK build-tools version.

SDK_PATH - Path to SDK directory

NDK_PATH - Path to NDK directory
NDK_PATH - Path to NDK directory, it should include a list of installed
NDK version folders

PROJECT_VERSION - Set Supertuxkart version number, for example "0.9.3" or
"git20170409" or whatever. The version must match with file
Expand Down
18 changes: 11 additions & 7 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,24 @@ buildscript
{
repositories
{
jcenter()
mavenCentral()
google()
}

dependencies
{
// 4.1.2 is the minimum version to support native debug symbols file
// https://developer.android.com/studio/build/shrink-code#android_gradle_plugin_version_41_or_later
classpath 'com.android.tools.build:gradle:4.1.2'
// 7.0.0 to fix https://stackoverflow.com/questions/68387270/android-studio-error-installed-build-tools-revision-31-0-0-is-corrupted
classpath 'com.android.tools.build:gradle:7.0.0'
}
}

allprojects
{
repositories
{
jcenter()
mavenCentral()
google()
}
}
Expand All @@ -27,8 +28,10 @@ apply plugin: 'com.android.application'

android
{
// buildToolsVersion is no longer needed https://developer.android.com/studio/releases/gradle-plugin.html#behavior_changes_1
// Quote:
// Build Tools 27.0.3 or higher. Keep in mind, you no longer need to specify a version for the build tools using the android.buildToolsVersion property—the plugin uses the minimum required version by default.
compileSdkVersion compile_sdk_version.toInteger()
buildToolsVersion build_tools_ver
ndkVersion ndk_version
externalNativeBuild
{
Expand All @@ -40,13 +43,14 @@ android

defaultConfig
{
minSdkVersion 16
targetSdkVersion 30
minSdkVersion min_sdk_version.toInteger()
targetSdkVersion target_sdk_version.toInteger()
externalNativeBuild
{
ndkBuild
{
arguments 'APP_PLATFORM=android-16', 'APP_STL=c++_static', cpu_core
def app_platform = "APP_PLATFORM=android-${min_sdk_version}"
arguments app_platform, 'APP_STL=c++_static', cpu_core
if (project.getProperty('compile_arch') == 'all')
{
abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'
Expand Down
2 changes: 1 addition & 1 deletion android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-all.zip
51 changes: 33 additions & 18 deletions android/make.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,17 @@ export NDK_BUILD_SCRIPT="$DIRNAME/Android.mk"
#export NDK_CCACHE=ccache
export CPU_CORE="-j$(($(nproc) + 1))"

export COMPILE_SDK_VERSION=30
if [ -z "$STK_MIN_ANDROID_SDK" ]; then
export STK_MIN_ANDROID_SDK=16
fi

if [ -z "$STK_TARGET_ANDROID_SDK" ]; then
export STK_TARGET_ANDROID_SDK=30
fi

if [ -z "$STK_NDK_VERSION" ]; then
export STK_NDK_VERSION=23.1.7779620
fi

export APP_NAME_RELEASE="SuperTuxKart"
export PACKAGE_NAME_RELEASE="org.supertuxkart.stk"
Expand Down Expand Up @@ -129,7 +139,7 @@ if [ -z "$SDK_PATH" ]; then
export SDK_PATH="$SDK_PATH_DEFAULT"
fi

NDK_PATH=$(realpath "$NDK_PATH")
NDK_PATH="$(realpath "$NDK_PATH")/${STK_NDK_VERSION}"
SDK_PATH=$(realpath "$SDK_PATH")

if [ ! -d "$NDK_PATH" ]; then
Expand Down Expand Up @@ -190,6 +200,9 @@ if [ -z "$BUILD_TOOLS_VER" ] || [ ! -d "$SDK_PATH/build-tools/$BUILD_TOOLS_VER"
exit
fi

BUILD_TOOLS_FULL=(${BUILD_TOOLS_VER//./ })
export COMPILE_SDK_VERSION="${BUILD_TOOLS_FULL[0]}"

# Set project version and code
if [ -f "$DIRNAME/obj/project_version" ]; then
PROJECT_VERSION_PREV=$(cat "$DIRNAME/obj/project_version")
Expand Down Expand Up @@ -432,25 +445,27 @@ if [ -f "/usr/lib/jvm/java-8-openjdk-amd64/bin/java" ]; then
fi

export ANDROID_HOME="$SDK_PATH"
./gradlew -Pcompile_sdk_version=$COMPILE_SDK_VERSION \
-Pbuild_tools_ver="$BUILD_TOOLS_VER" \
-Pstorepass="$STK_STOREPASS" \
-Pkeystore="$STK_KEYSTORE" \
-Palias="$STK_ALIAS" \
-Pndk_version="22.1.7171670" \
-Pcompile_arch="$COMPILE_ARCH" \
-Pcpu_core="$CPU_CORE" \
./gradlew -Pcompile_sdk_version="$COMPILE_SDK_VERSION" \
-Pmin_sdk_version="$STK_MIN_ANDROID_SDK" \
-Ptarget_sdk_version="$STK_TARGET_ANDROID_SDK" \
-Pstorepass="$STK_STOREPASS" \
-Pkeystore="$STK_KEYSTORE" \
-Palias="$STK_ALIAS" \
-Pndk_version="$STK_NDK_VERSION" \
-Pcompile_arch="$COMPILE_ARCH" \
-Pcpu_core="$CPU_CORE" \
$GRADLE_BUILD_TYPE

if [ "$GRADLE_BUILD_TYPE" = "assembleRelease" ]; then
./gradlew -Pcompile_sdk_version=$COMPILE_SDK_VERSION \
-Pbuild_tools_ver="$BUILD_TOOLS_VER" \
-Pstorepass="$STK_STOREPASS" \
-Pkeystore="$STK_KEYSTORE" \
-Palias="$STK_ALIAS" \
-Pndk_version="22.1.7171670" \
-Pcompile_arch="$COMPILE_ARCH" \
-Pcpu_core="$CPU_CORE" \
./gradlew -Pcompile_sdk_version="$COMPILE_SDK_VERSION" \
-Pmin_sdk_version="$STK_MIN_ANDROID_SDK" \
-Ptarget_sdk_version="$STK_TARGET_ANDROID_SDK" \
-Pstorepass="$STK_STOREPASS" \
-Pkeystore="$STK_KEYSTORE" \
-Palias="$STK_ALIAS" \
-Pndk_version="$STK_NDK_VERSION" \
-Pcompile_arch="$COMPILE_ARCH" \
-Pcpu_core="$CPU_CORE" \
"bundleRelease"
fi

Expand Down
6 changes: 5 additions & 1 deletion android/make_deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,11 @@ if [ -z "$NDK_PATH" ]; then
export NDK_PATH="$NDK_PATH_DEFAULT"
fi

NDK_PATH=$(realpath "$NDK_PATH")
if [ -z "$STK_NDK_VERSION" ]; then
export STK_NDK_VERSION=23.1.7779620
fi

NDK_PATH="$(realpath "$NDK_PATH")/${STK_NDK_VERSION}"
if [ ! -d "$NDK_PATH" ]; then
echo "Error: Couldn't find $NDK_PATH directory. Please create a symlink" \
"to your Android NDK installation in the $NDK_PATH_DEFAULT or set" \
Expand Down
2 changes: 1 addition & 1 deletion android/src/main/java/SuperTuxKartActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ public void onPause()
/* SDL manually dlopen main to allow unload after main thread exit. */
protected String[] getLibraries()
{
return new String[]{ "hidapi", "SDL2" };
return new String[]{ "SDL2" };
}
// ------------------------------------------------------------------------
protected String getMainSharedObject()
Expand Down
2 changes: 1 addition & 1 deletion cmake/FindFreetype.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ if(WIN32)
find_library(FREETYPE_LIBRARY NAMES freetype libfreetype PATHS "${PROJECT_SOURCE_DIR}/${DEPENDENCIES}/lib")
set(FREETYPE_FOUND 1)
set(FREETYPE_LIBRARIES ${FREETYPE_LIBRARY})
elseif(APPLE)
elseif(APPLE OR ${CMAKE_SYSTEM_NAME} MATCHES "SunOS")
find_path(FREETYPE_INCLUDE_DIRS NAMES ft2build.h PATH_SUFFIXES freetype2 include/freetype2 include)
find_library(FREETYPE_LIBRARY NAMES freetype)
set(FREETYPE_FOUND 1)
Expand Down
7 changes: 4 additions & 3 deletions data/CREDITS
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,13 @@ Karts
- Minibjorn : Puffy
- Cheleb : Nolok, Pidgin
- Néd J. Édoire : Wilber, Hexley, Beastie
- Typhon306 and McRavenINDo : Kiki
- Typhon306 and ZAQraven99 : Kiki

Karts
- Cédric Archambault : Suzanne
- Julian Schönbächler : Amanda and Gavroche
- Kinsu : Emule
- McRavenINDo : GNU, Pepper, Sara, Adiumy
- ZAQraven99 : GNU, Pepper, Sara, Adiumy

Objects
- GeekPenguinBR, TuxKartDriver : Models from Las Dunas Stadium
Expand Down Expand Up @@ -166,7 +166,8 @@ Misc songs
- The Dead Rocks
- Magne Djupvik : 'Penguin Party'
- Dundersylt : last lap, race start songs
- GeekPenguinBR : 'Jumping to the stars'
- GeekPenguinBR and Heuchi1 : 'Jumping to the stars'
- Heuchi1 : 'Alien Signal'

Misc songs
- Keith Baylis aka Vim : 'Boom-boom-boom song'
Expand Down
1 change: 0 additions & 1 deletion data/kart_characteristics.xml
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,6 @@
visual-time: How long it takes for the visual skid to reach maximum.
revert-visual-time: how long it takes when stopping a skid to revert
the visual skid and bring visuals and physics in sync again.
angular-velocity: Angular velocity to be used for the kart when skidding.
min-speed: Minimum speed a kart must have before it can skid. Must be
>0, otherwise the kart can skid at the start of the race.
time-till-bonus: How long a kart needs to skid in order to get a bonus.
Expand Down
Loading

0 comments on commit 6409e31

Please sign in to comment.