Skip to content

Commit 66c4ff7

Browse files
committed
[recipe-lib] Make libxml2 a library recipe and ...
also make the imports from the right module
1 parent d197833 commit 66c4ff7

File tree

1 file changed

+5
-12
lines changed

1 file changed

+5
-12
lines changed

pythonforandroid/recipes/libxml2/__init__.py

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from pythonforandroid.recipe import Recipe
2-
from pythonforandroid.toolchain import shprint, shutil, current_directory
3-
from os.path import exists, join
2+
from pythonforandroid.util import current_directory
3+
from pythonforandroid.logger import shprint
4+
from os.path import exists
45
import sh
56

67

@@ -9,14 +10,9 @@ class Libxml2Recipe(Recipe):
910
url = 'http://xmlsoft.org/sources/libxml2-{version}.tar.gz'
1011
depends = []
1112
patches = ['add-glob.c.patch']
13+
built_libraries = {'libxml2.a': '.libs'}
1214

13-
def should_build(self, arch):
14-
super(Libxml2Recipe, self).should_build(arch)
15-
return not exists(
16-
join(self.get_build_dir(arch.arch), '.libs', 'libxml2.a'))
17-
18-
def build_arch(self, arch):
19-
super(Libxml2Recipe, self).build_arch(arch)
15+
def do_build_libs(self, arch):
2016
env = self.get_recipe_env(arch)
2117
with current_directory(self.get_build_dir(arch.arch)):
2218

@@ -46,9 +42,6 @@ def build_arch(self, arch):
4642
# we'll need the glob dependency which is a big headache
4743
shprint(sh.make, "libxml2.la", _env=env)
4844

49-
shutil.copyfile('.libs/libxml2.a',
50-
join(self.ctx.libs_dir, 'libxml2.a'))
51-
5245
def get_recipe_env(self, arch):
5346
env = super(Libxml2Recipe, self).get_recipe_env(arch)
5447
env['CONFIG_SHELL'] = '/bin/bash'

0 commit comments

Comments
 (0)