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

Adds functions to find png files when pygame is used (optional for Python 2.7.11) #785

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 28 additions & 4 deletions pythonforandroid/recipes/png/__init__.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,36 @@
from pythonforandroid.recipe import NDKRecipe
from pythonforandroid.logger import shprint
from pythonforandroid.toolchain import current_directory
from os.path import join, exists
import sh


class PngRecipe(NDKRecipe):
name = 'png'
version = '1.6.15'
url = 'https://github.com/julienr/libpng-android/archive/{version}.zip'
name = 'png'
version = '1.6.15'
url = 'https://github.com/julienr/libpng-android/archive/{version}.zip'

generated_libraries = ['libpng.a']
generated_libraries = ['libpng.a']

def should_build(self, arch):
if 'pygame' in self.ctx.recipe_build_order:
return False
return super(PngRecipe, self).should_build(arch)

def get_jni_dir(self, arch):
if 'pygame' in self.ctx.recipe_build_order:
return join(self.ctx.bootstrap.build_dir, 'jni')
return join(self.get_build_dir(arch.arch), 'jni')

def get_lib_dir(self, arch):
if 'pygame' in self.ctx.recipe_build_order:
return join(self.ctx.bootstrap.build_dir, 'obj', 'local', arch.arch)
return join(self.get_build_dir(arch.arch), 'libs', arch.arch)

def get_include_dir(self, arch):
if 'pygame' in self.ctx.recipe_build_order:
return join(self.get_jni_dir(arch), 'png')
return self.get_jni_dir(arch)


recipe = PngRecipe()
Expand Down