8000 vlc recipe improvements by ibobalo · Pull Request #1189 · kivy/python-for-android · GitHub
[go: up one dir, main page]

Skip to content

vlc recipe improvements #1189

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Dec 5, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
10000
Diff view
31 changes: 17 additions & 14 deletions pythonforandroid/recipes/vlc/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from pythonforandroid.toolchain import Recipe, current_directory
from pythonforandroid.logger import info, debug, shprint, warning
from os.path import exists, join
from os.path import join, isdir, isfile
from os import environ
import sh
from colorama import Fore, Style
Expand All @@ -13,7 +13,7 @@ class VlcRecipe(Recipe):
depends = []

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

Expand All @@ -22,36 +22,39 @@ def prebuild_arch(self, arch):
build_dir = self.get_build_dir(arch.arch)
port_dir = join(build_dir, 'vlc-port-android')
if self.ENV_LIBVLC_AAR in environ:
self.aars[arch] = aar = environ.get(self.ENV_LIBVLC_AAR)
if not exists(aar):
warning("Error: libvlc-<ver>.aar bundle " \
"not found in {}".format(aar))
aar = environ.get(self.ENV_LIBVLC_AAR)
if isdir(aar):
aar = join(aar, 'libvlc-{}.aar'.format(self.version))
if not isfile(aar):
warning("Error: {} is not valid libvlc-<ver>.aar bundle".format(aar))
info("check {} environment!".format(self.ENV_LIBVLC_AAR))
exit(1)
self.aars[arch] = aar
else:
aar_path = join(port_dir, 'libvlc', 'build', 'outputs', 'aar')
self.aars[arch] = aar = join(aar_path, 'libvlc-{}.aar'.format(self.version))
warning("HINT: set path to precompiled libvlc-<ver>.aar bundle " \
"in {} environment!".format(self.ENV_LIBVLC_AAR))
info("libvlc-<ver>.aar should build " \
"from sources at {}".format(port_dir))
if not exists(join(port_dir, 'compile.sh')):
if not isfile(join(port_dir, 'compile.sh')):
info("clone vlc port for android sources from {}".format(
self.port_git))
shprint(sh.git, 'clone', self.port_git, port_dir,
_tail=20, _critical=True)
vlc_dir = join(port_dir, 'vlc')
if not exists(join(vlc_dir, 'Makefile.am')):
info("clone vlc sources from {}".format(self.vlc_git))
shprint(sh.git, 'clone', self.vlc_git, vlc_dir,
_tail=20, _critical=True)
# now "git clone ..." is a part of compile.sh
# vlc_dir = join(port_dir, 'vlc')
# if not isfile(join(vlc_dir, 'Makefile.am')):
# info("clone vlc sources from {}".format(self.vlc_git))
# shprint(sh.git, 'clone', self.vlc_git, vlc_dir,
# _tail=20, _critical=True)

def build_arch(self, arch):
super(VlcRecipe, self).build_arch(arch)
build_dir = self.get_build_dir(arch.arch)
port_dir = join(build_dir, 'vlc-port-android')
aar = self.aars[arch]
if not exists(aar):
if not isfile(aar):
with current_directory(port_dir):
env = dict(environ)
env.update({
Expand All @@ -61,7 +64,7 @@ def build_arch(self, arch):
})
info("compiling vlc from sources")
debug("environment: {}".format(env))
if not exists(join('bin', 'VLC-debug.apk')):
if not isfile(join('bin', 'VLC-debug.apk')):
shprint(sh.Command('./compile.sh'), _env=env,
_tail=50, _critical=True)
shprint(sh.Command('./compile-libvlc.sh'), _env=env,
Expand Down
0