lbry-android-sdk/p4a/pythonforandroid/recipes/libiconv/__init__.py
Akinwale Ariwodola 8b2694efb7
New build ()
* fix build for openssl 1.1.1b required for sdk
(cherry picked from commit aa49e3b2755b97b6331cdbbb89efc954de8d5977)

* use js code from master

* fix openssl recipe and tweak build
(cherry picked from commit 6e94c27021c7bd7b1e880c2fc314850e36a5a38e)

* remove unused build recipes
(cherry picked from commit f5c0577bdb175bfc0990602936bbc9e2052e1f25)
2019-03-30 21:58:45 +01:00

34 lines
1 KiB
Python

import os
from pythonforandroid.toolchain import shprint, current_directory
from pythonforandroid.recipe import Recipe
from multiprocessing import cpu_count
import sh
class LibIconvRecipe(Recipe):
version = '1.15'
url = 'https://ftp.gnu.org/pub/gnu/libiconv/libiconv-{version}.tar.gz'
patches = ['libiconv-1.15-no-gets.patch']
def should_build(self, arch):
return not os.path.exists(
os.path.join(self.ctx.get_libs_dir(arch.arch), 'libiconv.so'))
def build_arch(self, arch):
super(LibIconvRecipe, self).build_arch(arch)
env = self.get_recipe_env(arch)
with current_directory(self.get_build_dir(arch.arch)):
shprint(
sh.Command('./configure'),
'--host=' + arch.toolchain_prefix,
'--prefix=' + self.ctx.get_python_install_dir(),
_env=env)
shprint(sh.make, '-j' + str(cpu_count()), _env=env)
libs = ['lib/.libs/libiconv.so']
self.install_libs(arch, *libs)
recipe = LibIconvRecipe()