@@ -14,37 +14,42 @@ class VlcRecipe(Recipe):
14
14
port_git = 'http://git.videolan.org/git/vlc-ports/android.git'
15
15
vlc_git = 'http://git.videolan.org/git/vlc.git'
16
16
ENV_LIBVLC_AAR = 'LIBVLC_AAR'
17
+ aars = {} # for future use of multiple arch
17
18
18
19
def prebuild_arch (self , arch ):
19
20
super (VlcRecipe , self ).prebuild_arch (arch )
20
21
build_dir = self .get_build_dir (arch .arch )
21
22
port_dir = join (build_dir , 'vlc-port-android' )
22
- aar_path = join (port_dir , 'libvlc' , 'build' , 'outputs' , 'aar' )
23
- aar = environ .get (self .ENV_LIBVLC_AAR ,
24
- join (aar_path , 'libvlc-{}.aar' .format (self .version )))
25
- if not exists (aar ):
26
- if environ .has_key ('' ):
27
- warning ("Error: libvlc-<ver>.aar bundle not found in {}" .format (aar ))
23
+ 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 ))
28
28
info ("check {} environment!" .format (self .ENV_LIBVLC_AAR ))
29
- raise Exception ("vlc .aar bundle not found by path specified in {}" .format (self .ENV_LIBVLC_AAR ))
30
- warning ("set path to precompiled libvlc-<ver>.aar bundle in {} environment!" .format (self .ENV_LIBVLC_AAR ))
31
- info ("libvlc-<ver>.aar for android not found!" )
32
- info ("should build from sources at {}" .format (port_dir ))
29
+ exit (1 )
30
+ else :
31
+ aar_path = join (port_dir , 'libvlc' , 'build' , 'outputs' , 'aar' )
32
+ self .aars [arch ] = aar = join (aar_path , 'libvlc-{}.aar' .format (self .version ))
33
+ warning ("HINT: set path to precompiled libvlc-<ver>.aar bundle " \
34
+ "in {} environment!" .format (self .ENV_LIBVLC_AAR ))
35
+ info ("libvlc-<ver>.aar should build " \
36
+ "from sources at {}" .format (port_dir ))
33
37
if not exists (join (port_dir , 'compile.sh' )):
34
- info ("clone vlc port for android sources from {}" .format (self .port_git ))
35
- shprint (sh .git , 'clone' , self .port_git , port_dir )
38
+ info ("clone vlc port for android sources from {}" .format (
39
+ self .port_git ))
40
+ shprint (sh .git , 'clone' , self .port_git , port_dir ,
41
+ _tail = 20 , _critical = True )
36
42
vlc_dir = join (port_dir , 'vlc' )
37
43
if not exists (join (vlc_dir , 'Makefile.am' )):
38
44
info ("clone vlc sources from {}" .format (self .vlc_git ))
39
- shprint (sh .git , 'clone' , self .vlc_git , vlc_dir )
45
+ shprint (sh .git , 'clone' , self .vlc_git , vlc_dir ,
46
+ _tail = 20 , _critical = True )
40
47
41
48
def build_arch (self , arch ):
42
49
super (VlcRecipe , self ).build_arch (arch )
43
50
build_dir = self .get_build_dir (arch .arch )
44
51
port_dir = join (build_dir , 'vlc-port-android' )
45
- aar_path = join (port_dir , 'libvlc' , 'build' , 'outputs' , 'aar' )
46
- aar = environ .get (self .ENV_LIBVLC_AAR ,
47
- join (aar_path , 'libvlc-{}.aar' .format (self .version )))
52
+ aar = self .aars [arch ]
48
53
if not exists (aar ):
49
54
with current_directory (port_dir ):
50
55
env = dict (environ )
@@ -55,9 +60,11 @@ def build_arch(self, arch):
55
60
})
56
61
info ("compiling vlc from sources" )
57
62
debug ("environment: {}" .format (env ))
58
- if not exists (join (port_dir , 'bin' , 'VLC-debug.apk' )):
59
- shprint (sh .Command ('./compile.sh' ), _env = env , _tail = 50 , _critical = True )
60
- shprint (sh .Command ('./compile-libvlc.sh' ), _env = env , _tail = 50 , _critical = True )
63
+ if not exists (join ('bin' , 'VLC-debug.apk' )):
64
+ shprint (sh .Command ('./compile.sh' ), _env = env ,
65
+ _tail = 50 , _critical = True )
66
+ shprint (sh .Command ('./compile-libvlc.sh' ), _env = env ,
67
+ _tail = 50 , _critical = True )
61
68
shprint (sh .cp , '-a' , aar , self .ctx .aars_dir )
62
69
63
70
recipe = VlcRecipe ()
0 commit comments