Skip to content

Commit 144bff9

Browse files
committed
Ported SDL2_image fix on Android to SDL2_image 2.0.1
The changes are the same as the patch at https://hg.libsdl.org/SDL_image/rev/7ad06019831d, but modified for version 2.0.1.
1 parent 779a584 commit 144bff9

File tree

2 files changed

+53
-3
lines changed

2 files changed

+53
-3
lines changed

pythonforandroid/recipes/sdl2_image/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44

55
class LibSDL2Image(BootstrapNDKRecipe):
66
version = '2.0.1'
7-
# url = 'https://www.libsdl.org/projects/SDL_image/release/SDL2_image-{version}.tar.gz'
8-
url = 'https://hg.libsdl.org/SDL_image/archive/tip.tar.gz'
7+
url = 'https://www.libsdl.org/projects/SDL_image/release/SDL2_image-{version}.tar.gz'
98
dir_name = 'SDL2_image'
109

1110
patches = ['toggle_jpg_png_webp.patch',
1211
('disable_jpg.patch', is_arch('x86')),
13-
'extra_cflags.patch']
12+
'extra_cflags.patch',
13+
'fix_with_ndk_15_plus.patch']
1414

1515
recipe = LibSDL2Image()
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
diff --git a/Android.mk b/Android.mk
2+
index 97a96c7..2e724c0 100644
3+
--- a/Android.mk
4+
+++ b/Android.mk
5+
@@ -79,6 +79,7 @@ ifeq ($(SUPPORT_JPG),true)
6+
$(JPG_LIBRARY_PATH)/jfdctfst.c \
7+
$(JPG_LIBRARY_PATH)/jfdctint.c \
8+
$(JPG_LIBRARY_PATH)/jidctflt.c \
9+
+ $(JPG_LIBRARY_PATH)/jidctfst.c \
10+
$(JPG_LIBRARY_PATH)/jidctint.c \
11+
$(JPG_LIBRARY_PATH)/jquant1.c \
12+
$(JPG_LIBRARY_PATH)/jquant2.c \
13+
@@ -86,12 +87,6 @@ ifeq ($(SUPPORT_JPG),true)
14+
$(JPG_LIBRARY_PATH)/jmemmgr.c \
15+
$(JPG_LIBRARY_PATH)/jmem-android.c
16+
17+
- # assembler support is available for arm
18+
- ifeq ($(TARGET_ARCH),arm)
19+
- LOCAL_SRC_FILES += $(JPG_LIBRARY_PATH)/jidctfst.S
20+
- else
21+
- LOCAL_SRC_FILES += $(JPG_LIBRARY_PATH)/jidctfst.c
22+
- endif
23+
endif
24+
25+
ifeq ($(SUPPORT_PNG),true)
26+
diff --git a/external/jpeg-9/Android.mk b/external/jpeg-9/Android.mk
27+
index a5edbde..77f139c 100644
28+
--- a/external/jpeg-9/Android.mk
29+
+++ b/external/jpeg-9/Android.mk
30+
@@ -14,20 +14,6 @@ LOCAL_SRC_FILES := \
31+
jquant2.c jutils.c jmemmgr.c \
32+
jmem-android.c
33+
34+
-# the assembler is only for the ARM version, don't break the Linux sim
35+
-ifneq ($(TARGET_ARCH),arm)
36+
-ANDROID_JPEG_NO_ASSEMBLER := true
37+
-endif
38+
-
39+
-# temp fix until we understand why this broke cnn.com
40+
-#ANDROID_JPEG_NO_ASSEMBLER := true
41+
-
42+
-ifeq ($(strip $(ANDROID_JPEG_NO_ASSEMBLER)),true)
43+
-LOCAL_SRC_FILES += jidctint.c jidctfst.c
44+
-else
45+
-LOCAL_SRC_FILES += jidctint.c jidctfst.S
46+
-endif
47+
-
48+
LOCAL_CFLAGS += -DAVOID_TABLES
49+
LOCAL_CFLAGS += -O3 -fstrict-aliasing -fprefetch-loop-arrays
50+
#LOCAL_CFLAGS += -march=armv6j

0 commit comments

Comments
 (0)