Skip to content
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

Add SDL3 bootstrap (alongside SDL3, SDL3_ttf, SDL3_mixer, SDL3_image recipes) for Kivy 3.0.0 #3125

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

misl6
Copy link
Member

@misl6 misl6 commented Mar 16, 2025

  • Adds sdl3 bootstrap (alongside sdl3, sdl3_ttf, sdl3_mixer, sdl3_image recipes)
  • Allow kivy recipe to build with sdl3 support (but keeps sdl2 support)
  • Allow android and pyjnius recipe to build with sdl3 support (but keeps sdl2 support)
  • ⚠️ Test updated recipes is failing for an obvious reason (uses sdl2 boostrap but tries to build sdl3 which is incompatible)

Similar to kivy/kivy-ios#961

@misl6 misl6 changed the title [WIP] Add SDL3 bootstrap Add SDL3 bootstrap (and allow kivy to build with it) Apr 8, 2025
@misl6 misl6 changed the title Add SDL3 bootstrap (and allow kivy to build with it) Add SDL3 bootstrap (alongside SDL3, SDL3_ttf, SDL3_mixer, SDL3_image recipes) for Kivy 3.0.0 Apr 8, 2025
@misl6 misl6 requested a review from AndreMiras April 8, 2025 19:20
Copy link
Member

@AndreMiras AndreMiras left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Incredible work again 👏
Made some minor suggestions, but nothing blocking, feel free to address in some follow up or never.
Thanks for the hard work, I can't wait to see it merged

sdl2_recipe = Recipe.get_recipe("sdl2", self.ctx)
sdl2_build_dir = sdl2_recipe.get_jni_dir()
src_dir = join(sdl2_build_dir, "SDL", "android-project",
if self.name in ["sdl2", "sdl3"]:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it make sense to have a variable for all supported SDL?

SDL_BOOTSTRAPS = ("sdl2", "sdl3")

@@ -541,7 +541,7 @@ def make_package(args):
"debug": "debug" in args.build_mode,
"native_services": args.native_services
}
if get_bootstrap_name() == "sdl2":
if get_bootstrap_name() in ["sdl2", "sdl3"]:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is_sdl_bootstrap() maybe?

class LibSDL3Recipe(BootstrapNDKRecipe):
version = "3.2.8"
url = "https://github.com/libsdl-org/SDL/releases/download/release-{version}/SDL3-{version}.tar.gz"
# md5sum = 'a344eb827a03045c9b399e99af4af13d'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe fix the sum or remove the code?

Comment on lines +10 to +13
url = "https://github.com/libsdl-org/SDL/releases/download/release-{version}/SDL3-{version}.tar.gz"
# md5sum = 'a344eb827a03045c9b399e99af4af13d'

dir_name = "SDL"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

conflicts = ['sdl2']

Same thing for the SDL2GradleBootstrap bootstrap, it could also have the conflicts = ['sdl3']

import sh


class LibSDL3Recipe(BootstrapNDKRecipe):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In a follow up maybe we could inherit from a base LibSDLBootstrapNDKRecipe since 2 and 3 have quite a lot in commun.

class LibSDL3Recipe(LibSDLBootstrapNDKRecipe):

Comment on lines +10 to +17
class SDL3GradleBootstrap(Bootstrap):
name = 'sdl3'

conflicts = ['sdl2']

recipe_depends = list(
set(Bootstrap.recipe_depends).union({'sdl3'})
)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is also almost an exact copy of SDL2GradleBootstrap, maybe we can have a SDLGradleBootstrap and inherit from it

Comment on lines +18 to +19
-cdef extern JNIEnv *SDL_AndroidGetJNIEnv()
+cdef extern JNIEnv *SDL_GetAndroidJNIEnv()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not too clear to me why we changed it SDL3 and not SDL2, why is this needed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants