Skip to content

Commit f63ad26

Browse files
authored
Merge pull request #232 from OpenBrickProtocolFoundation/maintenance_and_update_dependencies
Maintenance and update dependencies
2 parents e07e5e2 + 76e475f commit f63ad26

File tree

34 files changed

+574
-364
lines changed

34 files changed

+574
-364
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ jobs:
109109
uses: TheMrMilchmann/setup-msvc-dev@v3
110110
with:
111111
arch: x64
112-
toolset: '14.43'
112+
toolset: '14.44'
113113

114114
- name: Setup MSYS2 (Windows)
115115
if: matrix.config.os == 'windows' && ( matrix.config.environment == 'mingw' || matrix.config.environment == 'ucrt' )
@@ -135,19 +135,8 @@ jobs:
135135
uses: Totto16/msys2-install-packages-pinned@v1
136136
with:
137137
msystem: ${{matrix.config.environment == 'mingw' && 'MINGW64' || 'UCRT64'}}
138-
# gcc-libs 14 don't provbide the virtual package cc-libs, only gcc-libs 15 (see https://github.com/msys2/MINGW-packages/commit/9fa882f7eb6f639780a13df016497a93e45544ac) provide it, so until we use gcc 15, nghttp3 < 1.10.1 needs to be used (see https://github.com/msys2/MINGW-packages/commit/16b7f94772f29f1c207764701d863d266a5de64c) since 1.10.1 needs cc-libs and not gcc-libs. The newest version matching that constraint is 1.9.0
139-
# for the other pavckages see https://github.com/msys2/MINGW-packages/commit/62308009e77d772a126313626b194e503b0e5135
140138
install: |
141-
nghttp3=1.9
142-
SDL2=2.32.4
143-
aom=3.12.0
144-
curl=8.13.0
145-
gnutls=3.8.8
146-
libarchive=3.7.9
147-
mpg123=1.32.9
148-
ngtcp2=1.12.0
149-
python=3.12.9-4
150-
gcc=14 gcc-libs=!
139+
gcc=15 gcc-libs=!
151140
152141
- name: Setup Clang (Linux) (libc++)
153142
if: matrix.config.os == 'ubuntu' && matrix.config.use-clang == true && matrix.config.use-clang_stdlib

.github/workflows/windows_installer.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
uses: TheMrMilchmann/setup-msvc-dev@v3
2424
with:
2525
arch: x64
26-
toolset: '14.43'
26+
toolset: '14.44'
2727

2828
- name: Setup meson
2929
run: |

platforms/android/app/build.gradle

Lines changed: 80 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -159,19 +159,19 @@ String getVersion() {
159159

160160
if (versionResult.getV3() != 0) {
161161
throw new Exception(
162-
'An error occured while trying to detect the version: process exited with exit code: ' +
162+
'An error occurred while trying to detect the version: process exited with exit code: ' +
163163
versionResult.getV3() +
164164
' and stderr:\n' +
165165
versionResult.getV2().join("\n")
166166
);
167167
}
168168

169169
if (versionResult.getV2() != null && !versionResult.getV2().isEmpty()) {
170-
throw new Exception('An error occured while trying to detect the version (code 1): ' + versionResult.getV2().join("\n"));
170+
throw new Exception('An error occurred while trying to detect the version (code 1): ' + versionResult.getV2().join("\n"));
171171
}
172172

173173
if (versionResult.getV1() == null || versionResult.getV1().size() != 1) {
174-
throw new Exception('An error occured while trying to detect the version (code 2): ' + versionResult.getV1().join("\n"));
174+
throw new Exception('An error occurred while trying to detect the version (code 2): ' + versionResult.getV1().join("\n"));
175175
}
176176

177177
String version = versionResult.getV1()[0];
@@ -182,7 +182,7 @@ String getVersion() {
182182

183183
for (version1 in versions) {
184184
if (version != version1) {
185-
throw new Exception("Recievd two versions, that didn't match: " + version1 + " != " + version);
185+
throw new Exception("Received two versions, that didn't match: " + version1 + " != " + version);
186186
}
187187
}
188188

@@ -192,7 +192,7 @@ String getVersion() {
192192

193193

194194
if (versions.size() == 0) {
195-
throw new Exception("ERROR: at least one version has to be detected (at least one abi has to be returend by 'getAndroidABIs()')");
195+
throw new Exception("ERROR: at least one version has to be detected (at least one abi has to be returned by 'getAndroidABIs()')");
196196
}
197197

198198
// we guarantee, that every string in there is the same, and that it has at least one entry
@@ -224,7 +224,81 @@ Boolean shouldBuildUniversalApk(List<String> abisToUse) {
224224

225225
return true;
226226

227+
}
228+
229+
230+
/**
231+
* get the meson build type
232+
* @return String
233+
*/
234+
String getMesonBuildType() {
235+
List<String> abis = getAndroidABIs();
236+
List<String> buildtypes = new ArrayList<String>();
237+
238+
for (abi in abis) {
239+
File abiDir = getABIDir(abi);
240+
241+
Tuple3<List<String>, List<String>, Integer> buildtypeResult = executePipeline(Arrays.asList(
242+
Arrays.asList("meson", "introspect", "--buildoptions", abiDir.getAbsolutePath()),
243+
Arrays.asList("jq", "-r", ".[] | select(.name == \"buildtype\") | .value")
244+
));
245+
246+
if (buildtypeResult.getV3() != 0) {
247+
throw new Exception(
248+
'An error occurred while trying to detect the buildtype: process exited with exit code: ' +
249+
buildtypeResult.getV3() +
250+
' and stderr:\n' +
251+
buildtypeResult.getV2().join("\n")
252+
);
253+
}
254+
255+
if (buildtypeResult.getV2() != null && !buildtypeResult.getV2().isEmpty()) {
256+
throw new Exception('An error occurred while trying to detect the buildtype (code 1): ' + buildtypeResult.getV2().join("\n"));
257+
}
258+
259+
if (buildtypeResult.getV1() == null || buildtypeResult.getV1().size() != 1) {
260+
throw new Exception('An error occurred while trying to detect the buildtype (code 2): ' + buildtypeResult.getV1().join("\n"));
261+
}
262+
263+
String buildtype = buildtypeResult.getV1()[0];
227264

265+
if (buildtype == "") {
266+
throw new Exception("Auto detection of buildtype returned invalid buildtype: '" + version + "'");
267+
}
268+
269+
for (buildtype1 in buildtypes) {
270+
if (buildtype != buildtype1) {
271+
throw new Exception("Received two buildtypes, that didn't match: " + buildtype1 + " != " + buildtype);
272+
}
273+
}
274+
275+
buildtypes.add(buildtype);
276+
277+
}
278+
279+
280+
if (buildtypes.size() == 0) {
281+
throw new Exception("ERROR: at least one buildtype has to be detected (at least one abi has to be returned by 'getAndroidABIs()')");
282+
}
283+
284+
// we guarantee, that every string in there is the same, and that it has at least one entry
285+
return buildtypes[0];
286+
287+
}
288+
289+
/**
290+
* Returns the aar file for discord
291+
* @return File
292+
*/
293+
File getDiscordLib() {
294+
String target = getMesonBuildType() == 'release' ? 'release' : 'debug'
295+
String path = "../../../../subprojects/discord_social_sdk/lib/" + target + "/discord_partner_sdk.aar";
296+
File file = project.file(project.getLayout().getBuildDirectory().file(path));
297+
if(!file.exists()){
298+
throw new Exception("ERROR: discord aar is not present at the location we expected it to be!")
299+
}
300+
301+
return file;
228302
}
229303

230304

@@ -315,4 +389,5 @@ android {
315389

316390
dependencies {
317391
implementation fileTree(include: ['*.jar'], dir: 'libs')
392+
implementation files(getDiscordLib())
318393
}

platforms/android/app/jni/Android.mk

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,12 @@ LOCAL_SRC_FILES := $(shell find "${SUBPROJECTS_PATH}" -name libfmt.so)
6262
include $(PREBUILT_SHARED_LIBRARY)
6363

6464

65+
include $(CLEAR_VARS)
66+
LOCAL_MODULE := spdlog
67+
LOCAL_SRC_FILES := $(shell find "${SUBPROJECTS_PATH}" -name libspdlog.so)
68+
include $(PREBUILT_SHARED_LIBRARY)
69+
70+
6571
include $(CLEAR_VARS)
6672
LOCAL_MODULE := keyutils
6773
LOCAL_SRC_FILES := $(shell find "${SUBPROJECTS_PATH}" -name libkeyutils.so)
@@ -99,7 +105,7 @@ include $(PREBUILT_SHARED_LIBRARY)
99105

100106
include $(CLEAR_VARS)
101107
LOCAL_MODULE := main
102-
LOCAL_SHARED_LIBRARIES := SDL2 sdl2_ttf freetype png16 sdl2_mixer vorbis vorbisfile ogg sdl2_image fmt keyutils oopetris_core oopetris_recordings oopetris_graphics oopetris
108+
LOCAL_SHARED_LIBRARIES := SDL2 sdl2_ttf freetype png16 sdl2_mixer vorbis vorbisfile ogg sdl2_image fmt spdlog keyutils oopetris_core oopetris_recordings oopetris_graphics oopetris
103109
LOCAL_LDLIBS := -ldl -lGLESv1_CM -lGLESv2 -lOpenSLES -llog -landroid
104110
LOCAL_LDFLAGS := -Wl,--no-undefined
105111
include $(BUILD_SHARED_LIBRARY)

platforms/android/app/src/main/AndroidManifest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
<application android:label="@string/app_name"
6363
android:icon="@mipmap/ic_launcher"
6464
android:allowBackup="true"
65-
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
65+
android:theme="@style/AppTheme"
6666
android:hardwareAccelerated="true" >
6767

6868
<!-- Example of setting SDL hints from AndroidManifest.xml:
Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
11
package com.github.oopetris;
22

33
import org.libsdl.app.SDLActivity;
4+
import com.discord.socialsdk.DiscordSocialSdkInit;
5+
import android.os.Bundle;
46

5-
/**
6-
* A sample wrapper class that just calls SDLActivity
7-
*/
7+
public class MainActivity extends SDLActivity {
88

9-
public class MainActivity extends SDLActivity { }
9+
// Setup
10+
@Override
11+
protected void onCreate(Bundle savedInstanceState) {
12+
super.onCreate(savedInstanceState);
13+
DiscordSocialSdkInit.setEngineActivity(this);
14+
}
15+
16+
}
1017

platforms/android/app/src/main/java/org/libsdl/app/SDLActivity.java

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@
6060
public class SDLActivity extends Activity implements View.OnSystemUiVisibilityChangeListener {
6161
private static final String TAG = "SDL";
6262
private static final int SDL_MAJOR_VERSION = 2;
63-
private static final int SDL_MINOR_VERSION = 30;
64-
private static final int SDL_MICRO_VERSION = 6;
63+
private static final int SDL_MINOR_VERSION = 32;
64+
private static final int SDL_MICRO_VERSION = 8;
6565
/*
6666
// Display InputType.SOURCE/CLASS of events and devices
6767
//
@@ -89,7 +89,7 @@ public static void debugSource(int sources, String prefix) {
8989
| InputDevice.SOURCE_CLASS_POSITION
9090
| InputDevice.SOURCE_CLASS_TRACKBALL);
9191
92-
if (s2 != 0) cls += "Some_Unkown";
92+
if (s2 != 0) cls += "Some_Unknown";
9393
9494
s2 = s_copy & InputDevice.SOURCE_ANY; // keep source only, no class;
9595
@@ -163,7 +163,7 @@ public static void debugSource(int sources, String prefix) {
163163
if (s == FLAG_TAINTED) src += " FLAG_TAINTED";
164164
s2 &= ~FLAG_TAINTED;
165165
166-
if (s2 != 0) src += " Some_Unkown";
166+
if (s2 != 0) src += " Some_Unknown";
167167
168168
Log.v(TAG, prefix + "int=" + s_copy + " CLASS={" + cls + " } source(s):" + src);
169169
}
@@ -791,6 +791,9 @@ public void handleMessage(Message msg) {
791791
window.clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
792792
SDLActivity.mFullscreenModeActive = false;
793793
}
794+
if (Build.VERSION.SDK_INT >= 28 /* Android 9 (Pie) */) {
795+
window.getAttributes().layoutInDisplayCutoutMode = WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES;
796+
}
794797
}
795798
} else {
796799
Log.e(TAG, "error handling message, getContext() returned no Activity");
Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1+
<?xml version="1.0" encoding="utf-8"?>
12
<resources>
2-
33
<!-- Base application theme. -->
4-
<style name="AppTheme" parent="android:Theme.Holo.Light.DarkActionBar">
4+
<style name="AppTheme" parent="android:Theme.NoTitleBar.Fullscreen">
55
<!-- Customize your theme here. -->
66
</style>
7-
87
</resources>

platforms/build-3ds.sh

Lines changed: 24 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,13 @@ APP_ROMFS='$ROMFS'
156156
157157
EOF
158158

159+
# source dependency version information
160+
161+
SCRIPT_DIR="$(realpath "$(dirname -- "${BASH_SOURCE[0]}")")"
162+
163+
# shellcheck source=./platforms/versions.sh
164+
source "$SCRIPT_DIR/versions.sh"
165+
159166
## build sdl2 and libraries (ttf, mixer, image)
160167

161168
export SDL_TOP_BUILD_DIR="SDL2_local_build_3ds"
@@ -173,15 +180,15 @@ mkdir -p "$SDL_ROOT_DIR"
173180

174181
# build sdl2
175182

176-
export SDL2_SRC_DIR="SDL2-2.30.6"
183+
export SDL2_SRC_DIR="SDL2-${SDL_3DS_VERSION}"
177184

178185
if [ ! -d "$SDL2_SRC_DIR" ]; then
179186

180-
wget "https://github.com/libsdl-org/SDL/releases/download/release-2.30.6/SDL2-2.30.6.tar.gz"
181-
tar xzf SDL2-2.30.6.tar.gz
182-
rm -rf SDL2-2.30.6.tar.gz
187+
wget "https://github.com/libsdl-org/SDL/releases/download/release-${SDL_3DS_VERSION}/SDL2-${SDL_3DS_VERSION}.tar.gz"
188+
tar xzf "SDL2-${SDL_3DS_VERSION}.tar.gz"
189+
rm -rf "SDL2-${SDL_3DS_VERSION}.tar.gz"
183190

184-
cd $SDL2_SRC_DIR
191+
cd "$SDL2_SRC_DIR"
185192

186193
cmake -S. "-B$SDL_BUILD_DIR" -DCMAKE_TOOLCHAIN_FILE="$DEVKITPRO/cmake/3DS.cmake" -DCMAKE_BUILD_TYPE=Release "-DCMAKE_INSTALL_PREFIX=$SDL_ROOT_DIR/"
187194
cmake --build "$SDL_BUILD_DIR"
@@ -195,13 +202,13 @@ export SDL_CMAKE_DIR="$SDL_ROOT_DIR/lib/cmake/SDL2"
195202

196203
# build sdl2_ttf
197204

198-
export SDL2_TTF_SRC_DIR="SDL2_ttf-2.22.0"
205+
export SDL2_TTF_SRC_DIR="SDL2_ttf-${SDL_TTF_3DS_VERSION}"
199206

200207
if [ ! -d "$SDL2_TTF_SRC_DIR" ]; then
201208

202-
wget "https://github.com/libsdl-org/SDL_ttf/releases/download/release-2.22.0/SDL2_ttf-2.22.0.tar.gz"
203-
tar xzf SDL2_ttf-2.22.0.tar.gz
204-
rm -rf SDL2_ttf-2.22.0.tar.gz
209+
wget "https://github.com/libsdl-org/SDL_ttf/releases/download/release-${SDL_TTF_3DS_VERSION}/SDL2_ttf-${SDL_TTF_3DS_VERSION}.tar.gz"
210+
tar xzf "SDL2_ttf-${SDL_TTF_3DS_VERSION}.tar.gz"
211+
rm -rf "SDL2_ttf-${SDL_TTF_3DS_VERSION}.tar.gz"
205212

206213
cd $SDL2_TTF_SRC_DIR
207214

@@ -215,13 +222,13 @@ fi
215222

216223
# build sdl2_mixer
217224

218-
export SDL2_MIXER_SRC_DIR="SDL2_mixer-2.8.0"
225+
export SDL2_MIXER_SRC_DIR="SDL2_mixer-${SDL_MIXER_3DS_VERSION}"
219226

220227
if [ ! -d "$SDL2_MIXER_SRC_DIR" ]; then
221228

222-
wget "https://github.com/libsdl-org/SDL_mixer/releases/download/release-2.8.0/SDL2_mixer-2.8.0.tar.gz"
223-
tar xzf SDL2_mixer-2.8.0.tar.gz
224-
rm -rf SDL2_mixer-2.8.0.tar.gz
229+
wget "https://github.com/libsdl-org/SDL_mixer/releases/download/release-${SDL_MIXER_3DS_VERSION}/SDL2_mixer-${SDL_MIXER_3DS_VERSION}.tar.gz"
230+
tar xzf "SDL2_mixer-${SDL_MIXER_3DS_VERSION}.tar.gz"
231+
rm -rf "SDL2_mixer-${SDL_MIXER_3DS_VERSION}.tar.gz"
225232

226233
cd $SDL2_MIXER_SRC_DIR
227234

@@ -235,13 +242,13 @@ fi
235242

236243
# build sdl2_image
237244

238-
export SDL2_IMAGE_SRC_DIR="SDL2_image-2.8.2"
245+
export SDL2_IMAGE_SRC_DIR="SDL2_image-${SDL_IMAGE_3DS_VERSION}"
239246

240247
if [ ! -d "$SDL2_IMAGE_SRC_DIR" ]; then
241248

242-
wget "https://github.com/libsdl-org/SDL_image/releases/download/release-2.8.2/SDL2_image-2.8.2.tar.gz"
243-
tar xzf SDL2_image-2.8.2.tar.gz
244-
rm -rf SDL2_image-2.8.2.tar.gz
249+
wget "https://github.com/libsdl-org/SDL_image/releases/download/release-${SDL_IMAGE_3DS_VERSION}/SDL2_image-${SDL_IMAGE_3DS_VERSION}.tar.gz"
250+
tar xzf "SDL2_image-${SDL_IMAGE_3DS_VERSION}.tar.gz"
251+
rm -rf "SDL2_image-${SDL_IMAGE_3DS_VERSION}.tar.gz"
245252

246253
cd $SDL2_IMAGE_SRC_DIR
247254

0 commit comments

Comments
 (0)