From f5c0577bdb175bfc0990602936bbc9e2052e1f25 Mon Sep 17 00:00:00 2001 From: Akinwale Ariwodola Date: Sat, 30 Mar 2019 10:31:10 +0100 Subject: [PATCH] remove unused build recipes --- recipes/gmpy/__init__.py | 36 ------------------------- recipes/libgmp/__init__.py | 51 ----------------------------------- recipes/miniupnpc/__init__.py | 31 --------------------- 3 files changed, 118 deletions(-) delete mode 100644 recipes/gmpy/__init__.py delete mode 100644 recipes/libgmp/__init__.py delete mode 100644 recipes/miniupnpc/__init__.py diff --git a/recipes/gmpy/__init__.py b/recipes/gmpy/__init__.py deleted file mode 100644 index 8cb7140f..00000000 --- a/recipes/gmpy/__init__.py +++ /dev/null @@ -1,36 +0,0 @@ - -import glob -from pythonforandroid.recipe import CythonRecipe, Recipe -from pythonforandroid.toolchain import ( - current_directory, - info, - shprint, -) -from os.path import join -import sh - - -class GmpyRecipe(CythonRecipe): - version = '1.17' - url = 'https://pypi.python.org/packages/26/37/2184c13cee81e1dbeaebbb13570195247e73ab2138a3db0c9d2c5347e372/gmpy-{version}.zip' - - depends = ['libgmp', 'setuptools'] - - call_hostpython_via_targetpython = False - install_in_hostpython = True - - def get_recipe_env(self, arch): - env = super(GmpyRecipe, self).get_recipe_env(arch) - - # include libgmp build dir for gmp.h - libgmp_build_dir = Recipe.get_recipe('libgmp', self.ctx).get_build_dir(arch.arch) - env['CFLAGS'] += ' -I%s' % (join(libgmp_build_dir, 'include')) - - target_python = Recipe.get_recipe('python3crystax', self.ctx).get_build_dir(arch.arch) - env['PYTHON_ROOT'] = join(target_python, 'python-install') - env['CFLAGS'] += ' -I' + env['PYTHON_ROOT'] + '/include/python3.7' - env['LDFLAGS'] += ' -L' + env['PYTHON_ROOT'] + '/lib' + ' -lpython3.7m' - - return env - -recipe = GmpyRecipe() diff --git a/recipes/libgmp/__init__.py b/recipes/libgmp/__init__.py deleted file mode 100644 index edfffe88..00000000 --- a/recipes/libgmp/__init__.py +++ /dev/null @@ -1,51 +0,0 @@ -from pythonforandroid.recipe import Recipe -from pythonforandroid.toolchain import shprint, current_directory -from os.path import exists, join, realpath -from os import uname -import glob -import sh -import os - - -class LibGMPRecipe(Recipe): - version = '6.1.2' - #url = 'http://www.mirrorservice.org/pub/gnu/gmp/gmp-{version}.tar.bz2' - url = 'https://gmplib.org/download/gmp/gmp-{version}.tar.bz2' - - def should_build(self, arch): - build_dir = self.get_build_dir(arch.arch) - return not exists(join(build_dir, '.libs', 'libgmp.so')) - - def get_recipe_env(self, arch=None): - env = super(LibGMPRecipe, self).get_recipe_env(arch) - env['LIBGMP_LDFLAGS'] = '-avoid-version' - - ndk_dir = self.ctx.ndk_platform - ndk_lib_dir = os.path.join(ndk_dir, 'usr', 'lib') - if self.ctx.ndk == 'crystax': - crystax_lib_dir = os.path.join(self.ctx.ndk_dir, 'sources/crystax/libs', arch.arch) - env['CFLAGS'] = '{} -L{} -L{}'.format(env.get('CFLAGS'), crystax_lib_dir, ndk_lib_dir); - - env['LDFLAGS'] += ' -L{}'.format(ndk_lib_dir) - env['LDFLAGS'] += " --sysroot={}".format(self.ctx.ndk_platform) - env['PYTHONPATH'] = ':'.join([ - self.ctx.get_site_packages_dir(), - env['BUILDLIB_PATH'], - ]) - - return env - - def build_arch(self, arch): - with current_directory(self.get_build_dir(arch.arch)): - env = self.get_recipe_env(arch) - configure = sh.Command('./configure') - shprint(configure, - '--host=arm-linux', - _env=env) - shprint(sh.make, '-j4', _env=env) - shprint(sh.mkdir, 'include') - shprint(sh.cp, '-a', 'gmp.h', 'include/gmp.h') - shprint(sh.cp, '-a', '.libs/libgmp.so', join(self.ctx.get_libs_dir(arch.arch), 'libgmp.so')) - shprint(sh.cp, '-a', '.libs/libgmp.so', join(self.ctx.get_libs_dir(''), 'libgmp.so')) # also copy to libs_collections/ - -recipe = LibGMPRecipe() diff --git a/recipes/miniupnpc/__init__.py b/recipes/miniupnpc/__init__.py deleted file mode 100644 index d83a58b8..00000000 --- a/recipes/miniupnpc/__init__.py +++ /dev/null @@ -1,31 +0,0 @@ - -import glob -from pythonforandroid.recipe import CythonRecipe, Recipe -from pythonforandroid.toolchain import ( - current_directory, - info, - shprint, -) -from os.path import join -import sh - - -class MiniupnpcRecipe(CythonRecipe): - version = '1.9' - url = 'https://pypi.python.org/packages/55/90/e987e28ed29b571f315afea7d317b6bf4a551e37386b344190cffec60e72/miniupnpc-{version}.tar.gz' - depends = ['setuptools'] - - call_hostpython_via_targetpython = False - install_in_hostpython = True - - def get_recipe_env(self, arch): - env = super(MiniupnpcRecipe, self).get_recipe_env(arch) - - target_python = Recipe.get_recipe('python3crystax', self.ctx).get_build_dir(arch.arch) - env['PYTHON_ROOT'] = join(target_python, 'python-install') - env['CFLAGS'] += ' -I' + env['PYTHON_ROOT'] + '/include/python3.7' - env['LDFLAGS'] += ' -L' + env['PYTHON_ROOT'] + '/lib' + ' -lpython3.7m' - - return env - -recipe = MiniupnpcRecipe()