Skip to content

Commit eb939b7

Browse files
authored
Merge pull request kivy#1765 from AndreMiras/feature/ticket1399_fix_broken_libglob_compilation
Fixes libglob recipe, closes kivy#1399
2 parents bc41b50 + 9160a42 commit eb939b7

File tree

2 files changed

+8
-22
lines changed

2 files changed

+8
-22
lines changed

ci/constants.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@ class TargetPython(Enum):
2525
'hostpython3crystax',
2626
# https://github.com/kivy/python-for-android/issues/1354
2727
'kiwisolver',
28-
# https://github.com/kivy/python-for-android/issues/1399
29-
'libglob',
3028
'libmysqlclient',
3129
'libsecp256k1',
3230
'libtribler',
@@ -69,8 +67,6 @@ class TargetPython(Enum):
6967
# enum34 is not compatible with Python 3.6 standard library
7068
# https://stackoverflow.com/a/45716067/185510
7169
'enum34',
72-
# https://github.com/kivy/python-for-android/issues/1399
73-
'libglob',
7470
# build_dir = glob.glob('build/lib.*')[0]
7571
# IndexError: list index out of range
7672
'secp256k1',

pythonforandroid/recipes/libglob/__init__.py

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -45,32 +45,22 @@ def build_arch(self, arch):
4545
if not exists(path):
4646
info("creating {}".format(path))
4747
shprint(sh.mkdir, '-p', path)
48-
cli = env['CC'].split()
49-
cc = sh.Command(cli[0])
48+
cli = env['CC'].split()[0]
49+
# makes sure first CC command is the compiler rather than ccache, refs:
50+
# https://github.com/kivy/python-for-android/issues/1399
51+
if 'ccache' in cli:
52+
cli = env['CC'].split()[1]
53+
cc = sh.Command(cli)
5054

5155
with current_directory(self.get_build_dir(arch.arch)):
5256
cflags = env['CFLAGS'].split()
53-
cflags.extend(['-I.', '-c', '-l.', 'glob.c', '-I.']) # , '-o', 'glob.o'])
57+
cflags.extend(['-I.', '-c', '-l.', 'glob.c', '-I.'])
5458
shprint(cc, *cflags, _env=env)
55-
5659
cflags = env['CFLAGS'].split()
57-
srindex = cflags.index('--sysroot')
58-
if srindex:
59-
cflags[srindex+1] = self.ctx.ndk_platform
6060
cflags.extend(['-shared', '-I.', 'glob.o', '-o', 'libglob.so'])
61+
cflags.extend(env['LDFLAGS'].split())
6162
shprint(cc, *cflags, _env=env)
62-
6363
shprint(sh.cp, 'libglob.so', join(self.ctx.libs_dir, arch.arch))
64-
shprint(sh.cp, "libglob.so", join(self.ctx.get_python_install_dir(), 'lib'))
65-
# drop header in to the Python include directory
66-
shprint(sh.cp, "glob.h", join(self.ctx.get_python_install_dir(),
67-
'include/python{}'.format(
68-
self.ctx.python_recipe.version[0:3]
69-
)
70-
)
71-
)
72-
include_path = join(self.ctx.python_recipe.get_build_dir(arch.arch), 'Include')
73-
shprint(sh.cp, "glob.h", include_path)
7464

7565

7666
recipe = LibGlobRecipe()

0 commit comments

Comments
 (0)