Skip to content

Commit 45cc37f

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

File tree

1 file changed

+7
-13
lines changed

1 file changed

+7
-13
lines changed

pythonforandroid/recipes/libxslt/__init__.py

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
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
34
from os.path import exists, join
45
import sh
56

@@ -9,16 +10,14 @@ class LibxsltRecipe(Recipe):
910
url = 'http://xmlsoft.org/sources/libxslt-{version}.tar.gz'
1011
depends = ['libxml2']
1112
patches = ['fix-dlopen.patch']
13+
built_libraries = {
14+
'libxslt.a': 'libxslt/.libs',
15+
'libexslt.a': 'libexslt/.libs'
16+
}
1217

1318
call_hostpython_via_targetpython = False
1419

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):
2221
env = self.get_recipe_env(arch)
2322
build_dir = self.get_build_dir(arch.arch)
2423
with current_directory(build_dir):
@@ -45,11 +44,6 @@ def build_arch(self, arch):
4544
_env=env)
4645
shprint(sh.make, "V=1", _env=env)
4746

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-
5347
def get_recipe_env(self, arch):
5448
env = super(LibxsltRecipe, self).get_recipe_env(arch)
5549
env['CONFIG_SHELL'] = '/bin/bash'

0 commit comments

Comments
 (0)