Skip to content

Commit a9746a8

Browse files
committed
Not exactly working yet
1 parent 3b64104 commit a9746a8

1 file changed

Lines changed: 25 additions & 1 deletion

File tree

pythonforandroid/recipes/lxml/__init__.py

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
from pythonforandroid.logger import debug, shprint, info
44
from os.path import exists, join
55
import sh
6+
import glob
67

78
class LXMLRecipe(Recipe):
89
version = '3.6.0'
@@ -41,14 +42,37 @@ def build_arch(self, arch):
4142
"-I/home/zgoldberg/.local/share/python-for-android/build/other_builds/libxslt/armeabi/libxslt",
4243
_tail=10000, _critical=True, _env=env)
4344

45+
build_lib = glob.glob('./build/lib*')
46+
assert len(build_lib) == 1
47+
48+
shprint(sh.find, ".", '-iname', '*.pyx', '-exec',
49+
env['CYTHON'], '{}', ';')
50+
51+
shprint(hostpython, 'setup.py',
52+
'build_ext', "-v",
53+
_tail=10000, _critical=True, _env=env)
54+
55+
shprint(sh.find, build_lib[0], '-name', '*.o', '-exec',
56+
env['STRIP'], '{}', ';')
57+
58+
shprint(hostpython, 'setup.py',
59+
'install', "-O2",
60+
_tail=10000, _critical=True, _env=env)
61+
62+
#env['PYTHONPATH'] += $BUILD_hostpython/Lib/site-packages
63+
#try $BUILD_hostpython/hostpython setup.py install -O2 --root=$BUILD_PATH/python-install --install-lib=lib/python2.7/site-packages
64+
65+
66+
4467
super(LXMLRecipe, self).build_arch(arch)
4568

4669
def get_recipe_env(self, arch):
4770
env = super(LXMLRecipe, self).get_recipe_env(arch)
4871
bxml = "/home/zgoldberg/.local/share/python-for-android/build/other_builds/libxml2/armeabi/libxml2/"
4972
bxsl = "/home/zgoldberg/.local/share/python-for-android/build/other_builds/libxslt/armeabi/libxslt"
5073
env['CC'] += " -I%s/include -I%s" % (bxml, bxsl)
51-
env['LDFLAGS'] = (" -L%s/libxslt/.libs -L%s/libexslt/.libs -L%s/.libs -L%s/libxslt -L%s/libexslt -L%s/ " % (bxsl, bxsl, bxml, bxsl, bxsl, bxml)) + env['LDFLAGS']
74+
env['LDFLAGS'] = (" -L%s/libxslt/.libs -L%s/.libs -L%s/libxslt -L%s/ " % (bxsl, bxsl, bxml, bxsl)) + env['LDFLAGS']
75+
env['CYTHON'] = "cython"
5276
env['LDSHARED'] = "$LIBLINK"
5377
env['PATH'] += ":%s" % bxsl
5478
env['CFLAGS'] += ' -Os'

0 commit comments

Comments
 (0)