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

pygame_sdl2 compile failure # include <iconv.h> #1023

Closed
frankgould opened this issue Mar 21, 2017 · 15 comments
Closed

pygame_sdl2 compile failure # include <iconv.h> #1023

frankgould opened this issue Mar 21, 2017 · 15 comments

Comments

@frankgould
Copy link

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()

pygame_sdl2_compile_err_March2017.txt

@inclement
Copy link
Member

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
Copy link
Author

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
Copy link
Author

Is there someone watching these issues? I haven't heard back in 2 days. What should I do?

@inclement
Copy link
Member

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.

@inclement
Copy link
Member

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
Copy link
Author

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
Copy link
Author

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
Copy link
Member

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
Copy link
Author

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
Copy link
Contributor

dessant commented Mar 25, 2017

@frankgould, have you tried checking out the github docs?

@frankgould
Copy link
Author

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
Copy link
Contributor

dessant commented Mar 25, 2017

@frankgould, yes, I'm suggesting exactly that.

@frankgould
Copy link
Author

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
Copy link
Author

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
Copy link
Member

Closing as inactive.

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

3 participants