1
- from pythonforandroid .toolchain import Recipe , current_directory , shprint
2
- from os .path import exists , join , realpath
1
+ from pythonforandroid .recipe import Recipe
2
+ from pythonforandroid .util import current_directory
3
+ from pythonforandroid .logger import shprint
4
+ from multiprocessing import cpu_count
5
+ from os .path import realpath
3
6
import sh
4
7
5
8
6
9
class LibShineRecipe (Recipe ):
7
10
version = 'c72aba9031bde18a0995e7c01c9b53f2e08a0e46'
8
11
url = 'https://github.com/toots/shine/archive/{version}.zip'
9
12
10
- def should_build (self , arch ):
11
- build_dir = self .get_build_dir (arch .arch )
12
- return not exists (join (build_dir , 'lib' , 'libshine.a' ))
13
+ built_libraries = {'libshine.a' : 'lib' }
13
14
14
- def build_arch (self , arch ):
15
+ def do_build_libs (self , arch ):
15
16
with current_directory (self .get_build_dir (arch .arch )):
16
17
env = self .get_recipe_env (arch )
17
18
shprint (sh .Command ('./bootstrap' ))
@@ -23,7 +24,7 @@ def build_arch(self, arch):
23
24
'--enable-static' ,
24
25
'--prefix={}' .format (realpath ('.' )),
25
26
_env = env )
26
- shprint (sh .make , '-j4' , _env = env )
27
+ shprint (sh .make , '-j' , str ( cpu_count ()) , _env = env )
27
28
shprint (sh .make , 'install' , _env = env )
28
29
29
30
0 commit comments