You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
pygame_sdl2 compile failure # include <iconv.h> #1023
I am trying to compile an apk using buildozer and have created a recipe for this, pasted below. The error I get can be seen in the attached file. I don't know what is causing this error. Any help greatly appreciated.
from pythonforandroid.toolchain import CompiledComponentsPythonRecipe, warning
class Pygame_sdl2Recipe(CompiledComponentsPythonRecipe):
version = '2.1.0'
url = 'https://testpypi.python.org/packages/2f/f1/8dd343ae2d97c432cf1c81ca03d2d0472396f9d8e76c677aeae9ce2ec61d/pygame_sdl2-2.1.0.tar.gz'
site_packages_name= 'pygame_sdl2'
depends = ['python2']
def prebuild_arch(self, arch):
super(Pygame_sdl2Recipe, self).prebuild_arch(arch)
# AND: Fix this warning!
warning('Pygame_sdl2 is built assuming the archiver name is '
'arm-linux-androideabi-ar, which may not always be true!')
recipe = Pygame_sdl2Recipe()
Thanks inclement for your response. I have read the page you suggested several times and it does not make sense to me because of all the options that I don't know if I need or not. I also do not know "modern python-for-android Python recipe equivalents" are and what I need to convert. I did follow your chat and updated the renpy file you suggested but I don't know what to do with it (see attached). It is currently in the following folder: /home/frankgould/Desktop/Master-Pics/Slideshow/.buildozer/android/platform/python-for-android-master/pythonforandroid/recipes/pygame_sdl2. I'm still getting the same build error with the file there. I also tried to bash the script but nothing happened. Sorry, I'm not understanding what to do.
I also do not know "modern python-for-android Python recipe equivalents" are and what I need to convert.
You have a shell script that declares some variables, and performs some commands. You need to write a Python script that declares the same variables, and performs the same commands, using the Recipe structure of python-for-android. For instance, here is the old shell script used to compile pygame, while here is the new Python code for the same thing. I'll note that pygame is a particularly complex example, most recipes are simpler.
It is currently in the following folder: /home/frankgould/Desktop/Master-Pics/Slideshow/.buildozer/android/platform/python-for-android-master/pythonforandroid/recipes/pygame_sdl2
This is probably an appropriate location. You should see that python-for-android has found your recipe in the build logs, even if it doesn't work.
Is there someone watching these issues? I haven't heard back in 2 days.
I am probably the most active dev on python-for-android, and I work through issues mostly at the weekend or some evenings. You can also catch me on irc at these times.
What should I do?
I suggest starting with something simpler, try to make a recipe for a pure python module such as appdirs (this doesn't actually need a recipe but you can make one). pygame_sdl2 should be doable but will be at least a bit more complex than most recipes.
I once tried to make a pygame_sdl2 recipe, but never finished. I don't remember how far I got or why it was failing, but there's a fairly complete recipe at https://github.com/kivy/python-for-android/blob/pygame_sdl2/pythonforandroid/recipes/pygame_sdl2/__init__.py (note that this branch also contains other new files). The relative complexity of this recipe and need for other new things is why I suggest starting with something simpler, although as far as I remember my code should be a good start for pygame_sdl2 support.
Thanks Inclement. I avoided bothering you on irc because it was quiet and I didn't want to interrupt you. I have time to wait but since I hadn't seen any activity, I thought I should ask. I will pound on this again today and see if I can make progress.
I am still getting a compile error with the pygame_sdl2 init.py you had started to work. I've attached the error message and init.py file for your review. I do not know what to do to fix this error or what's causing it. Any assistance greatly appreciated. Is it appropriate to offer to pay for this to be fixed or not? Thanks. error-25Marchat1.22.txt init.py.txt
Okay, I took a shot at it. Let me know what else I need to do. Sorry for my reluctance. I guess you can find it or do I need to include a link? I appreciate your help.
Update: I was finally able to get opencv to work and do not need pygame_sdl2. However, I am willing to work with someone to get this to work. Please let me know and I will offer my time to solve this problem. Until then, I'm moving forward.
Activity
inclement commentedon Mar 22, 2017
You'll want to copy the extra recipe contents from https://github.com/renpy/python-for-android/blob/master/recipes/pygame_sdl2/recipe.sh, converting them to the modern python-for-android Python recipe equivalents. This page has a lot of information about this, and other recipes are also a good reference.
Could you try to adapt your base recipe to add these things? We can then go from there.
frankgould commentedon Mar 23, 2017
Thanks inclement for your response. I have read the page you suggested several times and it does not make sense to me because of all the options that I don't know if I need or not. I also do not know "modern python-for-android Python recipe equivalents" are and what I need to convert. I did follow your chat and updated the renpy file you suggested but I don't know what to do with it (see attached). It is currently in the following folder: /home/frankgould/Desktop/Master-Pics/Slideshow/.buildozer/android/platform/python-for-android-master/pythonforandroid/recipes/pygame_sdl2. I'm still getting the same build error with the file there. I also tried to bash the script but nothing happened. Sorry, I'm not understanding what to do.
recipe.sh.txt
frankgould commentedon Mar 25, 2017
Is there someone watching these issues? I haven't heard back in 2 days. What should I do?
inclement commentedon Mar 25, 2017
You have a shell script that declares some variables, and performs some commands. You need to write a Python script that declares the same variables, and performs the same commands, using the
Recipestructure of python-for-android. For instance, here is the old shell script used to compile pygame, while here is the new Python code for the same thing. I'll note that pygame is a particularly complex example, most recipes are simpler.This is probably an appropriate location. You should see that python-for-android has found your recipe in the build logs, even if it doesn't work.
I am probably the most active dev on python-for-android, and I work through issues mostly at the weekend or some evenings. You can also catch me on irc at these times.
I suggest starting with something simpler, try to make a recipe for a pure python module such as
appdirs(this doesn't actually need a recipe but you can make one).pygame_sdl2should be doable but will be at least a bit more complex than most recipes.inclement commentedon Mar 25, 2017
I once tried to make a pygame_sdl2 recipe, but never finished. I don't remember how far I got or why it was failing, but there's a fairly complete recipe at https://github.com/kivy/python-for-android/blob/pygame_sdl2/pythonforandroid/recipes/pygame_sdl2/__init__.py (note that this branch also contains other new files). The relative complexity of this recipe and need for other new things is why I suggest starting with something simpler, although as far as I remember my code should be a good start for pygame_sdl2 support.
frankgould commentedon Mar 25, 2017
Thanks Inclement. I avoided bothering you on irc because it was quiet and I didn't want to interrupt you. I have time to wait but since I hadn't seen any activity, I thought I should ask. I will pound on this again today and see if I can make progress.
frankgould commentedon Mar 25, 2017
I am still getting a compile error with the pygame_sdl2 init.py you had started to work. I've attached the error message and init.py file for your review. I do not know what to do to fix this error or what's causing it. Any assistance greatly appreciated. Is it appropriate to offer to pay for this to be fixed or not? Thanks.
error-25Marchat1.22.txt
init.py.txt
inclement commentedon Mar 25, 2017
Could you create a new pull request with this recipe and all the other stuff? This will make it easier to check and test.
frankgould commentedon Mar 25, 2017
I don't know how to do what you're asking. I don't understand pull, forks, branches, etc. Can you show me what to do?
dessant commentedon Mar 25, 2017
@frankgould, have you tried checking out the github docs?
frankgould commentedon Mar 25, 2017
No dessant. Are you suggesting I start there to learn how to pull requests? I'm also not sure what "all the other stuff" means.
dessant commentedon Mar 25, 2017
@frankgould, yes, I'm suggesting exactly that.
frankgould commentedon Mar 25, 2017
Okay, I took a shot at it. Let me know what else I need to do. Sorry for my reluctance. I guess you can find it or do I need to include a link? I appreciate your help.
frankgould commentedon Apr 3, 2017
Update: I was finally able to get opencv to work and do not need pygame_sdl2. However, I am willing to work with someone to get this to work. Please let me know and I will offer my time to solve this problem. Until then, I'm moving forward.
inclement commentedon Jan 30, 2019
Closing as inactive.