forked from mpv-player/mpv-build
-
Notifications
You must be signed in to change notification settings - Fork 1
/
default.conf
251 lines (211 loc) · 11.6 KB
/
default.conf
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
# Relative paths are relative to the root of the mpv-build dir.
# The files ./config/default.conf and ./user.conf are sourced one after the
# other, so user.conf may override anything.
# Preferably, user.conf only contains lines with modified values and not a full
# copy of default.conf with only few modified values.
# Global configuration - must be set to empty if unused.
# The main project. Used for prints, install and few more.
config_main="mpv"
# CLI arguments can modify $config_projects .
# The projects are processed at the order they appear, ignoring dependencies.
# If FOO is not at $config_projects (after processing CLI), then it's ignored
# by the update/clean/build scripts, and ./build will try to use it globally as
# a system lib if FOO wasn't built after the last clean - like any other lib
# which wasn't built locally.
config_projects="libass ffmpeg mpv"
# The local install prefix for the libs (exported as absolute path)
config_local_prefix="./prefix"
# custom values for mpv projects. not exported centrally, so export here.
# no need to export again even if the value changes later.
export config_target_windows= # empty for auto, else yes/no
export config_build_pic= # PIC for libs: yes, no, empty for auto from mpv opts
export config_build_host= # set to some cross-host to enable cross-build setup
# Set to "no" to skip auto-guess ffmpeg/mpv arch/os opts when cross building
config_build_cross_guess=
# internal build-pre hook (runs after the user build-pre hook).
# can set up global values which the project-specific scripts may use
config_build_internal_pre="mpv_internal_pre"
mpv_internal_pre() {
. scripts/mpv-conf-utils.sh
[ "$config_target_windows" ] || mpv_guess_windows
[ "$config_build_pic" ] || mpv_pic_auto
[ -z "$config_build_host" ] || mpv_cross_base
[ -z "$config_build_host" ] || [ "$config_build_cross_guess" = no ] ||
mpv_cross_guess_opts # guess additional cross options beyond host
}
# The default shallowness if not using "-" or "+" update syntax (see below).
# supported values: "yes", "no" (anything not "yes" is considered "no").
# If "yes", it generally ends up using --depth=... with fetch or pull.
config_git_shallow=yes
# Depth when using shallow. 2 allows incremental fetch with shallow even if the
# last commit at the remote was replaced, e.g. with force push.
config_git_shallow_depth=2
# Note on repo shallowness:
# Even if the config ends up shallow, --depth=... will not be used if the repo
# at the dir is not shallow. That is, it will not change a normal repo into
# shallow one. The other way (shallow repo, config not shallow) will be
# respected and --depth=... will _not_ be used, however, this doesn't magically
# make the repo "full", and git will fetch as many commits as it needs - if it
# can fetch incrementally from a local commit then that's all it will fetch,
# and if not then the entire history - but the repo remains in "shallow mode".
# To manually change shallowness of a repo:
# To make a repo shallow: git fetch --depth=1 <remote>
# To unshallow a repo: git fetch --unshallow <remote>
# If you don't care about the repo dir (i.e. it doesn't have local commits you
# want to keep etc), the easiest way to change shallowness is deleting its
# source dir and update it from scratch - which will respect the shallow config.
# per-project config, e.g. for project foo (missing config is empty value):
# config_foo_source source dir
# config_foo_update update value (see below). except none and hook:
# config_foo_git git repo URL
# config_foo_release_prefix see update "release" below
# config_foo_update_post hook for internal use
# config_foo_opts_config configure options before CLI options (if used)
# config_foo_opts_build build options before CLI options (if used)
# CLI arguments can modify $config_foo_update values.
# $config_foo_update controls the update, usually [clone+] fetch + checkout:
# "head" latest remote origin/HEAD
# "release" highest remote release tag with prefix $config_foo_release_prefix
# "rebase" "git pull -r" (needs to already be at a tracked branch)
# "^BAR" latest state of the remote [fuzzy] tag/branch/ref/PR BAR
# "@BAZ" "git fetch && git checkout BAZ"
# "!QUX" doesn't do anything other than executing hook (see below) QUX
# "none" skip update of this project completely.
# ^BAR is smart-ish: BAR may be a full or a tag/branch(head) ref suffix, or PR,
# e.g. my-tag, tags/my-tag, and refs/tags/my-tag likely resolve the same ref,
# though a fuller ref reduces ambiguities. #42 or PR42 or 42 also works.
# Shallow: except "none" and "!QUX", the value can be prefixed with '-' for
# shallow or with '+' to not use shallow - overriding $config_git_shallow.
# E.g. "-head" or "-^v0.25" are shallow, and "+head" or "+^v0.25" are not.
# However, it still will not use shallow if an existing repo isn't shallow.
# Note on repo setup:
# Except "none" and "!QUX", ./update sets and uses $config_main-build-remote so
# that it doesn't modify "origin" while still able to fetch from the configured
# URL. This means that "git fetch --all" will also fetch from our remote, and
# can make some listings slightly more noisy (git log, gitk, etc).
# You can prevent generic fetches from our remote, while still allowing the
# specific fetches which ./update typically does, by e.g.:
# git remote set-branches mpv-build-remote 'non-existing-branch-*'
config_freetype2_source="./source/freetype2"
config_freetype2_git=https://git.savannah.gnu.org/git/freetype/freetype2.git
config_freetype2_update="head"
config_freetype2_release_prefix="VER-2-" # ignoring "YY" in 2-XX-YY
# config_freetype2_update_post=ft2_post
# ft2_post() {( set -x; git -C "$config_freetype2_source" submodule update || :; )}
# after 2.10.1 and before 2.11.0 a patch is needed for windows. see scripts/freertpe2-config
# lua mainline: https://github.com/lua/lua.git # missing 5.1, meh makefile
# cmake build: https://github.com/LuaDist/lua # unmaintained, 5.1 build issues
# lua51 and lua52 are the same repo but separate packages for easier build.
# the branches lua-5.1 and lua-5.2 are last release + build/lua fixes.
config_lua51_source="./source/lua51"
config_lua51_git=https://github.com/avih/lua-cmake.git
config_lua51_update="^lua-5.1"
config_lua51_release_prefix="lua-5.1"
config_lua52_source="./source/lua52"
config_lua52_git=https://github.com/avih/lua-cmake.git
config_lua52_update="^lua-5.2"
config_lua52_release_prefix="lua-5.2"
# upstream doesn't support shallow clone: https://luajit.org/git/luajit-2.0.git
config_luajit_source="./source/luajit"
config_luajit_git=https://github.com/LuaJIT/LuaJIT.git
config_luajit_update="^v2.1" # default to head of the 2.1 branch
config_luajit_release_prefix="v"
config_fribidi_source="./source/fribidi"
config_fribidi_git=https://github.com/fribidi/fribidi.git
config_fribidi_update="release"
config_fribidi_release_prefix="v"
config_harfbuzz_source="./source/harfbuzz"
config_harfbuzz_git=https://github.com/harfbuzz/harfbuzz.git
config_harfbuzz_update=release
config_harfbuzz_release_prefix="2."
config_libass_source="./source/libass"
config_libass_git="https://github.com/libass/libass.git"
config_libass_update="head"
config_libaom_source="./source/libaom"
config_libaom_git=https://aomedia.googlesource.com/aom
config_libaom_update="head"
config_libaom_release_prefix="v"
# the release prefix "mbedtls-2.16." is the LTS support branch, and we can
# detect the latest sub-version. The 2.x and 3.x branches change features
# and are harder to detect due to mixed dev/release versions.
config_mbedtls_source="./source/mbedtls"
config_mbedtls_git=https://github.com/ARMmbed/mbedtls.git
config_mbedtls_update=release # security related - default to release
config_mbedtls_release_prefix=mbedtls-2.16.
config_ffmpeg_source="./source/ffmpeg"
config_ffmpeg_git="https://github.com/FFmpeg/FFmpeg.git"
config_ffmpeg_update="head"
config_ffmpeg_release_prefix="n"
config_mujs_source="./source/mujs"
config_mujs_git="https://github.com/ccxvii/mujs.git"
config_mujs_update="+head" # not shallow - relies on tags for mujs.pc version
config_shaderc_source="./source/shaderc"
config_shaderc_git="https://github.com/google/shaderc"
config_shaderc_update="head"
config_shaderc_update_post="./scripts/shaderc-update-deps-latest"
config_spirvcross_source="./source/spirvcross"
config_spirvcross_git="https://github.com/KhronosGroup/SPIRV-Cross"
config_spirvcross_update="head"
# crossc is deprecated, spirvcross should be used with newer mpv
config_crossc_source="./source/crossc"
config_crossc_git="https://github.com/rossy/crossc"
config_crossc_update="head"
config_crossc_update_post=crossc_finalize_submodules
crossc_finalize_submodules() ( # subshell to stay at pwd
set -x && cd "$config_crossc_source" && git submodule update --init
)
# Just the angle headers, and they can't be copied to <prefix>/include due to
# top-level non-angle-specific h files. To enable, add to the build-pre hook:
# export CFLAGS="-I$(cd $config_angleheaders_source/include && pwd) ${CFLAGS-}"
# The resulting mpv will need the DLLs to use it, e.g. from google Chrome[ium].
config_angleheaders_source="./source/angle-headers"
config_angleheaders_git="https://github.com/google/angle.git"
config_angleheaders_update=head
config_libplacebo_source="./source/libplacebo"
config_libplacebo_git="https://github.com/haasn/libplacebo"
config_libplacebo_update="head"
config_libsixel_source="./source/libsixel"
config_libsixel_git=https://github.com/saitoha/libsixel.git
config_libsixel_update=release
config_libsixel_release_prefix="v"
config_zimg_source="./source/zimg"
config_zimg_git=https://github.com/sekrit-twc/zimg.git
config_zimg_update="release"
config_zimg_release_prefix="release-"
config_mpv_source="./source/mpv"
config_mpv_git="https://github.com/mpv-player/mpv.git"
config_mpv_update="head"
config_mpv_release_prefix="v"
config_mpv_update_post="mpv_bootstrap_waf"
mpv_bootstrap_waf() { scripts/mpv-bootstrap; } # ignoring the arguments
# Optional user hooks (valid values: empty/[path-to-]program/function-name).
# invoked with the stage ("clean-pre", "build-post", etc) as argument.
# To be fully generic, should take into account $config_projects and the source
# paths for the active projects - which are exported.
# Existing dirs are exported as full path, otherwise as configured (typically
# always full paths except maybe before first update) .
config_update_pre=
config_update_post=
config_build_pre=
config_build_post=
config_clean_pre=
config_clean_post=
# Utils: $1: conf suffix to modify, $2: value to space-separate append/prepend
# E.g. conf_append projects "foo bar" will add " foo bar" to config_projects
conf_append() { eval config_$1=\"\${config_$1-} \$2\"; }
conf_prepend() { eval config_$1=\"\$2 \${config_$1-}\"; }
# Normally this isn't required, but on systems with non-default prefix which
# contains a package we build ourselves, there could be conflicts in -I and -L
# order of the compile/link commands. This can happen on OS X with macports or
# homebrew, or even in msys2 normal setup if e.g. ffmpeg is installed globally,
# or on linux if /usr/local has ffmpeg-dev installed for instance.
# Best is ensuring a package we build is not also installed at such prefix.
# Note that e.g. ffmpeg-dev at the global default prefix (e.g. /usr) shouldn't
# be an issue. The only issues are with additional non-default prefixes.
#
# Before using this, make sure to read tools/ccmpp and tools/auto_ccmpp
# config_build_pre=multi_prefix_hack
# Auto OSX or msys2 or else just set/add the prefix to {C|CXX|LD}_FLAGS
# multi_prefix_hack() { eval "$(tools/auto_ccmpp)"; }
# Or e.g. deprioritize /usr/opt
# multi_prefix_hack() { eval "$(tools/auto_ccmpp /usr/opt)"; }