diff --git a/ci/constants.py b/ci/constants.py index 3e0ad70af5..302ff46be1 100644 --- a/ci/constants.py +++ b/ci/constants.py @@ -25,8 +25,6 @@ class TargetPython(Enum): 'hostpython3crystax', # https://github.com/kivy/python-for-android/issues/1354 'kiwisolver', - # https://github.com/kivy/python-for-android/issues/1399 - 'libglob', 'libmysqlclient', 'libsecp256k1', 'libtribler', @@ -69,8 +67,6 @@ class TargetPython(Enum): # enum34 is not compatible with Python 3.6 standard library # https://stackoverflow.com/a/45716067/185510 'enum34', - # https://github.com/kivy/python-for-android/issues/1399 - 'libglob', # build_dir = glob.glob('build/lib.*')[0] # IndexError: list index out of range 'secp256k1', diff --git a/pythonforandroid/recipes/libglob/__init__.py b/pythonforandroid/recipes/libglob/__init__.py index 37fa94859d..e0fccfecfe 100644 --- a/pythonforandroid/recipes/libglob/__init__.py +++ b/pythonforandroid/recipes/libglob/__init__.py @@ -45,32 +45,22 @@ def build_arch(self, arch): if not exists(path): info("creating {}".format(path)) shprint(sh.mkdir, '-p', path) - cli = env['CC'].split() - cc = sh.Command(cli[0]) + cli = env['CC'].split()[0] + # makes sure first CC command is the compiler rather than ccache, refs: + # https://github.com/kivy/python-for-android/issues/1399 + if 'ccache' in cli: + cli = env['CC'].split()[1] + cc = sh.Command(cli) with current_directory(self.get_build_dir(arch.arch)): cflags = env['CFLAGS'].split() - cflags.extend(['-I.', '-c', '-l.', 'glob.c', '-I.']) # , '-o', 'glob.o']) + cflags.extend(['-I.', '-c', '-l.', 'glob.c', '-I.']) shprint(cc, *cflags, _env=env) - cflags = env['CFLAGS'].split() - srindex = cflags.index('--sysroot') - if srindex: - cflags[srindex+1] = self.ctx.ndk_platform cflags.extend(['-shared', '-I.', 'glob.o', '-o', 'libglob.so']) + cflags.extend(env['LDFLAGS'].split()) shprint(cc, *cflags, _env=env) - shprint(sh.cp, 'libglob.so', join(self.ctx.libs_dir, arch.arch)) - shprint(sh.cp, "libglob.so", join(self.ctx.get_python_install_dir(), 'lib')) - # drop header in to the Python include directory - shprint(sh.cp, "glob.h", join(self.ctx.get_python_install_dir(), - 'include/python{}'.format( - self.ctx.python_recipe.version[0:3] - ) - ) - ) - include_path = join(self.ctx.python_recipe.get_build_dir(arch.arch), 'Include') - shprint(sh.cp, "glob.h", include_path) recipe = LibGlobRecipe()