8000 More attempts to fix things, mostly useless · gruns/python-for-android@3b64104 · GitHub
[go: up one dir, main page]

Skip to content

Commit 3b64104

Browse files
committed
More attempts to fix things, mostly useless
1 parent 45231af commit 3b64104

File tree

2 files changed

+34
-11
lines changed

2 files changed

+34
-11
lines changed

pythonforandroid/recipes/libxml2/__init__.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,10 @@ def build_arch(self, arch):
1717
with current_directory(self.get_build_dir(arch.arch)):
1818
# If the build is done with /bin/sh things blow up,
1919
# try really hard to use bash
20-
bash = sh.Command('/bin/bash')
2120
sed = sh.Command('sed')
22-
make = sh.Command('make')
23-
shprint(bash, 'configure', '--build=i686-pc-linux-gnu', '--host=arm-linux-eabi',
24-
'--without-modules', '--without-legacy', '--without-history', '--without-debug', '--without-docbook', '--without-python', '--without-threads')
25-
shprint(make, _env=env)
21+
shprint(sh.Command('./configure'), '--build=i686-pc-linux-gnu', '--host=arm-linux-eabi',
22+
'--without-modules', '--without-legacy', '--without-history', '--without-debug', '--without-docbook', '--without-python', '--without-threads', '--without-iconv')
23+
shprint(sh.make, _env=env)
2624
shutil.copyfile('.libs/libxml2.a', join(self.ctx.get_libs_dir(arch.arch), 'libxml2.a'))
2725

2826

Lines changed: 31 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
from pythonforandroid.toolchain import Recipe, shprint, shutil, current_directory
2+
from pythonforandroid.util import current_directory, ensure_dir
3+
from pythonforandroid.logger import debug, shprint, info
24
from os.path import exists, join
35
import sh
46

57
class LXMLRecipe(Recipe):
68
version = '3.6.0'
79
url = 'https://pypi.python.org/packages/source/l/lxml/lxml-{version}.tar.gz'
810
depends = ['python2', 'libxml2', 'libxslt']
11+
name = 'lxml'
912

1013
def should_build(self, arch):
1114
super(LXMLRecipe, self).should_build(arch)
@@ -14,17 +17,29 @@ def should_build(self, arch):
1417

1518
def build_arch(self, arch):
1619
env = self.get_recipe_env(arch)
20+
env['CFLAGS'] = env['CFLAGS'] + ' -I{jni_path}/png -I{jni_path}/jpeg'.format(
21+
jni_path=join(self.ctx.bootstrap.build_dir, 'jni'))
22+
env['CFLAGS'] = env['CFLAGS'] + ' -I{jni_path}/sdl/include -I{jni_path}/sdl_mixer'.format(
23+
jni_path=join(self.ctx.bootstrap.build_dir, 'jni'))
24+
env['CFLAGS'] = env['CFLAGS'] + ' -I{jni_path}/sdl_ttf -I{jni_path}/sdl_image'.format(
25+
jni_path=join(self.ctx.bootstrap.build_dir, 'jni'))
26+
debug('pygame cflags', env['CFLAGS'])
27+
28+
29+
env['LDFLAGS'] = env['LDFLAGS'] + ' -L{libs_path} -L{src_path}/obj/local/{arch} -lm -lz'.format(
30+
libs_path=self.ctx.libs_dir, src_path=self.ctx.bootstrap.build_dir, arch=env['ARCH'])
31+
32+
env['LDSHARED'] = join(self.ctx.root_dir, 'tools', 'liblink')
33+
1734
with current_directory(self.get_build_dir(arch.arch)):
35+
info('hostpython is ' + self.ctx.hostpython)
1836
hostpython = sh.Command(self.ctx.hostpython)
19-
shprint(hostpython,
20-
'setup.py',
37+
shprint(hostpython, 'setup.py',
2138
'build_ext',
22-
"-p%s" % arch.arch,
2339
"-I/home/zgoldberg/.local/share/python-for-android/dists/peggo-python/python-install/include/python2.7/pyconfig.h",
2440
"-I/home/zgoldberg/.local/share/python-for-android/build/other_builds/libxml2/armeabi/libxml2/include",
25-
"-I/home/zgoldberg/.local/share/python-for-android/build/other_builds/libxslt/armeabi/libxslt"
26-
27-
, _env=env)
41+
"-I/home/zgoldberg/.local/share/python-for-android/build/other_builds/libxslt/armeabi/libxslt",
42+
_tail=10000, _critical=True, _env=env)
2843

2944
super(LXMLRecipe, self).build_arch(arch)
3045

@@ -37,6 +52,16 @@ def get_recipe_env(self, arch):
3752
env['LDSHARED'] = "$LIBLINK"
3853
env['PATH'] += ":%s" % bxsl
3954
env['CFLAGS'] += ' -Os'
55+
env['LDFLAGS'] = env['LDFLAGS'] + ' -L{}'.format(
56+
self.ctx.get_libs_dir(arch.arch))
57+
env['LDSHARED'] = join(self.ctx.root_dir, 'tools', 'liblink')
58+
env['LIBLINK'] = 'NOTNONE'
59+
env['NDKPLATFORM'] = self.ctx.ndk_platform
60+
61+
# Every recipe uses its own liblink path, object files are collected and biglinked later
62+
liblink_path = join(self.get_build_container_dir(arch.arch), 'objects_{}'.format(self.name))
63+
env['LIBLINK_PATH'] = liblink_path
64+
ensure_dir(liblink_path)
4065
return env
4166

4267
recipe = LXMLRecipe()

0 commit comments

Comments
 (0)
0