|
3 | 3 | from pythonforandroid.logger import debug, shprint, info |
4 | 4 | from os.path import exists, join |
5 | 5 | import sh |
| 6 | +import glob |
6 | 7 |
|
7 | 8 | class LXMLRecipe(Recipe): |
8 | 9 | version = '3.6.0' |
@@ -41,14 +42,37 @@ def build_arch(self, arch): |
41 | 42 | "-I/home/zgoldberg/.local/share/python-for-android/build/other_builds/libxslt/armeabi/libxslt", |
42 | 43 | _tail=10000, _critical=True, _env=env) |
43 | 44 |
|
| 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 | + |
44 | 67 | super(LXMLRecipe, self).build_arch(arch) |
45 | 68 |
|
46 | 69 | def get_recipe_env(self, arch): |
47 | 70 | env = super(LXMLRecipe, self).get_recipe_env(arch) |
48 | 71 | bxml = "/home/zgoldberg/.local/share/python-for-android/build/other_builds/libxml2/armeabi/libxml2/" |
49 | 72 | bxsl = "/home/zgoldberg/.local/share/python-for-android/build/other_builds/libxslt/armeabi/libxslt" |
50 | 73 | 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" |
52 | 76 | env['LDSHARED'] = "$LIBLINK" |
53 | 77 | env['PATH'] += ":%s" % bxsl |
54 | 78 | env['CFLAGS'] += ' -Os' |
|
0 commit comments