Skip to content

Commit a5a4a5f

Browse files
committed
vlc recipe compilation updated, better precompiled aar processing
1 parent 3faf827 commit a5a4a5f

File tree

1 file changed

+17
-14
lines changed

1 file changed

+17
-14
lines changed

pythonforandroid/recipes/vlc/__init__.py

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from pythonforandroid.toolchain import Recipe, shprint, current_directory, warning, info, debug
2-
from os.path import exists, join
2+
from os.path import join, isdir, isfile
33
from os import environ
44
import sh
55
from colorama import Fore, Style
@@ -12,7 +12,7 @@ class VlcRecipe(Recipe):
1212
depends = []
1313

1414
port_git = 'http://git.videolan.org/git/vlc-ports/android.git'
15-
vlc_git = 'http://git.videolan.org/git/vlc.git'
15+
# vlc_git = 'http://git.videolan.org/git/vlc.git'
1616
ENV_LIBVLC_AAR = 'LIBVLC_AAR'
1717
aars = {} # for future use of multiple arch
1818

@@ -21,36 +21,39 @@ def prebuild_arch(self, arch):
2121
build_dir = self.get_build_dir(arch.arch)
2222
port_dir = join(build_dir, 'vlc-port-android')
2323
if self.ENV_LIBVLC_AAR in environ:
24-
self.aars[arch] = aar = environ.get(self.ENV_LIBVLC_AAR)
25-
if not exists(aar):
26-
warning("Error: libvlc-<ver>.aar bundle " \
27-
"not found in {}".format(aar))
24+
aar = environ.get(self.ENV_LIBVLC_AAR)
25+
if isdir(aar):
26+
aar = join(aar, 'libvlc-{}.aar'.format(self.version))
27+
if not isfile(aar):
28+
warning("Error: {} is not valid libvlc-<ver>.aar bundle".format(aar))
2829
info("check {} environment!".format(self.ENV_LIBVLC_AAR))
2930
exit(1)
31+
self.aars[arch] = aar
3032
else:
3133
aar_path = join(port_dir, 'libvlc', 'build', 'outputs', 'aar')
3234
self.aars[arch] = aar = join(aar_path, 'libvlc-{}.aar'.format(self.version))
3335
warning("HINT: set path to precompiled libvlc-<ver>.aar bundle " \
3436
"in {} environment!".format(self.ENV_LIBVLC_AAR))
3537
info("libvlc-<ver>.aar should build " \
3638
"from sources at {}".format(port_dir))
37-
if not exists(join(port_dir, 'compile.sh')):
39+
if not isfile(join(port_dir, 'compile.sh')):
3840
info("clone vlc port for android sources from {}".format(
3941
self.port_git))
4042
shprint(sh.git, 'clone', self.port_git, port_dir,
4143
_tail=20, _critical=True)
42-
vlc_dir = join(port_dir, 'vlc')
43-
if not exists(join(vlc_dir, 'Makefile.am')):
44-
info("clone vlc sources from {}".format(self.vlc_git))
45-
shprint(sh.git, 'clone', self.vlc_git, vlc_dir,
46-
_tail=20, _critical=True)
44+
# now "git clone ..." is a part of compile.sh
45+
# vlc_dir = join(port_dir, 'vlc')
46+
# if not isfile(join(vlc_dir, 'Makefile.am')):
47+
# info("clone vlc sources from {}".format(self.vlc_git))
48+
# shprint(sh.git, 'clone', self.vlc_git, vlc_dir,
49+
# _tail=20, _critical=True)
4750

4851
def build_arch(self, arch):
4952
super(VlcRecipe, self).build_arch(arch)
5053
build_dir = self.get_build_dir(arch.arch)
5154
port_dir = join(build_dir, 'vlc-port-android')
5255
aar = self.aars[arch]
53-
if not exists(aar):
56+
if not isfile(aar):
5457
with current_directory(port_dir):
5558
env = dict(environ)
5659
env.update({
@@ -60,7 +63,7 @@ def build_arch(self, arch):
6063
})
6164
info("compiling vlc from sources")
6265
debug("environment: {}".format(env))
63-
if not exists(join('bin', 'VLC-debug.apk')):
66+
if not isfile(join('bin', 'VLC-debug.apk')):
6467
shprint(sh.Command('./compile.sh'), _env=env,
6568
_tail=50, _critical=True)
6669
shprint(sh.Command('./compile-libvlc.sh'), _env=env,

0 commit comments

Comments
 (0)