├── .gitignore ├── README.rst ├── build ├── clean ├── debian ├── changelog.TEMPLATE ├── compat ├── control ├── copyright ├── rules └── source │ ├── format │ └── options ├── install ├── rebuild ├── scripts ├── debian-update-versions ├── ffmpeg-build ├── ffmpeg-clean ├── ffmpeg-config ├── fribidi-build ├── fribidi-clean ├── fribidi-config ├── libass-build ├── libass-clean ├── libass-config ├── libplacebo-build ├── libplacebo-clean ├── libplacebo-config ├── mpv-build ├── mpv-clean ├── mpv-config ├── mpv-install ├── mpv-uninstall └── switch-branch ├── uninstall ├── update ├── use-ffmpeg-custom ├── use-ffmpeg-master ├── use-ffmpeg-release ├── use-libass-custom ├── use-libass-master ├── use-libplacebo-custom ├── use-libplacebo-master ├── use-libplacebo-release ├── use-mpv-custom ├── use-mpv-master └── use-mpv-release /.gitignore: -------------------------------------------------------------------------------- 1 | /ffmpeg 2 | /fribidi 3 | /libass 4 | /libplacebo 5 | /mpv 6 | /build_libs 7 | /ffmpeg_build 8 | *.deb 9 | /debian/changelog 10 | /debian/files 11 | /debian/mpv.debhelper.log 12 | /debian/mpv.postinst.debhelper 13 | /debian/mpv.postrm.debhelper 14 | /debian/mpv.substvars 15 | /config/ 16 | /*_options 17 | -------------------------------------------------------------------------------- /README.rst: -------------------------------------------------------------------------------- 1 | Overview 2 | ======== 3 | 4 | This is a collection of scripts to make downloading and building mpv, ffmpeg 5 | and libass easier. ffmpeg and libass get special treatment, because they are 6 | essential, and distribution packages are often too old or too broken. 7 | 8 | Generic Instructions 9 | ==================== 10 | 11 | Make sure git is installed. Also check that the dependencies listed in 12 | the next section are installed. 13 | 14 | Checkout the build repo:: 15 | 16 | git clone https://github.com/mpv-player/mpv-build.git 17 | 18 | cd mpv-build 19 | 20 | To get the ffmpeg, libass and mpv sources and build them, run the command:: 21 | 22 | ./rebuild -j4 23 | 24 | The ``-j4`` asks it to use 4 parallel processes. 25 | 26 | Note that this command implicitly does an update followed by a full cleanup 27 | (even if nothing changes), which is supposed to reduce possible problems with 28 | incremental builds. You can do incremental builds by explicitly calling 29 | ``./build``. This can be faster on minor updates, but breaks sometimes, e.g. 30 | the FFmpeg build system can sometimes be a bit glitchy. 31 | 32 | Install mpv with:: 33 | 34 | sudo ./install 35 | 36 | mpv doesn't need to be installed. The binary ./mpv/build/mpv can be used as-is. 37 | You can copy it to /usr/local/bin manually. Note that libass and ffmpeg will be 38 | statically linked with mpv when using the provided scripts, and no ffmpeg or 39 | libass libraries are/need to be installed. There are no required config or 40 | data files either. 41 | 42 | **Note**: If you are on debian, you may need to install meson from backports 43 | in order to get a non-ancient version. Alternatively, you can install it from 44 | PyPi. 45 | 46 | Dependencies 47 | ============ 48 | 49 | Essential dependencies (incomplete list): 50 | 51 | - gcc or clang, yasm, git, meson, ninja 52 | - autoconf/autotools (for libass) 53 | - X development headers (xlib, X extensions, vdpau, GL, Xv, ...) 54 | - Audio output development headers (libasound, pulseaudio) 55 | - fribidi, freetype, fontconfig development headers (for libass) 56 | - libjpeg 57 | - OpenSSL or GnuTLS development headers if you want to open https links 58 | (this is also needed to make youtube-dl interaction work) 59 | - youtube-dl (at runtime) if you want to play Youtube videos directly 60 | (a builtin mpv script will call it) 61 | - libx264/libmp3lame/libfdk-aac if you want to use encoding (you have to 62 | add these options explicitly to the ffmpeg options, as ffmpeg won't 63 | autodetect these libraries; see next section) 64 | 65 | Note: most dependencies are optional and autodetected. If they're missing, 66 | these features will be disabled silently. This includes some dependencies 67 | which could be considered essential. 68 | 69 | Enabling optional ffmpeg dependencies 70 | ===================================== 71 | 72 | ffmpeg doesn't autodetect many dependencies. Instead, it requires you to 73 | enable them explicitly at configuration time. (And it will simply fail 74 | if the dependencies are not available.) 75 | 76 | You can put additional ffmpeg configure flags into ffmpeg_options. For 77 | example, to enable some dependencies needed for encoding:: 78 | 79 | printf "%s\n" --enable-libx264 >> ffmpeg_options 80 | 81 | printf "%s\n" --enable-libmp3lame >> ffmpeg_options 82 | 83 | printf "%s\n" --enable-libfdk-aac >> ffmpeg_options 84 | 85 | printf "%s\n" --enable-nonfree >> ffmpeg_options 86 | 87 | Do this in the mpv-build top-level directory (the same that contains 88 | the build scripts and this readme file). It must be done prior running 89 | ./build or ./rebuild. 90 | 91 | NAME_options files (where NAME is ffmpeg/mpv/libass/fribidi) 92 | ============================================================ 93 | 94 | These files can hold custom configure options which are passed to the 95 | respective configure scripts. 96 | 97 | Empty lines are ignored, and every non-empty line becomes a single verbatim 98 | argument (including leading and/or trailing spaces) when invoking the 99 | respective configure script. 100 | 101 | This means that shell quotes should *not* be placed at these files, and the 102 | values should not be indented. 103 | 104 | The files can hold arbitrary values, except empty values and values which 105 | contain newline[s]. 106 | 107 | Except empty/with-newlines, any list of configure arguments, for instance:: 108 | 109 | ./configure --thing=foo --libs="-L/bar -lbaz" -x abc +z 110 | 111 | can also be added to the file, like so:: 112 | 113 | printf "%s\n" --thing=foo --libs="-L/bar -lbaz" -x abc +z >> ffmpeg_options 114 | 115 | Instructions for Debian / Ubuntu package 116 | ======================================== 117 | 118 | Run ``./update`` first. Note that the NAME_options files are respected - but may 119 | conflict with the built-in Debian build options. For best results one should 120 | customize the build only via the files ``debian/rules`` and ``debian/control``. 121 | 122 | To help track dependencies and installed files, there is the option to create a 123 | Debian package containing the mpv binary and documentation. This is considered 124 | advanced usage and you may experience problems if you have weird third party 125 | repositories enabled or use exotic Debian derivatives. This procedure is 126 | regularly tested on Debian Sid. 127 | 128 | Install some basic packaging tools with the command:: 129 | 130 | apt-get install devscripts equivs 131 | 132 | In the mpv-build root directory, create and install a dummy build dependency 133 | package:: 134 | 135 | mk-build-deps -s sudo -i 136 | 137 | You can now build the mpv Debian package with the following command:: 138 | 139 | dpkg-buildpackage -uc -us -b -j4 140 | 141 | Adjust the "4" to your number of available processors as appropriate. On 142 | completion, the file mpv__.deb will be created in the 143 | parent directory. Install it with:: 144 | 145 | sudo dpkg -i ../mpv__.deb 146 | 147 | where you must replace with the version of mpv you just built (as 148 | indicated in debian/changelog) and with your architecture. 149 | 150 | To keep your package up to date, simply repeat the above commands after running 151 | the ``./update`` script in the mpv-build root directory from time to time. 152 | 153 | Local changes to the git repositories 154 | ===================================== 155 | 156 | Making local changes to the created git repositories is generally discouraged. 157 | Updating might remove local changes or conflict with them. Sometimes the 158 | repositories might be wiped entirely. If you make local changes, always keep 159 | them in a separate repository and merge them after updating. 160 | 161 | In general, changes to the mpv-build repository itself are relatively safe, 162 | keeping branches in sub-repositories might be ok, and making local, uncommitted 163 | changes in sub-repositories will break. 164 | 165 | Selecting release vs. master versions 166 | ===================================== 167 | 168 | By default, mpv, ffmpeg, libplacebo and libass use the git master versions. 169 | These are bleeding edge, but should usually work fine. To get a stable 170 | (slightly stale) version, you can use release versions. 171 | Note that at least for mpv, releases are not actually maintained - releases 172 | are for Linux distributions, which are expected to maintain them and to 173 | backport bug fixes (which they usually fail to do). 174 | 175 | The following command can be used to delete all local changes, and to checkout 176 | the latest release version of mpv:: 177 | 178 | ./use-mpv-release 179 | 180 | And run ``./rebuild`` or similar. Use this to switch back to git master:: 181 | 182 | ./use-mpv-master 183 | 184 | Or this to switch to a custom tag/branch/commit FOO:: 185 | 186 | ./use-mpv-custom FOO 187 | 188 | Likewise, you can use ``./use-ffmpeg-master``, ``./use-ffmpeg-release`` or 189 | ``./use-ffmpeg-custom BAR`` to switch between git master, the latest FFmpeg 190 | release, or to a custom tag/branch/commit BAR. 191 | 192 | Use on your own risk. 193 | 194 | mpv configure options 195 | ===================== 196 | 197 | Just like ``ffmpeg_options``, the file ``mpv_options`` in the 198 | mpv-build top-level directory can be used to set custom mpv configure 199 | options prior to compiling. Like with ffmpeg_option, it expects one 200 | switch per line (e.g. ``-Dsomething=enabled``). 201 | 202 | But normally, you shouldn't need this. 203 | 204 | Building libmpv 205 | --------------- 206 | 207 | libmpv is built by default, but you can disable it in the configure option:: 208 | 209 | printf "%s\n" -Dlibmpv=false > mpv_options 210 | 211 | The Debian packaging scripts do not currently support libmpv. 212 | 213 | Contact 214 | ======= 215 | 216 | You can find us on IRC in ``#mpv`` on ``irc.libera.chat`` 217 | 218 | Report bugs to the `issues tracker`_ provided by GitHub to send us bug 219 | reports or feature requests. 220 | 221 | .. _issues tracker: https://github.com/mpv-player/mpv/issues 222 | -------------------------------------------------------------------------------- /build: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | export LC_ALL=C 4 | 5 | #scripts/fribidi-config 6 | #scripts/fribidi-build "$@" 7 | scripts/libplacebo-config 8 | scripts/libplacebo-build "$@" 9 | scripts/libass-config 10 | scripts/libass-build "$@" 11 | scripts/ffmpeg-config 12 | scripts/ffmpeg-build "$@" 13 | scripts/mpv-config 14 | scripts/mpv-build "$@" 15 | -------------------------------------------------------------------------------- /clean: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | export LC_ALL=C 3 | 4 | scripts/ffmpeg-clean 5 | scripts/fribidi-clean 6 | scripts/libass-clean 7 | scripts/libplacebo-clean 8 | scripts/mpv-clean 9 | rm -rf build_libs 10 | -------------------------------------------------------------------------------- /debian/changelog.TEMPLATE: -------------------------------------------------------------------------------- 1 | mpv (1:1.0noversion) UNRELEASED; urgency=medium 2 | 3 | * local build 4 | 5 | -- Local User Sat, 08 Feb 2014 03:47:26 -0800 6 | -------------------------------------------------------------------------------- /debian/compat: -------------------------------------------------------------------------------- 1 | 12 2 | -------------------------------------------------------------------------------- /debian/control: -------------------------------------------------------------------------------- 1 | Source: mpv 2 | Section: misc 3 | Priority: optional 4 | Maintainer: Kevin Mitchell 5 | Standards-Version: 3.9.3 6 | Build-Depends: 7 | autoconf, 8 | automake, 9 | c-compiler | gcc, 10 | debhelper (>= 12), 11 | glslang-dev, 12 | ladspa-sdk, 13 | libasound2-dev [linux-any], 14 | libarchive-dev, 15 | libbluray-dev, 16 | libbs2b-dev, 17 | libcaca-dev, 18 | libcdio-paranoia-dev, 19 | libdisplay-info-dev, 20 | libdrm-dev, 21 | libdav1d-dev, 22 | libdvdnav-dev, 23 | libegl1-mesa-dev, 24 | libepoxy-dev, 25 | libfontconfig-dev, 26 | libfreetype6-dev, 27 | libfribidi-dev, 28 | libgl1-mesa-dev, 29 | libgbm-dev, 30 | libgnutls-dev | libgnutls28-dev, 31 | libharfbuzz-dev, 32 | libjack-jackd2-dev | libjack-dev, 33 | libjpeg-dev, 34 | libbrotli-dev, 35 | liblcms2-dev, 36 | liblua5.2-dev | liblua5.1-0-dev, 37 | libmodplug-dev, 38 | libmp3lame-dev, 39 | libopenal-dev, 40 | libopus-dev, 41 | libopencore-amrnb-dev, 42 | libopencore-amrwb-dev, 43 | libpipewire-0.3-dev, 44 | libpulse-dev, 45 | librtmp-dev, 46 | librubberband-dev, 47 | libsdl2-dev, 48 | libsixel-dev, 49 | libssh-dev, 50 | libsoxr-dev, 51 | libspeex-dev, 52 | libtool, 53 | libuchardet-dev, 54 | libv4l-dev [!hurd-any], 55 | libva-dev [!hurd-any], 56 | libvdpau-dev, 57 | libvorbis-dev, 58 | libvo-amrwbenc-dev, 59 | libunwind-dev, 60 | libvpx-dev, 61 | libvulkan-dev, 62 | libwayland-dev, 63 | libx264-dev, 64 | libx11-dev, 65 | libxext-dev, 66 | libxkbcommon-dev, 67 | libxpresent-dev, 68 | libxrandr-dev, 69 | libxss-dev, 70 | libxv-dev, 71 | libxvidcore-dev, 72 | linux-libc-dev [linux-any], 73 | meson, 74 | nasm, 75 | ninja-build, 76 | pkg-config, 77 | python3, 78 | python3-docutils, 79 | wayland-protocols, 80 | x11proto-core-dev, 81 | zlib1g-dev 82 | 83 | Package: mpv 84 | Architecture: any 85 | Depends: ${shlibs:Depends}, ${misc:Depends} 86 | Recommends: 87 | libgl1-mesa-dri, 88 | i965-va-driver | libva-intel-vaapi-driver | va-driver, 89 | mesa-vdpau-drivers | nvidia-vdpau-driver | nvidia-driver-binary | nvidia-current | vdpau-driver 90 | Suggests: libaacs0 91 | Description: mplayer/mplayer2 based video player 92 | MPV is a versatile CLI movie player, based on mplayer and mplayer2. 93 | . 94 | This package is not part of Debian. It was created by mpv-build scripts with 95 | statically linked ffmpeg, libass and libplacebo from upstream. 96 | Homepage:https://github.com/mpv-player/mpv-build 97 | -------------------------------------------------------------------------------- /debian/copyright: -------------------------------------------------------------------------------- 1 | Current maintainership mostly handled by Kevin Mitchell 2 | Thu, 27 Mar 2014 16:39:11 -0700 3 | 4 | This package was debianized by Wessel Dankers on 5 | Sun, 06 Jan 2013 13:44:11 +0100. 6 | 7 | Original source can be found at: https://github.com/mpv-player 8 | 9 | Copyrighted by various authors. Licensed under the terms of GNU GPL. 10 | See /usr/share/common-licenses/GPL for details. 11 | -------------------------------------------------------------------------------- /debian/rules: -------------------------------------------------------------------------------- 1 | #! /usr/bin/make -f 2 | 3 | export DEB_BUILD_MAINT_OPTIONS := hardening=+all optimize=-lto 4 | 5 | # To enable parallel building: 6 | # You can either set DEB_BUILD_OPTIONS=paralell= in your build environment 7 | # or provide the -j option to debuild or dpkg-buildpackage, which 8 | # ammounts to the same thing. 9 | ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS))) 10 | NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS))) 11 | # use MFLAGS, rather than MAKEFLAGS as the latter is used by make internally 12 | MFLAGS += -j$(NUMJOBS) 13 | MESONFLAGS += -j$(NUMJOBS) 14 | NINJAFLAGS += -j$(NUMJOBS) 15 | endif 16 | 17 | # make .PHONY all the targets that have name collisions with the scripts 18 | # see http://www.debian.org/doc/manuals/maint-guide/dreq.en.html#rules 19 | .PHONY: clean build install 20 | # Apparently, the above isn't enough because of the "%" target. Make the problematic targets explicit 21 | clean: 22 | exec dh $@ 23 | build: 24 | exec dh $@ 25 | install: 26 | exec dh $@ 27 | # Handle all other targets in the usual way. 28 | # The --parallel flag to dh doesn't seem to have the intended effect 29 | # so leave it out. 30 | %: 31 | exec dh $@ 32 | 33 | libass_config: 34 | scripts/libass-config 35 | 36 | libass_build: libass_config 37 | scripts/libass-build $(MFLAGS) 38 | 39 | # depend on libass_build in case the user specified --enable-libass in ffmpeg_options 40 | ffmpeg_config: libass_build libplacebo_build 41 | scripts/ffmpeg-config \ 42 | --enable-gnutls \ 43 | --enable-libdav1d \ 44 | --enable-libmodplug \ 45 | --enable-libmp3lame \ 46 | --enable-libopus \ 47 | --enable-libpulse \ 48 | --enable-libsoxr \ 49 | --enable-libspeex \ 50 | --enable-libssh \ 51 | --enable-libvorbis \ 52 | --enable-libvpx \ 53 | --enable-ladspa \ 54 | --enable-libbs2b \ 55 | --enable-gpl --enable-libxvid --enable-libx264 \ 56 | --enable-version3 --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libvo-amrwbenc 57 | 58 | ffmpeg_build: ffmpeg_config 59 | scripts/ffmpeg-build $(MFLAGS) 60 | 61 | libplacebo_config: 62 | scripts/libplacebo-config 63 | 64 | libplacebo_build: libplacebo_config 65 | scripts/libplacebo-build $(NINJAFLAGS) 66 | 67 | # drop the local/ since it's package managed now 68 | override_dh_auto_configure: ffmpeg_build libass_build libplacebo_build 69 | scripts/mpv-config --prefix=/usr \ 70 | -Dopenal=enabled \ 71 | -Ddvbin=enabled \ 72 | -Ddvdnav=enabled \ 73 | -Dsdl2=enabled \ 74 | -Dcdda=enabled 75 | 76 | override_dh_auto_build: 77 | scripts/mpv-build $(MESONFLAGS) 78 | 79 | # install mpv to the debian packageing dir 80 | # --destdir is relative to mpv/build 81 | override_dh_auto_install: 82 | scripts/mpv-install --destdir=../../debian/mpv 83 | 84 | # for manually installed dependencies 85 | override_dh_shlibdeps: 86 | dh_shlibdeps --dpkg-shlibdeps-params=--ignore-missing-info 87 | 88 | # call all the cleans 89 | override_dh_auto_clean: 90 | ./clean 91 | -------------------------------------------------------------------------------- /debian/source/format: -------------------------------------------------------------------------------- 1 | 3.0 (native) 2 | -------------------------------------------------------------------------------- /debian/source/options: -------------------------------------------------------------------------------- 1 | compression = xz 2 | compression-level = best 3 | -------------------------------------------------------------------------------- /install: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | scripts/mpv-install 5 | -------------------------------------------------------------------------------- /rebuild: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | export LC_ALL=C 4 | 5 | ./update 6 | ./clean 7 | ./build "$@" 8 | -------------------------------------------------------------------------------- /scripts/debian-update-versions: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | get_version() 4 | { 5 | ( 6 | cd $1 > /dev/null 7 | VERSION=1:$(git name-rev --name-only --tags HEAD | sed -e 's/^[^0-9]*//' -e 's/\^0$//') 8 | if [ "$VERSION" = "1:" ]; then 9 | TIMESTAMP=$(git log -1 --date=short --format=%cd | sed 's/-/./g') 10 | COMMIT=$(git rev-parse --short HEAD) 11 | VERSION="2:${TIMESTAMP}.${COMMIT}" 12 | fi 13 | echo ${VERSION} 14 | ) 15 | } 16 | 17 | do_subst() { 18 | sed -e "0,/^mpv (.*)/s/(.*)/($1)/" \ 19 | -e "s/^ \* local build.*/ \* local build with ffmpeg $2, libass $3, libplacebo $4/" \ 20 | -e"s/\(^ -- Local User \).*/\1 $(date -R)/" debian/changelog.TEMPLATE > debian/changelog 21 | } 22 | 23 | do_subst $(get_version mpv) $(get_version ffmpeg) $(get_version libass) $(get_version libplacebo) 24 | -------------------------------------------------------------------------------- /scripts/ffmpeg-build: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | make -C ffmpeg_build install "$@" 5 | -------------------------------------------------------------------------------- /scripts/ffmpeg-clean: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | rm -rf ffmpeg_build 4 | -------------------------------------------------------------------------------- /scripts/ffmpeg-config: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | echo() { printf %s\\n "$*"; } # depends on standard IFS (which we have) 5 | 6 | BUILD="$(pwd)" 7 | newline=" 8 | " 9 | 10 | if test -f "$BUILD"/ffmpeg_options ; then 11 | IFS=$newline 12 | set -- $(cat "$BUILD"/ffmpeg_options) "$@" 13 | unset -v IFS 14 | fi 15 | 16 | OPTIONS="--enable-gpl --disable-debug --disable-doc --enable-static --disable-shared --enable-pic" 17 | 18 | # Do FFmpeg's job. 19 | if ( echo "$OPTIONS" "$@" | \ 20 | grep -q -E -e "-openssl|-gnutls|-mbedtls|-libtls|-schannel|-securetransport" ) 21 | then 22 | echo TLS/SSL user option specified, skipping autodetection 23 | else 24 | if pkg-config gnutls ; then 25 | OPTIONS="$OPTIONS --enable-gnutls" 26 | echo "Auto-enabling GnuTLS." 27 | elif pkg-config openssl ; then 28 | OPTIONS="$OPTIONS --enable-nonfree --enable-openssl" 29 | echo "Auto-enabling OpenSSL (creates a non-redistributable binary)." 30 | fi 31 | fi 32 | 33 | case "$PKG_CONFIG_PATH" in 34 | '') 35 | export PKG_CONFIG_PATH="$BUILD/build_libs/lib/pkgconfig" 36 | ;; 37 | *) 38 | export PKG_CONFIG_PATH="$BUILD/build_libs/lib/pkgconfig:$PKG_CONFIG_PATH" 39 | ;; 40 | esac 41 | 42 | echo Using ffmpeg options: $OPTIONS "$@" 43 | 44 | mkdir -p "$BUILD"/ffmpeg_build 45 | cd "$BUILD"/ffmpeg_build 46 | # need to link against stdc++ in case libplacebo was built with glslang, 47 | # which requires that 48 | export LDFLAGS="$LDFLAGS -lstdc++" 49 | "$BUILD"/ffmpeg/configure --prefix="$BUILD"/build_libs $OPTIONS "$@" 50 | -------------------------------------------------------------------------------- /scripts/fribidi-build: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | make -C fribidi install "$@" -j1 # race conditions in the make rules 5 | -------------------------------------------------------------------------------- /scripts/fribidi-clean: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | if [ -f fribidi/Makefile ];then 4 | make -C fribidi distclean 5 | fi 6 | -------------------------------------------------------------------------------- /scripts/fribidi-config: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | BUILD="$(pwd)" 4 | newline=" 5 | " 6 | 7 | if test -f "$BUILD"/fribidi_options ; then 8 | IFS=$newline 9 | set -- $(cat "$BUILD"/fribidi_options) "$@" 10 | unset -v IFS 11 | fi 12 | 13 | OPTIONS="--enable-static --disable-shared --without-glib --with-pic" 14 | 15 | cd "$BUILD"/fribidi 16 | ./bootstrap 17 | ./configure --prefix="$BUILD/build_libs" --libdir="$BUILD/build_libs/lib" $OPTIONS "$@" 18 | -------------------------------------------------------------------------------- /scripts/libass-build: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | make -C libass install "$@" 5 | -------------------------------------------------------------------------------- /scripts/libass-clean: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | if [ -f libass/Makefile ];then 4 | make -C libass distclean 5 | fi 6 | -------------------------------------------------------------------------------- /scripts/libass-config: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | BUILD="$(pwd)" 4 | newline=" 5 | " 6 | 7 | if test -f "$BUILD"/libass_options ; then 8 | IFS=$newline 9 | set -- $(cat "$BUILD"/libass_options) "$@" 10 | unset -v IFS 11 | fi 12 | 13 | OPTIONS="--enable-static --disable-shared --with-pic" 14 | 15 | case "$PKG_CONFIG_PATH" in 16 | '') 17 | export PKG_CONFIG_PATH="$BUILD/build_libs/lib/pkgconfig" 18 | ;; 19 | *) 20 | export PKG_CONFIG_PATH="$BUILD/build_libs/lib/pkgconfig:$PKG_CONFIG_PATH" 21 | ;; 22 | esac 23 | 24 | cd "$BUILD"/libass 25 | # Later libass doesn't automatically run configure with autogen.sh anymore 26 | ./autogen.sh --prefix="$BUILD/build_libs" --libdir="$BUILD/build_libs/lib" $OPTIONS "$@" 27 | ./configure --prefix="$BUILD/build_libs" --libdir="$BUILD/build_libs/lib" $OPTIONS "$@" 28 | 29 | -------------------------------------------------------------------------------- /scripts/libplacebo-build: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | ninja install -C libplacebo/build "$@" 5 | -------------------------------------------------------------------------------- /scripts/libplacebo-clean: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | if [ -d "libplacebo/build" ]; then 5 | rm -r libplacebo/build 6 | fi 7 | -------------------------------------------------------------------------------- /scripts/libplacebo-config: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | BUILD="$(pwd)" 5 | newline=" 6 | " 7 | 8 | if test -f "$BUILD"/libplacebo_options ; then 9 | IFS=$newline 10 | set -- $(cat "$BUILD"/libplacebo_options) "$@" 11 | unset -v IFS 12 | fi 13 | 14 | OPTIONS="-Ddefault_library=static -Dtests=false -Ddemos=false" 15 | 16 | case "$PKG_CONFIG_PATH" in 17 | '') 18 | export PKG_CONFIG_PATH="$BUILD/build_libs/lib/pkgconfig" 19 | ;; 20 | *) 21 | export PKG_CONFIG_PATH="$BUILD/build_libs/lib/pkgconfig:$PKG_CONFIG_PATH" 22 | ;; 23 | esac 24 | 25 | cd "$BUILD"/libplacebo 26 | 27 | test -d build && OPTIONS="$OPTIONS --wipe" 28 | echo Using libplacebo options: $OPTIONS "$@" 29 | 30 | meson setup build --prefix="$BUILD/build_libs" --libdir="$BUILD/build_libs/lib" $OPTIONS "$@" 31 | -------------------------------------------------------------------------------- /scripts/mpv-build: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | cd mpv 5 | meson compile -C build "$@" 6 | -------------------------------------------------------------------------------- /scripts/mpv-clean: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | test -e mpv || exit 0 3 | 4 | cd mpv 5 | rm -rf build 6 | -------------------------------------------------------------------------------- /scripts/mpv-config: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | BUILD="$(pwd)" 5 | newline=" 6 | " 7 | 8 | if test -f "$BUILD"/mpv_options ; then 9 | IFS=$newline 10 | set -- $(cat "$BUILD"/mpv_options) "$@" 11 | unset -v IFS 12 | fi 13 | 14 | case "$PKG_CONFIG_PATH" in 15 | '') 16 | export PKG_CONFIG_PATH="$BUILD/build_libs/lib/pkgconfig" 17 | ;; 18 | *) 19 | export PKG_CONFIG_PATH="$BUILD/build_libs/lib/pkgconfig:$PKG_CONFIG_PATH" 20 | ;; 21 | esac 22 | 23 | echo Using mpv options: $OPTIONS "$@" 24 | 25 | cd "$BUILD"/mpv 26 | 27 | # add missing private dependencies from libass.pc 28 | # this is necessary due to the hybrid static / dynamic nature of the build 29 | # need to link against stdc++ in case libplacebo was built with glslang, 30 | # which requires that 31 | export LDFLAGS="$LDFLAGS $(pkg-config --libs fontconfig harfbuzz fribidi) -lstdc++" 32 | meson setup build -Dbuildtype=release $OPTIONS "$@" 33 | -------------------------------------------------------------------------------- /scripts/mpv-install: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | cd mpv 5 | meson install -C build "$@" 6 | -------------------------------------------------------------------------------- /scripts/mpv-uninstall: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | cd mpv 5 | ninja uninstall -C build 6 | -------------------------------------------------------------------------------- /scripts/switch-branch: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | if [ x"$1" = "x" ]; then 5 | echo "Need a component name." 6 | exit 1 7 | fi 8 | 9 | mkdir -p config 10 | 11 | FILENAME="branch-$1" 12 | BRANCH="$2" 13 | echo "$BRANCH" > config/"$FILENAME" 14 | 15 | scripts/"$1"-clean 16 | 17 | echo "Run ./update to actually update the sources based on the new selection." 18 | echo "Run ./rebuild to update the source and to compile the selected branch." 19 | -------------------------------------------------------------------------------- /uninstall: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | export LC_ALL=C 4 | 5 | scripts/mpv-uninstall 6 | -------------------------------------------------------------------------------- /update: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | export LC_ALL=C 3 | 4 | do_clone() 5 | { 6 | set -ex 7 | if ! test -e "$1" ; then 8 | git clone "$2" "$1" 9 | fi 10 | ( 11 | cd "$1" 12 | git remote set-url origin "$2" 13 | git fetch 14 | git submodule update --init 15 | ) 16 | } 17 | 18 | do_clone_all() 19 | { 20 | do_clone "ffmpeg" "https://github.com/FFmpeg/FFmpeg.git" 21 | #do_clone "fribidi" "http://anongit.freedesktop.org/git/fribidi/fribidi.git" 22 | do_clone "libass" "https://github.com/libass/libass.git" 23 | do_clone "libplacebo" "https://github.com/haasn/libplacebo.git" 24 | do_clone "mpv" "https://github.com/mpv-player/mpv.git" 25 | } 26 | 27 | do_gitmaster() 28 | { 29 | set -ex 30 | ( 31 | cd "$1" 32 | git checkout origin/master 33 | git remote prune origin 34 | ) 35 | } 36 | 37 | versort_with_prefix() 38 | { 39 | # Emulate sort -V using a known prefix. Filter out anything else. 40 | sed -n -e "s/^$1\([0-9]\)/\\1/p" |\ 41 | sort -n -t . -k 1,1 -k 2,2 -k 3,3 -k 4,4 |\ 42 | sed -e "s/^/$1/" 43 | # GNU version of the same: 44 | # grep "^$2[0-9]" | sort -V 45 | } 46 | 47 | do_releasetag() 48 | { 49 | local prefix= # by default, don't use a prefix 50 | case "$1" in 51 | ffmpeg) prefix=n;; # e.g. n3.3.1 52 | mpv|libplacebo) prefix=v;; # e.g. v0.26.0 53 | esac 54 | 55 | ( 56 | cd "$1" 57 | version=`git tag | grep -v rc | grep -v dev | versort_with_prefix "$prefix" | tail -n 1` 58 | git checkout refs/tags/"$version" 59 | ) 60 | } 61 | 62 | do_fixedref() 63 | { 64 | ( 65 | cd "$1" 66 | git checkout "$2" 67 | ) 68 | } 69 | 70 | # args: $1: project name, $2: release/master/@foo [,$3: non-empty to ignore the config file] 71 | checkout() 72 | { 73 | local branch="$2" 74 | if [ -z "$3" ] && [ -d config/ ] && [ -f config/branch-$1 ]; then 75 | branch="$(cat config/branch-$1)" 76 | fi 77 | 78 | case "$branch" in 79 | master) do_gitmaster $1;; 80 | release) do_releasetag $1;; 81 | @*) do_fixedref $1 "${branch#@}";; # everything after the '@' prefix 82 | *) >&2 printf "%s\n" "Error: Don't know how to checkout '$branch'" 83 | return 1 84 | esac 85 | } 86 | 87 | # fallback targets: release/master/@foo if no config file 88 | checkout_ffmpeg=master 89 | #checkout_fribidi=release 90 | checkout_libass=master 91 | checkout_libplacebo=master 92 | checkout_mpv=master 93 | 94 | 95 | checkout_all() 96 | { 97 | set -ex 98 | do_clone_all 99 | checkout ffmpeg $checkout_ffmpeg 100 | #$checkout fribidi $checkout_fribidi 101 | checkout libass $checkout_libass 102 | checkout libplacebo $checkout_libplacebo 103 | checkout mpv $checkout_mpv 104 | } 105 | 106 | do_update_debian_versions() 107 | { 108 | scripts/debian-update-versions $1 109 | } 110 | 111 | if [ x"$1" != x"--skip-selfupdate" ]; then 112 | ( 113 | set -ex 114 | git pull --rebase 115 | ) 116 | exec "$0" --skip-selfupdate "$@" 117 | fi 118 | shift 119 | 120 | # allow checkout master/release without checking the config files 121 | case "$1" in 122 | --master) 123 | checkout_ffmpeg="master -" 124 | #checkout_fribidi="master -" 125 | checkout_libass="master -" 126 | checkout_libplacebo="master -" 127 | checkout_mpv="master -" 128 | ;; 129 | --release) 130 | checkout_ffmpeg="release -" 131 | checkout_mpv="release -" 132 | ;; 133 | '') 134 | ;; 135 | *) 136 | echo >&2 "$0 --master" 137 | echo >&2 "$0 --release" 138 | exit 0 139 | ;; 140 | esac 141 | 142 | checkout_all 143 | 144 | do_update_debian_versions 145 | -------------------------------------------------------------------------------- /use-ffmpeg-custom: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | export LC_ALL=C 4 | 5 | if [ -z "$1" ]; then 6 | echo "Aborting. Please provide a commit hash or a tag/branch name." 7 | exit 1 8 | fi 9 | 10 | scripts/switch-branch ffmpeg "@$1" 11 | -------------------------------------------------------------------------------- /use-ffmpeg-master: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | export LC_ALL=C 4 | 5 | scripts/switch-branch ffmpeg master 6 | -------------------------------------------------------------------------------- /use-ffmpeg-release: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | export LC_ALL=C 4 | 5 | scripts/switch-branch ffmpeg release 6 | -------------------------------------------------------------------------------- /use-libass-custom: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | export LC_ALL=C 4 | 5 | if [ -z "$1" ]; then 6 | echo "Aborting. Please provide a commit hash or a tag/branch name." 7 | exit 1 8 | fi 9 | 10 | scripts/switch-branch libass "@$1" 11 | -------------------------------------------------------------------------------- /use-libass-master: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | export LC_ALL=C 4 | 5 | scripts/switch-branch libass master 6 | -------------------------------------------------------------------------------- /use-libplacebo-custom: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | export LC_ALL=C 4 | 5 | if [ -z "$1" ]; then 6 | echo "Aborting. Please provide a commit hash or a tag/branch name." 7 | exit 1 8 | fi 9 | 10 | scripts/switch-branch libplacebo "@$1" 11 | -------------------------------------------------------------------------------- /use-libplacebo-master: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | export LC_ALL=C 4 | 5 | scripts/switch-branch libplacebo master 6 | -------------------------------------------------------------------------------- /use-libplacebo-release: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | export LC_ALL=C 4 | 5 | scripts/switch-branch libplacebo release 6 | -------------------------------------------------------------------------------- /use-mpv-custom: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | export LC_ALL=C 4 | 5 | if [ -z "$1" ]; then 6 | echo "Aborting. Please provide a commit hash or a tag/branch name." 7 | exit 1 8 | fi 9 | 10 | scripts/switch-branch mpv "@$1" 11 | -------------------------------------------------------------------------------- /use-mpv-master: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | export LC_ALL=C 4 | 5 | scripts/switch-branch mpv master 6 | -------------------------------------------------------------------------------- /use-mpv-release: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | export LC_ALL=C 4 | 5 | scripts/switch-branch mpv release 6 | --------------------------------------------------------------------------------