-
Notifications
You must be signed in to change notification settings - Fork 2k
Add SDL3 bootstrap (alongside SDL3, SDL3_ttf, SDL3_mixer, SDL3_image recipes) for Kivy 3.0.0
#3125
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
pythonforandroid/bootstraps/qt/build/jni/application/src/bootstrap_name.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,3 @@ | ||
|
|
||
| #define BOOTSTRAP_USES_NO_SDL_HEADERS | ||
|
|
||
| const char bootstrap_name[] = "qt"; |
22 changes: 22 additions & 0 deletions
22
pythonforandroid/bootstraps/sdl2/build/jni/application/src/Android.mk
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| LOCAL_PATH := $(call my-dir) | ||
|
|
||
| include $(CLEAR_VARS) | ||
|
|
||
| LOCAL_MODULE := main | ||
|
|
||
| SDL_PATH := ../../SDL | ||
|
|
||
| LOCAL_C_INCLUDES := $(LOCAL_PATH)/$(SDL_PATH)/include | ||
|
|
||
| # Add your application source files here... | ||
| LOCAL_SRC_FILES := start.c | ||
|
|
||
| LOCAL_CFLAGS += -I$(PYTHON_INCLUDE_ROOT) $(EXTRA_CFLAGS) | ||
|
|
||
| LOCAL_SHARED_LIBRARIES := SDL2 python_shared | ||
|
|
||
| LOCAL_LDLIBS := -lGLESv1_CM -lGLESv2 -llog $(EXTRA_LDLIBS) | ||
|
|
||
| LOCAL_LDFLAGS += -L$(PYTHON_LINK_ROOT) $(APPLICATION_ADDITIONAL_LDFLAGS) | ||
|
|
||
| include $(BUILD_SHARED_LIBRARY) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| from os.path import join | ||
|
|
||
| import sh | ||
|
|
||
| from pythonforandroid.toolchain import ( | ||
| Bootstrap, shprint, current_directory, info, info_main) | ||
| from pythonforandroid.util import ensure_dir, rmdir | ||
|
|
||
|
|
||
| class SDL3GradleBootstrap(Bootstrap): | ||
| name = 'sdl3' | ||
|
|
||
| conflicts = ['sdl2'] | ||
|
|
||
| recipe_depends = list( | ||
| set(Bootstrap.recipe_depends).union({'sdl3'}) | ||
| ) | ||
|
AndreMiras marked this conversation as resolved.
Outdated
|
||
|
|
||
| def assemble_distribution(self): | ||
| info_main("# Creating Android project ({})".format(self.name)) | ||
|
|
||
| rmdir(self.dist_dir) | ||
| info("Copying SDL3/gradle build") | ||
| shprint(sh.cp, "-r", self.build_dir, self.dist_dir) | ||
|
|
||
| # either the build use environment variable (ANDROID_HOME) | ||
| # or the local.properties if exists | ||
| with current_directory(self.dist_dir): | ||
| with open('local.properties', 'w') as fileh: | ||
| fileh.write('sdk.dir={}'.format(self.ctx.sdk_dir)) | ||
|
|
||
| with current_directory(self.dist_dir): | ||
| info("Copying Python distribution") | ||
|
|
||
| self.distribute_javaclasses(self.ctx.javaclass_dir, | ||
| dest_dir=join("src", "main", "java")) | ||
|
|
||
| for arch in self.ctx.archs: | ||
| python_bundle_dir = join(f'_python_bundle__{arch.arch}', '_python_bundle') | ||
| ensure_dir(python_bundle_dir) | ||
|
|
||
| self.distribute_libs(arch, [self.ctx.get_libs_dir(arch.arch)]) | ||
| site_packages_dir = self.ctx.python_recipe.create_python_bundle( | ||
| join(self.dist_dir, python_bundle_dir), arch) | ||
| if not self.ctx.with_debug_symbols: | ||
| self.strip_libraries(arch) | ||
| self.fry_eggs(site_packages_dir) | ||
|
|
||
| if 'sqlite3' not in self.ctx.recipe_build_order: | ||
| with open('blacklist.txt', 'a') as fileh: | ||
| fileh.write('\nsqlite3/*\nlib-dynload/_sqlite3.so\n') | ||
|
|
||
| super().assemble_distribution() | ||
|
|
||
|
|
||
| bootstrap = SDL3GradleBootstrap() | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| .gradle | ||
| /build/ | ||
|
|
||
| # Ignore Gradle GUI config | ||
| gradle-app.setting | ||
|
|
||
| # Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored) | ||
| !gradle-wrapper.jar | ||
|
|
||
| # Cache of project | ||
| .gradletasknamecache | ||
|
|
||
| # # Work around https://youtrack.jetbrains.com/issue/IDEA-116898 | ||
| # gradle/wrapper/gradle-wrapper.properties |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,84 @@ | ||
| # prevent user to include invalid extensions | ||
| *.apk | ||
| *.aab | ||
| *.apks | ||
| *.pxd | ||
|
|
||
| # eggs | ||
| *.egg-info | ||
|
|
||
| # unit test | ||
| unittest/* | ||
|
|
||
| # python config | ||
| config/makesetup | ||
|
|
||
| # unused kivy files (platform specific) | ||
| kivy/input/providers/wm_* | ||
| kivy/input/providers/mactouch* | ||
| kivy/input/providers/probesysfs* | ||
| kivy/input/providers/mtdev* | ||
| kivy/input/providers/hidinput* | ||
| kivy/core/camera/camera_videocapture* | ||
| kivy/core/spelling/*osx* | ||
| kivy/core/video/video_pyglet* | ||
| kivy/tools | ||
| kivy/tests/* | ||
| kivy/*/*.h | ||
| kivy/*/*.pxi | ||
|
|
||
| # unused encodings | ||
| lib-dynload/*codec* | ||
| encodings/cp*.pyo | ||
| encodings/tis* | ||
| encodings/shift* | ||
| encodings/bz2* | ||
| encodings/iso* | ||
| encodings/undefined* | ||
| encodings/johab* | ||
| encodings/p* | ||
| encodings/m* | ||
| encodings/euc* | ||
| encodings/k* | ||
| encodings/unicode_internal* | ||
| encodings/quo* | ||
| encodings/gb* | ||
| encodings/big5* | ||
| encodings/hp* | ||
| encodings/hz* | ||
|
|
||
| # unused python modules | ||
| bsddb/* | ||
| wsgiref/* | ||
| hotshot/* | ||
| pydoc_data/* | ||
| tty.pyo | ||
| anydbm.pyo | ||
| nturl2path.pyo | ||
| LICENCE.txt | ||
| macurl2path.pyo | ||
| dummy_threading.pyo | ||
| audiodev.pyo | ||
| antigravity.pyo | ||
| dumbdbm.pyo | ||
| sndhdr.pyo | ||
| __phello__.foo.pyo | ||
| sunaudio.pyo | ||
| os2emxpath.pyo | ||
| multiprocessing/dummy* | ||
|
|
||
| # unused binaries python modules | ||
| lib-dynload/termios.so | ||
| lib-dynload/_lsprof.so | ||
| lib-dynload/*audioop.so | ||
| lib-dynload/_hotshot.so | ||
| lib-dynload/_heapq.so | ||
| lib-dynload/_json.so | ||
| lib-dynload/grp.so | ||
| lib-dynload/resource.so | ||
| lib-dynload/pyexpat.so | ||
| lib-dynload/_ctypes_test.so | ||
| lib-dynload/_testcapi.so | ||
|
|
||
| # odd files | ||
| plat-linux3/regen |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
|
|
||
| # Uncomment this if you're using STL in your project | ||
| # See CPLUSPLUS-SUPPORT.html in the NDK documentation for more information | ||
| # APP_STL := stlport_static | ||
|
|
||
| # APP_ABI := armeabi armeabi-v7a x86 | ||
| APP_ABI := $(ARCH) | ||
| APP_PLATFORM := $(NDK_API) |
22 changes: 22 additions & 0 deletions
22
pythonforandroid/bootstraps/sdl3/build/jni/application/src/Android.mk
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| LOCAL_PATH := $(call my-dir) | ||
|
|
||
| include $(CLEAR_VARS) | ||
|
|
||
| LOCAL_MODULE := main | ||
|
|
||
| SDL_PATH := ../../SDL | ||
|
|
||
| LOCAL_C_INCLUDES := $(LOCAL_PATH)/$(SDL_PATH)/include | ||
|
|
||
| # Add your application source files here... | ||
| LOCAL_SRC_FILES := start.c | ||
|
|
||
| LOCAL_CFLAGS += -I$(PYTHON_INCLUDE_ROOT) $(EXTRA_CFLAGS) | ||
|
|
||
| LOCAL_SHARED_LIBRARIES := SDL3 python_shared | ||
|
|
||
| LOCAL_LDLIBS := -lGLESv1_CM -lGLESv2 -llog $(EXTRA_LDLIBS) | ||
|
|
||
| LOCAL_LDFLAGS += -L$(PYTHON_LINK_ROOT) $(APPLICATION_ADDITIONAL_LDFLAGS) | ||
|
|
||
| include $(BUILD_SHARED_LIBRARY) |
13 changes: 13 additions & 0 deletions
13
pythonforandroid/bootstraps/sdl3/build/jni/application/src/Android_static.mk
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| LOCAL_PATH := $(call my-dir) | ||
|
|
||
| include $(CLEAR_VARS) | ||
|
|
||
| LOCAL_MODULE := main | ||
|
|
||
| LOCAL_SRC_FILES := start.c | ||
|
|
||
| LOCAL_STATIC_LIBRARIES := SDL3_static | ||
|
|
||
|
|
||
| include $(BUILD_SHARED_LIBRARY) | ||
| $(call import-module,SDL)LOCAL_PATH := $(call my-dir) |
5 changes: 5 additions & 0 deletions
5
pythonforandroid/bootstraps/sdl3/build/jni/application/src/bootstrap_name.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
|
|
||
| #define BOOTSTRAP_NAME_SDL3 | ||
|
|
||
| const char bootstrap_name[] = "SDL3"; // capitalized for historic reasons | ||
|
|
Empty file.
Empty file.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.