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

Buildozer does not package sdl2 properly when sourcing locally #1843

Open
CaptainCrusher opened this issue Aug 3, 2024 · 2 comments
Open

Comments

@CaptainCrusher
Copy link

When trying to package sdl2 from local files using requirements.source in the buildozer.spec file, buildozer does not package them properly.

sdl2 has a lot of seperate libraries which all need to be in the same folder (named jni). But for each library it tries to add, buildozer deletes the entire folder and creates a new one with the library in it. This deletes all the libraries that were previously in that folder. So when buildozer tries to access them, I get a file not found error.

Here's the important part of the terminal log:

[INFO]: Unpacking sdl2_image for arm64-v8a
[INFO]: P4A_sdl2_image_DIR exists, symlinking instead
[DEBUG]: Remove directory and subdirectory /home/chris/MyPython/prj/Anagrams/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/bootstrap_builds/sdl2/jni
[DEBUG]: Create directory /home/chris/MyPython/prj/Anagrams/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/bootstrap_builds/sdl2/jni
[DEBUG]: -> running cp -a /home/chris/buildozer_dependencies/sdl2_image /home/chris/MyPython/prj/Anagrams/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/bootstrap_builds/sdl2/jni/SDL2_image
[INFO]: Unpacking sdl2_mixer for arm64-v8a
[INFO]: P4A_sdl2_mixer_DIR exists, symlinking instead
[DEBUG]: Remove directory and subdirectory /home/chris/MyPython/prj/Anagrams/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/bootstrap_builds/sdl2/jni
[DEBUG]: Create directory /home/chris/MyPython/prj/Anagrams/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/bootstrap_builds/sdl2/jni
[DEBUG]: -> running cp -a /home/chris/buildozer_dependencies/sdl2_mixer /home/chris/MyPython/prj/Anagrams/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/bootstrap_builds/sdl2/jni/SDL2_mixer
[INFO]: Unpacking sdl2_ttf for arm64-v8a
[INFO]: P4A_sdl2_ttf_DIR exists, symlinking instead
[DEBUG]: Remove directory and subdirectory /home/chris/MyPython/prj/Anagrams/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/bootstrap_builds/sdl2/jni
[DEBUG]: Create directory /home/chris/MyPython/prj/Anagrams/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/bootstrap_builds/sdl2/jni
[DEBUG]: -> running cp -a /home/chris/buildozer_dependencies/sdl2_ttf /home/chris/MyPython/prj/Anagrams/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/bootstrap_builds/sdl2/jni/SDL2_ttf
[INFO]: Unpacking sdl2 for arm64-v8a
[INFO]: P4A_sdl2_DIR exists, symlinking instead
[DEBUG]: Remove directory and subdirectory /home/chris/MyPython/prj/Anagrams/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/bootstrap_builds/sdl2/jni (emphasis mine)
[DEBUG]: Create directory /home/chris/MyPython/prj/Anagrams/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/bootstrap_builds/sdl2/jni
[DEBUG]: -> running cp -a /home/chris/buildozer_dependencies/sdl2 /home/chris/MyPython/prj/Anagrams/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/bootstrap_builds/sdl2/jni/SDL

Later on:
[INFO]: Prebuilding sdl2_image for arm64-v8a
[INFO]: -> directory context /home/chris/MyPython/prj/Anagrams/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/bootstrap_builds/sdl2/jni/SDL2_image/external

FileNotFoundError: [Errno 2] No such file or directory: '/home/chris/MyPython/prj/Anagrams/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/build/bootstrap_builds/sdl2/jni/SDL2_image/external'

When I check the jni folder, it only has SDL in it.

There is no such error when sourcing from the internet.

@CaptainCrusher
Copy link
Author

My terminal command is:

buildozer android debug deploy run

@CaptainCrusher
Copy link
Author

I made some modifications to python-for-android, and its working for me now. I am not going to submit a pr because my patch is sketchy.

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

No branches or pull requests

1 participant