|
18 | 18 | the list of recipes was huge and result was: |
19 | 19 | [ERROR]: Didn't find any valid dependency graphs. |
20 | 20 | [ERROR]: This means that some of your requirements pull in conflicting dependencies. |
21 | | -- only rebuilds on sdl2 bootstrap |
22 | 21 | """ |
23 | 22 | import sh |
24 | 23 | import os |
@@ -57,14 +56,29 @@ def build(target_python, requirements, archs): |
57 | 56 | android_sdk_home = os.environ['ANDROID_SDK_HOME'] |
58 | 57 | android_ndk_home = os.environ['ANDROID_NDK_HOME'] |
59 | 58 | requirements.add(target_python.name) |
60 | | - requirements = ','.join(requirements) |
61 | | - logger.info('requirements: {}'.format(requirements)) |
| 59 | + requirements_str = ','.join(requirements) |
| 60 | + logger.info('requirements: {}'.format(requirements_str)) |
| 61 | + |
| 62 | + # Detect bootstrap based on requirements |
| 63 | + # SDL3 recipes conflict with SDL2, so we need the sdl3 bootstrap |
| 64 | + # when any SDL3-related recipe (sdl3, sdl3_image, sdl3_mixer, sdl3_ttf) is present |
| 65 | + bootstrap = None |
| 66 | + if any(r.startswith('sdl3') for r in requirements): |
| 67 | + bootstrap = 'sdl3' |
| 68 | + logger.info('Detected sdl3 recipe in requirements, using sdl3 bootstrap') |
| 69 | + |
62 | 70 | build_command = [ |
63 | 71 | 'setup.py', 'apk', |
64 | 72 | '--sdk-dir', android_sdk_home, |
65 | 73 | '--ndk-dir', android_ndk_home, |
66 | | - '--requirements', requirements |
67 | | - ] + [f"--arch={arch}" for arch in archs] |
| 74 | + '--requirements', requirements_str |
| 75 | + ] |
| 76 | + |
| 77 | + if bootstrap: |
| 78 | + build_command.extend(['--bootstrap', bootstrap]) |
| 79 | + |
| 80 | + build_command.extend([f"--arch={arch}" for arch in archs]) |
| 81 | + |
68 | 82 | build_command_str = " ".join(build_command) |
69 | 83 | logger.info(f"Build command: {build_command_str}") |
70 | 84 |
|
|
0 commit comments