lbry-android-sdk/p4a/pythonforandroid/recipes/png/__init__.py

31 lines
978 B
Python
Raw Normal View History

2022-12-02 21:15:34 +01:00
from pythonforandroid.recipe import Recipe
from pythonforandroid.logger import shprint
from pythonforandroid.util import current_directory
from multiprocessing import cpu_count
import sh
2017-08-13 03:24:00 +02:00
2022-12-02 21:15:34 +01:00
class PngRecipe(Recipe):
name = 'png'
2022-12-02 21:15:34 +01:00
version = '1.6.37'
url = 'https://github.com/glennrp/libpng/archive/v{version}.zip'
built_libraries = {'libpng16.so': '.libs'}
2017-08-13 03:24:00 +02:00
2022-12-02 21:15:34 +01:00
def build_arch(self, arch):
build_dir = self.get_build_dir(arch.arch)
with current_directory(build_dir):
env = self.get_recipe_env(arch)
shprint(
sh.Command('./configure'),
'--host=' + arch.command_prefix,
'--target=' + arch.command_prefix,
'--disable-static',
'--enable-shared',
'--prefix={}/install'.format(self.get_build_dir(arch.arch)),
_env=env,
)
shprint(sh.make, '-j', str(cpu_count()), _env=env)
2017-08-13 03:24:00 +02:00
recipe = PngRecipe()