Skip to content

Commit 7183fd6

Browse files
committed
Merge branch 'sdl3-recipe' of https://github.com/DexerBR/python-for-android into sdl3-recipe
2 parents baffd42 + 36c2416 commit 7183fd6

File tree

4 files changed

+36
-8
lines changed

4 files changed

+36
-8
lines changed

.dockerignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ bin/
66
*.pyc
77
**/__pycache__
88
*.egg-info/
9+
docker-data/

.github/workflows/push.yml

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ jobs:
9898
- name: Maximize build space
9999
uses: easimon/maximize-build-space@v10
100100
with:
101-
root-reserve-mb: 30720
101+
root-reserve-mb: 4096
102102
swap-size-mb: 1024
103103
remove-dotnet: 'true'
104104
remove-android: 'true'
@@ -107,6 +107,13 @@ jobs:
107107
remove-docker-images: 'true'
108108
- name: Checkout python-for-android
109109
uses: actions/checkout@v5
110+
- name: Relocate Docker data directory
111+
run: |
112+
sudo systemctl stop docker
113+
sudo mkdir -p "${GITHUB_WORKSPACE}/docker-data"
114+
echo '{"data-root": "'${GITHUB_WORKSPACE}/docker-data'"}' | sudo tee /etc/docker/daemon.json
115+
sudo systemctl start docker
116+
docker info | grep "Docker Root Dir"
110117
- name: Build python-for-android docker image
111118
run: |
112119
docker build --tag=kivy/python-for-android .
@@ -224,7 +231,7 @@ jobs:
224231
- name: Maximize build space
225232
uses: easimon/maximize-build-space@v10
226233
with:
227-
root-reserve-mb: 30720
234+
root-reserve-mb: 4096
228235
swap-size-mb: 1024
229236
remove-dotnet: 'true'
230237
remove-android: 'true'
@@ -235,6 +242,13 @@ jobs:
235242
uses: actions/checkout@v5
236243
with:
237244
fetch-depth: 0
245+
- name: Relocate Docker data directory
246+
run: |
247+
sudo systemctl stop docker
248+
sudo mkdir -p "${GITHUB_WORKSPACE}/docker-data"
249+
echo '{"data-root": "'${GITHUB_WORKSPACE}/docker-data'"}' | sudo tee /etc/docker/daemon.json
250+
sudo systemctl start docker
251+
docker info | grep "Docker Root Dir"
238252
- name: Pull docker image
239253
run: |
240254
make docker/pull

ci/rebuild_updated_recipes.py

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
the list of recipes was huge and result was:
1919
[ERROR]: Didn't find any valid dependency graphs.
2020
[ERROR]: This means that some of your requirements pull in conflicting dependencies.
21-
- only rebuilds on sdl2 bootstrap
2221
"""
2322
import sh
2423
import os
@@ -57,14 +56,29 @@ def build(target_python, requirements, archs):
5756
android_sdk_home = os.environ['ANDROID_SDK_HOME']
5857
android_ndk_home = os.environ['ANDROID_NDK_HOME']
5958
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+
6270
build_command = [
6371
'setup.py', 'apk',
6472
'--sdk-dir', android_sdk_home,
6573
'--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+
6882
build_command_str = " ".join(build_command)
6983
logger.info(f"Build command: {build_command_str}")
7084

pythonforandroid/recipes/sdl3_mixer/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88
class LibSDL3Mixer(BootstrapNDKRecipe):
99
version = "72a73339731a12c1002f9caca64f1ab924938102"
10-
# url = "https://github.com/libsdl-org/SDL_ttf/releases/download/release-{version}/SDL3_ttf-{version}.tar.gz"
1110
url = "https://github.com/libsdl-org/SDL_mixer/archive/{version}.tar.gz"
1211
dir_name = "SDL3_mixer"
1312

0 commit comments

Comments
 (0)