-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Add lxml recipe and other recipes from ZachGoldberg fork #1166
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
93f7384
Work on lxml
ZachGoldberg 14e5fd1
Fix libxslt configure libxml path
ZachGoldberg 29aaaa4
Libxslt finally builds
ZachGoldberg 45231af
WIP Lxml recipe
ZachGoldberg 3b64104
More attempts to fix things, mostly useless
ZachGoldberg a9746a8
Not exactly working yet
ZachGoldberg 08072da
This should work, but doesn't. Go figure.
ZachGoldberg 06f9191
Try using the correct superclass for lxml
ZachGoldberg 1583720
Renable levenshtein build
ZachGoldberg 4b742d6
Still working on this build thing
ZachGoldberg c97da18
Add glob
ZachGoldberg 58636ba
Libxml2 now builds successfully FOR ARM
ZachGoldberg 036c09a
Don't always build libxml2
ZachGoldberg 0f243c9
Now libxslt is built for arm, for real this time
ZachGoldberg e226a8c
Dont forget exslt
ZachGoldberg bc55f7c
OK, I think lxml is now building...
ZachGoldberg 949b530
Copy the .so at the right time
ZachGoldberg 1a78df1
Working lxml?!
ZachGoldberg 2b3aea5
Fix levenshtein
ZachGoldberg d50aa29
Missing add-glob
ZachGoldberg 43a1906
Merge branch 'master' of https://github.com/kivy/python-for-android i…
eacpereira 6c75df2
Merge branch 'kivy-master'
eacpereira ec3eac6
Correct references to local files
eacpereira File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
from pythonforandroid.toolchain import CompiledComponentsPythonRecipe | ||
from os.path import dirname | ||
|
||
class LevenshteinRecipe(CompiledComponentsPythonRecipe): | ||
name="levenshtein" | ||
version = '0.12.0' | ||
url = 'https://pypi.python.org/packages/source/p/python-Levenshtein/python-Levenshtein-{version}.tar.gz' | ||
depends = [('python2', 'python3'), 'setuptools'] | ||
|
||
call_hostpython_via_targetpython = False | ||
|
||
def get_recipe_env(self, arch): | ||
env = super(LevenshteinRecipe, self).get_recipe_env(arch) | ||
libxslt_recipe = Recipe.get_recipe('libxslt', self.ctx) | ||
libxml2_recipe = Recipe.get_recipe('libxml2', self.ctx) | ||
targetpython = "%s/include/python2.7/" % dirname(dirname(self.ctx.hostpython)) | ||
env['CC'] += " -I%s/include -I%s -I%s" % (libxml2_recipe, libxslt_recipe, targetpython) | ||
env['LDSHARED'] = '%s -nostartfiles -shared -fPIC -lpython2.7' % env['CC'] | ||
return env | ||
|
||
recipe = LevenshteinRecipe() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
from pythonforandroid.toolchain import Recipe, shprint, shutil, current_directory | ||
from os.path import exists, join | ||
import sh | ||
|
||
class Libxml2Recipe(Recipe): | ||
version = '2.7.8' | ||
url = 'http://xmlsoft.org/sources/libxml2-{version}.tar.gz' | ||
depends = [] | ||
patches = ['add-glob.c.patch'] | ||
|
||
def should_build(self, arch): | ||
super(Libxml2Recipe, self).should_build(arch) | ||
return not exists(join(self.ctx.get_libs_dir(arch.arch), 'libxml2.a')) | ||
|
||
def build_arch(self, arch): | ||
super(Libxml2Recipe, self).build_arch(arch) | ||
env = self.get_recipe_env(arch) | ||
with current_directory(self.get_build_dir(arch.arch)): | ||
env['CC'] += " -I%s" % self.get_build_dir(arch.arch) | ||
shprint(sh.Command('./configure'), '--host=arm-linux-eabi', | ||
'--without-modules', '--without-legacy', '--without-hfinistory', '--without-debug', '--without-docbook', '--without-python', '--without-threads', '--without-iconv', | ||
_env=env) | ||
|
||
# Ensure we only build libxml2.la as if we do everything | ||
# we'll need the glob dependency which is a big headache | ||
shprint(sh.make, "libxml2.la", _env=env) | ||
shutil.copyfile('.libs/libxml2.a', join(self.ctx.get_libs_dir(arch.arch), 'libxml2.a')) | ||
|
||
|
||
def get_recipe_env(self, arch): | ||
env = super(Libxml2Recipe, self).get_recipe_env(arch) | ||
env['CONFIG_SHELL'] = '/bin/bash' | ||
env['SHELL'] = '/bin/bash' | ||
env['CC'] = '/usr/bin/ccache arm-linux-androideabi-gcc -DANDROID -mandroid -fomit-frame-pointer' | ||
return env | ||
|
||
recipe = Libxml2Recipe() |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My testing application compiles until these lines get referenced, which I believe may be because the class
Recipe
is called instead of the instance. But something seems to have accidentally filled my VM up to the brim so I need to clean it out before I can continue testing, so I haven't been able to test the change into an instance.