Skip to content

Commit be80cef

Browse files
committed
Update Android SDK to API version 34
1 parent 8f3d915 commit be80cef

File tree

8 files changed

+189
-68
lines changed

8 files changed

+189
-68
lines changed

Diff for: android/app/build.gradle

+5-4
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,14 @@ plugins {
33
}
44

55
android {
6-
compileSdk 33
6+
compileSdk 34
7+
ndkVersion "26.3.11579264"
78
namespace "com.neodesys.minedigger"
89

910
defaultConfig {
10-
minSdk 16
11-
targetSdk 33
12-
versionCode 4
11+
minSdk 21
12+
targetSdk 34
13+
versionCode 5
1314
versionName "1.0"
1415
}
1516

Diff for: android/build-external-libs

+3-6
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ readonly PATCH_DIR="patch"
3131
readonly DEST_DIR="app/prebuild"
3232

3333
readonly ANDROID_ABI="all"
34-
readonly ANDROID_VERSION="16"
34+
readonly ANDROID_VERSION="21"
3535

3636
readonly ZENITY=`which zenity`
3737
readonly NDK_BUILD=`which ndk-build`
@@ -136,15 +136,14 @@ function buildAndroidLibs()
136136

137137
#Patch external sources
138138
if [ -f "$PATCH_DIR/${MODULE}.patch" ]; then
139-
if ! patch -bd "$SRC_DIR" -r - <"$PATCH_DIR/${MODULE}.patch" &>$DEBUG_STREAM; then
140-
rm -f "$SRC_DIR/Android.mk.orig"
139+
if ! patch -d "$SRC_DIR" -p1 -r - <"$PATCH_DIR/${MODULE}.patch" &>$DEBUG_STREAM; then
141140
echo -e "\033[1;31mCannot apply sources patch to $SRC_DIR\033[0m" >&2
142141
return 3
143142
fi
144143
fi
145144

146145
#Create Application.mk file
147-
trap 'rm -f "$SRC_DIR/Application.mk"; mv -f "$SRC_DIR/Android.mk.orig" "$SRC_DIR/Android.mk" 2>/dev/null; rm -rf "$SRC_DIR/obj"; exit 0' SIGHUP SIGINT SIGQUIT SIGABRT SIGKILL SIGTERM
146+
trap 'rm -rf "$SRC_DIR/obj"; exit 0' SIGHUP SIGINT SIGQUIT SIGABRT SIGKILL SIGTERM
148147

149148
cat <<-EOF > "$SRC_DIR/Application.mk"
150149
APP_BUILD_SCRIPT := Android.mk
@@ -179,8 +178,6 @@ EOF
179178
RET=4
180179
fi
181180

182-
rm -f "$SRC_DIR/Application.mk"
183-
mv -f "$SRC_DIR/Android.mk.orig" "$SRC_DIR/Android.mk" 2>$DEBUG_STREAM
184181
rm -rf "$SRC_DIR/obj"
185182

186183
return $RET

Diff for: android/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ buildscript {
44
mavenCentral()
55
}
66
dependencies {
7-
classpath "com.android.tools.build:gradle:8.1.0"
7+
classpath 'com.android.tools.build:gradle:8.4.1'
88
}
99
}
1010

Diff for: android/gradle/wrapper/gradle-wrapper.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

Diff for: android/patch/SDL2.patch

+30-6
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,35 @@
1-
--- Android.mk
2-
+++ Android.mk
3-
@@ -61,7 +61,7 @@
4-
1+
---
2+
Android.mk | 4 ++--
3+
src/render/opengles2/SDL_gles2funcs.h | 4 ++--
4+
2 files changed, 4 insertions(+), 4 deletions(-)
5+
6+
diff --git a/Android.mk b/Android.mk
7+
index 4f94082..a213083 100755
8+
--- a/Android.mk
9+
+++ b/Android.mk
10+
@@ -61,9 +61,9 @@ LOCAL_MODULE := SDL2_static
11+
512
LOCAL_MODULE_FILENAME := libSDL2
6-
13+
714
-LOCAL_SRC_FILES += $(LOCAL_PATH)/src/main/android/SDL_android_main.c
815
+LOCAL_SRC_FILES += src/main/android/SDL_android_main.c
9-
16+
1017
LOCAL_LDLIBS :=
1118
LOCAL_EXPORT_LDLIBS := -Wl,--undefined=Java_org_libsdl_app_SDLActivity_nativeInit -ldl -lGLESv1_CM -lGLESv2 -llog -landroid
19+
20+
include $(BUILD_STATIC_LIBRARY)
21+
diff --git a/src/render/opengles2/SDL_gles2funcs.h b/src/render/opengles2/SDL_gles2funcs.h
22+
index c2a20f7..7178659 100644
23+
--- a/src/render/opengles2/SDL_gles2funcs.h
24+
+++ b/src/render/opengles2/SDL_gles2funcs.h
25+
@@ -53,7 +53,7 @@ SDL_PROC(void, glPixelStorei, (GLenum, GLint))
26+
SDL_PROC(void, glReadPixels, (GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, GLvoid*))
27+
SDL_PROC(void, glScissor, (GLint, GLint, GLsizei, GLsizei))
28+
SDL_PROC(void, glShaderBinary, (GLsizei, const GLuint *, GLenum, const void *, GLsizei))
29+
-SDL_PROC(void, glShaderSource, (GLuint, GLsizei, const char **, const GLint *))
30+
+SDL_PROC(void, glShaderSource, (GLuint, GLsizei, const char *const *, const GLint *))
31+
SDL_PROC(void, glTexImage2D, (GLenum, GLint, GLint, GLsizei, GLsizei, GLint, GLenum, GLenum, const void *))
32+
SDL_PROC(void, glTexParameteri, (GLenum, GLenum, GLint))
33+
SDL_PROC(void, glTexSubImage2D, (GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *))
34+
--
35+
2.34.1

Diff for: android/patch/SDL2_image.patch

+40-19
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,46 @@
1-
--- Android.mk
2-
+++ Android.mk
3-
@@ -2,7 +2,8 @@
4-
1+
---
2+
Android.mk | 14 +++++++-------
3+
external/jpeg-9/jmem-android.c | 1 +
4+
2 files changed, 8 insertions(+), 7 deletions(-)
5+
6+
diff --git a/Android.mk b/Android.mk
7+
index c2080dd..d991665 100644
8+
--- a/Android.mk
9+
+++ b/Android.mk
10+
@@ -2,7 +2,8 @@ LOCAL_PATH := $(call my-dir)
11+
512
include $(CLEAR_VARS)
6-
13+
714
-LOCAL_MODULE := SDL2_image
815
+LOCAL_MODULE := SDL2_image_static
916
+LOCAL_MODULE_FILENAME := libSDL2_image
10-
17+
1118
# Enable this if you want to support loading JPEG images
1219
# The library path should be a relative path to this directory.
13-
@@ -16,11 +17,11 @@
14-
20+
@@ -16,11 +17,11 @@ PNG_LIBRARY_PATH := external/libpng-1.6.2
21+
1522
# Enable this if you want to support loading WebP images
1623
# The library path should be a relative path to this directory.
1724
-SUPPORT_WEBP := true
1825
+SUPPORT_WEBP := false
1926
WEBP_LIBRARY_PATH := external/libwebp-0.3.0
20-
21-
27+
28+
2229
-LOCAL_C_INCLUDES := $(LOCAL_PATH)
2330
+LOCAL_C_INCLUDES := $(LOCAL_PATH) ../SDL2-2.0.3/include
2431
LOCAL_CFLAGS := -DLOAD_BMP -DLOAD_GIF -DLOAD_LBM -DLOAD_PCX -DLOAD_PNM \
2532
-DLOAD_TGA -DLOAD_XCF -DLOAD_XPM -DLOAD_XV
2633
LOCAL_CFLAGS += -O3 -fstrict-aliasing -fprefetch-loop-arrays
27-
@@ -29,7 +30,7 @@
28-
34+
@@ -29,7 +30,7 @@ LOCAL_SRC_FILES := $(notdir $(filter-out %/showimage.c, $(wildcard $(LOCAL_PATH)
35+
2936
LOCAL_LDLIBS :=
3037
LOCAL_STATIC_LIBRARIES :=
3138
-LOCAL_SHARED_LIBRARIES := SDL2
3239
+LOCAL_SHARED_LIBRARIES :=
33-
40+
3441
ifeq ($(SUPPORT_JPG),true)
3542
LOCAL_C_INCLUDES += $(LOCAL_PATH)/$(JPG_LIBRARY_PATH)
36-
@@ -77,7 +78,7 @@
43+
@@ -77,7 +78,7 @@ ifeq ($(SUPPORT_JPG),true)
3744
$(JPG_LIBRARY_PATH)/jfdctfst.c \
3845
$(JPG_LIBRARY_PATH)/jfdctint.c \
3946
$(JPG_LIBRARY_PATH)/jidctflt.c \
@@ -42,17 +49,31 @@
4249
$(JPG_LIBRARY_PATH)/jidctint.c \
4350
$(JPG_LIBRARY_PATH)/jquant1.c \
4451
$(JPG_LIBRARY_PATH)/jquant2.c \
45-
@@ -107,7 +108,6 @@
52+
@@ -107,7 +108,6 @@ ifeq ($(SUPPORT_PNG),true)
4653
$(PNG_LIBRARY_PATH)/pngwrite.c \
4754
$(PNG_LIBRARY_PATH)/pngwtran.c \
4855
$(PNG_LIBRARY_PATH)/pngwutil.c
4956
- LOCAL_LDLIBS += -lz
5057
endif
51-
58+
5259
ifeq ($(SUPPORT_WEBP),true)
53-
@@ -118,4 +118,4 @@
54-
60+
@@ -118,4 +118,4 @@ endif
61+
5562
LOCAL_EXPORT_C_INCLUDES += $(LOCAL_C_INCLUDES)
56-
63+
5764
-include $(BUILD_SHARED_LIBRARY)
5865
+include $(BUILD_STATIC_LIBRARY)
66+
diff --git a/external/jpeg-9/jmem-android.c b/external/jpeg-9/jmem-android.c
67+
index 5da4d0a..271233d 100644
68+
--- a/external/jpeg-9/jmem-android.c
69+
+++ b/external/jpeg-9/jmem-android.c
70+
@@ -28,6 +28,7 @@ extern void free JPP((void *ptr));
71+
#define SEEK_SET 0 /* if not, assume 0 is correct */
72+
#endif
73+
74+
+#include <unistd.h>
75+
76+
/*
77+
* Memory allocation and freeing are controlled by the regular library
78+
--
79+
2.34.1

Diff for: android/patch/SDL2_mixer.patch

+88-18
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,122 @@
1-
--- Android.mk
2-
+++ Android.mk
3-
@@ -2,21 +2,22 @@
4-
1+
---
2+
Android.mk | 15 ++++++++-------
3+
load_ogg.c | 16 ++++++++--------
4+
music_ogg.c | 8 ++++----
5+
3 files changed, 20 insertions(+), 19 deletions(-)
6+
7+
diff --git a/Android.mk b/Android.mk
8+
index 81c94b5..06e6973 100644
9+
--- a/Android.mk
10+
+++ b/Android.mk
11+
@@ -2,21 +2,22 @@ LOCAL_PATH := $(call my-dir)
12+
513
include $(CLEAR_VARS)
6-
14+
715
-LOCAL_MODULE := SDL2_mixer
816
+LOCAL_MODULE := SDL2_mixer_static
917
+LOCAL_MODULE_FILENAME := libSDL2_mixer
10-
18+
1119
# Enable this if you want to support loading MOD music via modplug
1220
# The library path should be a relative path to this directory.
1321
-SUPPORT_MOD_MODPLUG := true
1422
+SUPPORT_MOD_MODPLUG := false
1523
MODPLUG_LIBRARY_PATH := external/libmodplug-0.8.8.4
16-
24+
1725
# Enable this if you want to support loading MOD music via mikmod
1826
# The library path should be a relative path to this directory.
1927
-SUPPORT_MOD_MIKMOD := true
2028
+SUPPORT_MOD_MIKMOD := false
2129
MIKMOD_LIBRARY_PATH := external/libmikmod-3.1.12
22-
30+
2331
# Enable this if you want to support loading MP3 music via SMPEG
2432
# The library path should be a relative path to this directory.
2533
-SUPPORT_MP3_SMPEG := true
2634
+SUPPORT_MP3_SMPEG := false
2735
SMPEG_LIBRARY_PATH := external/smpeg2-2.0.0
28-
36+
2937
# Enable this if you want to support loading OGG Vorbis music via Tremor
30-
@@ -26,14 +27,14 @@
38+
@@ -26,14 +27,14 @@ OGG_LIBRARY_PATH := external/libogg-1.3.1
3139
VORBIS_LIBRARY_PATH := external/libvorbisidec-1.2.1
32-
33-
40+
41+
3442
-LOCAL_C_INCLUDES := $(LOCAL_PATH)
3543
+LOCAL_C_INCLUDES := $(LOCAL_PATH) ../SDL2-2.0.3/include
3644
LOCAL_CFLAGS := -DWAV_MUSIC
37-
45+
3846
LOCAL_SRC_FILES := $(notdir $(filter-out %/playmus.c %/playwave.c, $(wildcard $(LOCAL_PATH)/*.c)))
39-
47+
4048
LOCAL_LDLIBS :=
4149
LOCAL_STATIC_LIBRARIES :=
4250
-LOCAL_SHARED_LIBRARIES := SDL2
4351
+LOCAL_SHARED_LIBRARIES :=
44-
52+
4553
ifeq ($(SUPPORT_MOD_MODPLUG),true)
4654
LOCAL_C_INCLUDES += $(LOCAL_PATH)/$(MODPLUG_LIBRARY_PATH)/src $(LOCAL_PATH)/$(MODPLUG_LIBRARY_PATH)/src/libmodplug
47-
@@ -110,4 +111,4 @@
48-
55+
@@ -110,4 +111,4 @@ endif
56+
4957
LOCAL_EXPORT_C_INCLUDES += $(LOCAL_C_INCLUDES)
50-
58+
5159
-include $(BUILD_SHARED_LIBRARY)
5260
+include $(BUILD_STATIC_LIBRARY)
61+
diff --git a/load_ogg.c b/load_ogg.c
62+
index 4b92f44..c1e1e7a 100644
63+
--- a/load_ogg.c
64+
+++ b/load_ogg.c
65+
@@ -43,24 +43,24 @@ static size_t sdl_read_func(void *ptr, size_t size, size_t nmemb, void *datasour
66+
return SDL_RWread((SDL_RWops*)datasource, ptr, size, nmemb);
67+
}
68+
69+
-static Sint64 sdl_seek_func(void *datasource, ogg_int64_t offset, int whence)
70+
+static int sdl_seek_func(void *datasource, ogg_int64_t offset, int whence)
71+
{
72+
- return SDL_RWseek((SDL_RWops*)datasource, offset, whence);
73+
+ return (int)SDL_RWseek((SDL_RWops*)datasource, offset, whence);
74+
}
75+
76+
-static Sint64 sdl_close_func_freesrc(void *datasource)
77+
+static int sdl_close_func_freesrc(void *datasource)
78+
{
79+
- return SDL_RWclose((SDL_RWops*)datasource);
80+
+ return (int)SDL_RWclose((SDL_RWops*)datasource);
81+
}
82+
83+
-static Sint64 sdl_close_func_nofreesrc(void *datasource)
84+
+static int sdl_close_func_nofreesrc(void *datasource)
85+
{
86+
- return SDL_RWseek((SDL_RWops*)datasource, 0, RW_SEEK_SET);
87+
+ return (int)SDL_RWseek((SDL_RWops*)datasource, 0, RW_SEEK_SET);
88+
}
89+
90+
-static Sint64 sdl_tell_func(void *datasource)
91+
+static long sdl_tell_func(void *datasource)
92+
{
93+
- return SDL_RWtell((SDL_RWops*)datasource);
94+
+ return (long)SDL_RWtell((SDL_RWops*)datasource);
95+
}
96+
97+
98+
diff --git a/music_ogg.c b/music_ogg.c
99+
index 5997cc7..fb42a35 100644
100+
--- a/music_ogg.c
101+
+++ b/music_ogg.c
102+
@@ -56,14 +56,14 @@ static size_t sdl_read_func(void *ptr, size_t size, size_t nmemb, void *datasour
103+
return SDL_RWread((SDL_RWops*)datasource, ptr, size, nmemb);
104+
}
105+
106+
-static Sint64 sdl_seek_func(void *datasource, ogg_int64_t offset, int whence)
107+
+static int sdl_seek_func(void *datasource, ogg_int64_t offset, int whence)
108+
{
109+
- return SDL_RWseek((SDL_RWops*)datasource, offset, whence);
110+
+ return (int)SDL_RWseek((SDL_RWops*)datasource, offset, whence);
111+
}
112+
113+
-static Sint64 sdl_tell_func(void *datasource)
114+
+static long sdl_tell_func(void *datasource)
115+
{
116+
- return SDL_RWtell((SDL_RWops*)datasource);
117+
+ return (long)SDL_RWtell((SDL_RWops*)datasource);
118+
}
119+
120+
/* Load an OGG stream from an SDL_RWops object */
121+
--
122+
2.34.1

0 commit comments

Comments
 (0)