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

43 lines
1.4 KiB
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 os.path import join
2017-08-13 03:24:00 +02:00
import sh
class LibZMQRecipe(Recipe):
2022-12-02 21:15:34 +01:00
version = '4.3.2'
url = 'https://github.com/zeromq/libzmq/releases/download/v{version}/zeromq-{version}.zip'
depends = []
2022-12-02 21:15:34 +01:00
built_libraries = {'libzmq.so': 'src/.libs'}
need_stl_shared = True
2017-08-13 03:24:00 +02:00
def build_arch(self, arch):
env = self.get_recipe_env(arch)
#
# libsodium_recipe = Recipe.get_recipe('libsodium', self.ctx)
# libsodium_dir = libsodium_recipe.get_build_dir(arch.arch)
# env['sodium_CFLAGS'] = '-I{}'.format(join(
# libsodium_dir, 'src'))
# env['sodium_LDLAGS'] = '-L{}'.format(join(
# libsodium_dir, 'src', 'libsodium', '.libs'))
curdir = self.get_build_dir(arch.arch)
prefix = join(curdir, "install")
2022-12-02 21:15:34 +01:00
2017-08-13 03:24:00 +02:00
with current_directory(curdir):
bash = sh.Command('sh')
shprint(
bash, './configure',
2022-12-02 21:15:34 +01:00
'--host={}'.format(arch.command_prefix),
2017-08-13 03:24:00 +02:00
'--without-documentation',
'--prefix={}'.format(prefix),
'--with-libsodium=no',
2022-12-02 21:15:34 +01:00
'--disable-libunwind',
2017-08-13 03:24:00 +02:00
_env=env)
shprint(sh.make, _env=env)
shprint(sh.make, 'install', _env=env)
recipe = LibZMQRecipe()