-
Notifications
You must be signed in to change notification settings - Fork 0
/
init
executable file
·73 lines (58 loc) · 2.2 KB
/
init
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#!/usr/bin/env python3
import os
from os import path
import sys
from optparse import OptionParser
from subprocess import check_call
from script.helpers import run_command, GitWrapper
option_helptext = \
"""# Place each option on its own line. Empty lines and lines starting with '#'
# are ignored. The options do not need quoting, so you can have for example
# --extra-libs=-lfoo -lbar
# (and NOT --extra-libs='-lfoo -lbar').
"""
mplayer_options = \
"""# You can place options for MPlayer configure in this file.
""" + option_helptext
libav_options = \
"""# You can place options for Libav configure in this file.
""" + option_helptext
common_options = \
"""# You can place options common for both MPlayer and Libav configure in
# this file. This mainly makes sense for generic things like --cc.
#
# NOTE: Several people used --prefix here for some reason. Don't do that!
# The internal Libav library created during the build is installed under
# the build tree by default and should not be placed anywhere else!
# If you want to specify a custom location for the final install that
# should be done in mplayer_options.
""" + option_helptext
def create_helpfile(filename, text):
if not path.exists(filename):
f = open(filename, 'w')
f.write(text)
f.close()
def main():
usage = 'usage: %prog [options]'
parser = OptionParser(usage=usage)
parser.add_option('-s', '--shallow', action='store_true',
help='only shallow git clone (uses less bandwidth)')
parser.add_option('--init-optionfiles-only', action='store_true',
help='do nothing but create initial option files')
parser.set_defaults(shallow=False, init_optionfiles_only=False)
opts, args = parser.parse_args()
if args:
parser.print_help()
sys.exit(1)
create_helpfile('mplayer_options', mplayer_options)
create_helpfile('libav_options', libav_options)
create_helpfile('common_options', common_options)
if opts.init_optionfiles_only:
return
git = GitWrapper()
git.shallow = opts.shallow
check_call('git submodule init'.split())
git.submodule_clone('mplayer')
git.submodule_clone('libav')
git.submodule_clone('libass')
main()