1
1
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
4
5
import sh
5
6
6
7
@@ -9,14 +10,9 @@ class Libxml2Recipe(Recipe):
9
10
url = 'http://xmlsoft.org/sources/libxml2-{version}.tar.gz'
10
11
depends = []
11
12
patches = ['add-glob.c.patch' ]
13
+ built_libraries = {'libxml2.a' : '.libs' }
12
14
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 ):
20
16
env = self .get_recipe_env (arch )
21
17
with current_directory (self .get_build_dir (arch .arch )):
22
18
@@ -46,9 +42,6 @@ def build_arch(self, arch):
46
42
# we'll need the glob dependency which is a big headache
47
43
shprint (sh .make , "libxml2.la" , _env = env )
48
44
49
- shutil .copyfile ('.libs/libxml2.a' ,
50
- join (self .ctx .libs_dir , 'libxml2.a' ))
51
-
52
45
def get_recipe_env (self , arch ):
53
46
env = super (Libxml2Recipe , self ).get_recipe_env (arch )
54
47
env ['CONFIG_SHELL' ] = '/bin/bash'
0 commit comments