forked from kivy/python-for-android
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
lxml,libxslt,libxml2,beautifulsoup4 recipe added
- Loading branch information
Showing
6 changed files
with
97 additions
and
15 deletions.
There are no files selected for viewing
This file contains 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,25 @@ | ||
|
||
from pythonforandroid.toolchain import (PythonRecipe, shprint, | ||
current_directory, info, Recipe) | ||
from pythonforandroid.patching import will_build, check_any | ||
import sh | ||
from os.path import join | ||
|
||
class BSoup4Recipe(PythonRecipe): | ||
version = '4.1.0' | ||
url = 'https://www.crummy.com/software/BeautifulSoup/bs4/download/4.0/beautifulsoup4-{version}.tar.gz' | ||
depends = [('python2', 'python3crystax'), 'lxml'] | ||
site_packages_name = 'beautifulsoup4' | ||
call_hostpython_via_targetpython = True | ||
def get_recipe_env(self, arch): | ||
env = super(BSoup4Recipe, self).get_recipe_env(arch) | ||
|
||
|
||
lxml_recipe = Recipe.get_recipe('lxml', self.ctx) | ||
|
||
env['CC'] = env['CC'] + ' -I{lxml_dir}/include -I{lxml_dir}'.format( | ||
lxml_dir=lxml_recipe.get_build_dir(arch)) | ||
|
||
env['LDFLAGS'] = ('-Llxml_dir/lxml/.libs -Llxml_dir/lxml/.libs ').format(lxml_dir=lxml_recipe.get_build_dir(arch)) | ||
|
||
recipe = BSoup4Recipe() |
This file contains 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
This file contains 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,23 @@ | ||
from pythonforandroid.toolchain import (CythonRecipe, shprint, | ||
current_directory, info, Recipe) | ||
from pythonforandroid.patching import will_build, check_any | ||
import sh | ||
from os.path import exists,join | ||
|
||
class LibxsltRecipe(CythonRecipe): | ||
version = '1.1.29' | ||
url = 'ftp://xmlsoft.org/libxslt/libxslt-{version}.tar.gz' | ||
name = 'libxslt' | ||
depends = [('python2', 'python3crystax'), 'libxml2'] | ||
patches = ['fix-dlopen.patch'] | ||
|
||
def should_build(self, arch): | ||
return not exists(join(self.get_build_container_dir(arch.arch),"libxslt/.libs/libxslt.a")) | ||
|
||
|
||
def get_recipe_env(self, arch): | ||
env = super(LibxsltRecipe, self).get_recipe_env(arch) | ||
sh.make('-j', '5') | ||
|
||
|
||
recipe = LibxsltRecipe() |
This file contains 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,11 @@ | ||
--- libxslt-1.1.27.orig/python/libxsl.py 2012-09-04 16:26:23.000000000 +0200 | ||
+++ libxslt-1.1.27/python/libxsl.py 2013-07-29 15:11:04.182227378 +0200 | ||
@@ -4,7 +4,7 @@ | ||
# loader to work in that mode if feasible | ||
# | ||
import sys | ||
-if not hasattr(sys,'getdlopenflags'): | ||
+if True: | ||
import libxml2mod | ||
import libxsltmod | ||
import libxml2 |
This file contains 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,32 @@ | ||
|
||
|
||
from pythonforandroid.toolchain import (CythonRecipe, shprint, | ||
current_directory, info, Recipe) | ||
from pythonforandroid.patching import will_build, check_any | ||
import sh | ||
from os.path import join | ||
|
||
|
||
class LxmlRecipe(CythonRecipe): | ||
version = '3.7.2' | ||
url = 'https://github.com/lxml/lxml/archive/lxml-{version}.tar.gz' | ||
name = 'lxml' | ||
depends = [('python2', 'python3crystax'), 'libxslt'] | ||
|
||
def get_recipe_env(self, arch): | ||
env = super(LxmlRecipe, self).get_recipe_env(arch) | ||
|
||
libxslt_recipe = Recipe.get_recipe('libxslt', self.ctx) | ||
libxml2_recipe = Recipe.get_recipe('libxml2', self.ctx) | ||
|
||
env['CC'] = env['CC'] + ' -I{libxslt_dir}/include -I{libxslt_dir}'.format( | ||
librslt_dir=libxslt_recipe.get_build_dir(arch)) | ||
|
||
env['LDFLAGS'] = ('-Llibxslt_dir/libxslt/.libs -Llibxslt_dir/libexslt/.libs ' | ||
'-Llibxml2_dir/.libs -Llibxslt_dir/libxslt -Llibxslt_dir/libexslt ' | ||
'-Llibxml2_dir/ ').format(libxslt_dir=libxslt_recipe.get_build_dir(arch), | ||
libxml2_dir=libxml2_recipe.get_build_dir(arch)) | ||
|
||
# env['LDSHARED'] = env['LIBLINK'] # not sure this is necessary in new toolchain | ||
|
||
recipe = LxmlRecipe() |
This file contains 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