Skip to content

Commit ccc960d

Browse files
committed
[recipe-lib] Make libx264 a library recipe and ...
also:   - make the imports from the right module   - remove the hardcoded cpu count when compiling
1 parent 42f69fb commit ccc960d

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

pythonforandroid/recipes/libx264/__init__.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
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 LibX264Recipe(Recipe):
710
version = 'x264-snapshot-20171218-2245-stable' # using mirror url since can't use ftp
811
url = 'http://mirror.yandex.ru/mirrors/ftp.videolan.org/x264/snapshots/{version}.tar.bz2'
9-
10-
def should_build(self, arch):
11-
build_dir = self.get_build_dir(arch.arch)
12-
return not exists(join(build_dir, 'lib', 'libx264.a'))
12+
built_libraries = {'libx264.a': 'lib'}
1313

1414
def build_arch(self, arch):
1515
with current_directory(self.get_build_dir(arch.arch)):
@@ -29,7 +29,7 @@ def build_arch(self, arch):
2929
'--enable-static',
3030
'--prefix={}'.format(realpath('.')),
3131
_env=env)
32-
shprint(sh.make, '-j4', _env=env)
32+
shprint(sh.make, '-j', str(cpu_count()), _env=env)
3333
shprint(sh.make, 'install', _env=env)
3434

3535

0 commit comments

Comments
 (0)