1
1
from pythonforandroid .recipe import Recipe
2
- from pythonforandroid .toolchain import shprint , shutil , current_directory
2
+ from pythonforandroid .util import current_directory
3
+ from pythonforandroid .logger import shprint
3
4
from os .path import exists , join
4
5
import sh
5
6
@@ -9,16 +10,14 @@ class LibxsltRecipe(Recipe):
9
10
url = 'http://xmlsoft.org/sources/libxslt-{version}.tar.gz'
10
11
depends = ['libxml2' ]
11
12
patches = ['fix-dlopen.patch' ]
13
+ built_libraries = {
14
+ 'libxslt.a' : 'libxslt/.libs' ,
15
+ 'libexslt.a' : 'libexslt/.libs'
16
+ }
12
17
13
18
call_hostpython_via_targetpython = False
14
19
15
- def should_build (self , arch ):
16
- return not exists (
17
- join (self .get_build_dir (arch .arch ),
18
- 'libxslt' , '.libs' , 'libxslt.a' ))
19
-
20
- def build_arch (self , arch ):
21
- super (LibxsltRecipe , self ).build_arch (arch )
20
+ def do_build_libs (self , arch ):
22
21
env = self .get_recipe_env (arch )
23
22
build_dir = self .get_build_dir (arch .arch )
24
23
with current_directory (build_dir ):
@@ -45,11 +44,6 @@ def build_arch(self, arch):
45
44
_env = env )
46
45
shprint (sh .make , "V=1" , _env = env )
47
46
48
- shutil .copyfile ('libxslt/.libs/libxslt.a' ,
49
- join (self .ctx .libs_dir , 'libxslt.a' ))
50
- shutil .copyfile ('libexslt/.libs/libexslt.a' ,
51
- join (self .ctx .libs_dir , 'libexslt.a' ))
52
-
53
47
def get_recipe_env (self , arch ):
54
48
env = super (LibxsltRecipe , self ).get_recipe_env (arch )
55
49
env ['CONFIG_SHELL' ] = '/bin/bash'
0 commit comments