Skip to content

Commit 9410245

Browse files
committed
[recipe-lib] Make libshine a library recipe and ...
also: - make the imports from the right module - remove the hardcoded cpu count when compiling
1 parent 45cc37f commit 9410245

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

pythonforandroid/recipes/libshine/__init__.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
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
36
import sh
47

58

69
class LibShineRecipe(Recipe):
710
version = 'c72aba9031bde18a0995e7c01c9b53f2e08a0e46'
811
url = 'https://github.com/toots/shine/archive/{version}.zip'
912

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'}
1314

14-
def build_arch(self, arch):
15+
def do_build_libs(self, arch):
1516
with current_directory(self.get_build_dir(arch.arch)):
1617
env = self.get_recipe_env(arch)
1718
shprint(sh.Command('./bootstrap'))
@@ -23,7 +24,7 @@ def build_arch(self, arch):
2324
'--enable-static',
2425
'--prefix={}'.format(realpath('.')),
2526
_env=env)
26-
shprint(sh.make, '-j4', _env=env)
27+
shprint(sh.make, '-j', str(cpu_count()), _env=env)
2728
shprint(sh.make, 'install', _env=env)
2829

2930

0 commit comments

Comments
 (0)