diff options
author | zeromind <zeromind@gmx.com> | 2022-08-31 22:17:09 +0000 |
---|---|---|
committer | Kevin Mitchell <kevmitch@gmail.com> | 2022-08-31 15:59:07 -0700 |
commit | db240a2a9b3045410ec1f47262be93222e4d0a54 (patch) | |
tree | 42fa26a59df6e0f4575f863a6fc100deebd294df | |
parent | 383e54c100319a95e77d97372d0659d58ad8c582 (diff) | |
download | mpv-build-db240a2a9b3045410ec1f47262be93222e4d0a54.tar.bz2 mpv-build-db240a2a9b3045410ec1f47262be93222e4d0a54.tar.xz |
include libplacebo
Include libplacebo to add support `vo=gpu-next` in mpv,
as the OS-provided libplacebo may not be recent enough.
Explicitly link mpv and ffmpeg against stdc++ in case libplacebo was built with glslang,
which does not have pkg-config files.
Adjust the update script to also checkout git submodules as well,
which is needed for libplacebo.
-rw-r--r-- | .gitignore | 2 | ||||
-rw-r--r-- | README.rst | 13 | ||||
-rwxr-xr-x | build | 2 | ||||
-rwxr-xr-x | clean | 1 | ||||
-rwxr-xr-x | scripts/ffmpeg-config | 3 | ||||
-rwxr-xr-x | scripts/libplacebo-build | 4 | ||||
-rwxr-xr-x | scripts/libplacebo-clean | 6 | ||||
-rwxr-xr-x | scripts/libplacebo-config | 30 | ||||
-rwxr-xr-x | scripts/mpv-config | 4 | ||||
-rwxr-xr-x | update | 15 | ||||
-rwxr-xr-x | use-libplacebo-custom | 10 | ||||
-rwxr-xr-x | use-libplacebo-master | 5 | ||||
-rwxr-xr-x | use-libplacebo-release | 5 |
13 files changed, 88 insertions, 12 deletions
@@ -1,6 +1,7 @@ /ffmpeg /fribidi /libass +/libplacebo /mpv /build_libs /ffmpeg_build @@ -12,3 +13,4 @@ /debian/mpv.postrm.debhelper /debian/mpv.substvars /config/ +/*_options @@ -61,6 +61,7 @@ Essential dependencies (incomplete list): - gcc or clang, yasm, git - autoconf/autotools (for libass) +- meson, ninja (libplacebo) - X development headers (xlib, X extensions, vdpau, GL, Xv, ...) - Audio output development headers (libasound, pulseaudio) - fribidi, freetype, fontconfig development headers (for libass) @@ -174,12 +175,12 @@ changes in sub-repositories will break. Selecting release vs. master versions ===================================== -By default, mpv, ffmpeg and libass use the git master versions. These are -bleeding edge, but should usually work fine. To get a stable (slightly stale) -version, you can use release versions. Note that at least for mpv, releases -are not actually maintained - releases are for Linux distributions, which are -expected to maintain them and to backport bug fixes (which they usually fail -to do). +By default, mpv, ffmpeg, libplacebo and libass use the git master versions. +These are bleeding edge, but should usually work fine. To get a stable +(slightly stale) version, you can use release versions. +Note that at least for mpv, releases are not actually maintained - releases +are for Linux distributions, which are expected to maintain them and to +backport bug fixes (which they usually fail to do). The following command can be used to delete all local changes, and to checkout the latest release version of mpv:: @@ -4,6 +4,8 @@ export LC_ALL=C #scripts/fribidi-config #scripts/fribidi-build "$@" +scripts/libplacebo-config +scripts/libplacebo-build "$@" scripts/libass-config scripts/libass-build "$@" scripts/ffmpeg-config @@ -4,5 +4,6 @@ export LC_ALL=C scripts/ffmpeg-clean scripts/fribidi-clean scripts/libass-clean +scripts/libplacebo-clean scripts/mpv-clean rm -rf build_libs diff --git a/scripts/ffmpeg-config b/scripts/ffmpeg-config index 9c8bddc..4eb38f3 100755 --- a/scripts/ffmpeg-config +++ b/scripts/ffmpeg-config @@ -46,4 +46,7 @@ echo Using ffmpeg options: $OPTIONS "$@" mkdir -p "$BUILD"/ffmpeg_build cd "$BUILD"/ffmpeg_build +# need to link against stdc++ in case libplacebo was built with glslang, +# which requires that +export LDFLAGS="$LDFLAGS -lstdc++" "$BUILD"/ffmpeg/configure --prefix="$BUILD"/build_libs $OPTIONS "$@" diff --git a/scripts/libplacebo-build b/scripts/libplacebo-build new file mode 100755 index 0000000..9905606 --- /dev/null +++ b/scripts/libplacebo-build @@ -0,0 +1,4 @@ +#!/bin/sh +set -e + +ninja install -C libplacebo/build "$@" diff --git a/scripts/libplacebo-clean b/scripts/libplacebo-clean new file mode 100755 index 0000000..1e26b9a --- /dev/null +++ b/scripts/libplacebo-clean @@ -0,0 +1,6 @@ +#!/bin/sh +set -e + +if [ -d "libplacebo/build" ]; then + rm -r libplacebo/build +fi diff --git a/scripts/libplacebo-config b/scripts/libplacebo-config new file mode 100755 index 0000000..345c672 --- /dev/null +++ b/scripts/libplacebo-config @@ -0,0 +1,30 @@ +#!/bin/sh +set -e + +BUILD="$(pwd)" +newline=" +" + +if test -f "$BUILD"/libplacebo_options ; then + IFS=$newline + set -- $(cat "$BUILD"/libplacebo_options) "$@" + unset -v IFS +fi + +OPTIONS="-Ddefault_library=static -Dtests=false -Ddemos=false" + +case "$PKG_CONFIG_PATH" in + '') + export PKG_CONFIG_PATH="$BUILD/build_libs/lib/pkgconfig" + ;; + *) + export PKG_CONFIG_PATH="$BUILD/build_libs/lib/pkgconfig:$PKG_CONFIG_PATH" + ;; +esac + +cd "$BUILD"/libplacebo + +test -d build && OPTIONS="$OPTIONS --wipe" +echo Using libplacebo options: $OPTIONS "$@" + +meson build --prefix="$BUILD/build_libs" --libdir="$BUILD/build_libs/lib" $OPTIONS "$@" diff --git a/scripts/mpv-config b/scripts/mpv-config index d09153f..55c181f 100755 --- a/scripts/mpv-config +++ b/scripts/mpv-config @@ -29,6 +29,8 @@ if [ "$BUILDSYSTEM" = "meson" ]; then else # add missing private dependencies from libass.pc # this is necessary due to the hybrid static / dynamic nature of the build - export LDFLAGS="$LDFLAGS $(pkg-config --libs fontconfig harfbuzz fribidi)" + # need to link against stdc++ in case libplacebo was built with glslang, + # which requires that + export LDFLAGS="$LDFLAGS $(pkg-config --libs fontconfig harfbuzz fribidi) -lstdc++" python3 ./waf configure "$@" fi @@ -11,15 +11,17 @@ do_clone() cd "$1" git remote set-url origin "$2" git fetch + git submodule update --init ) } do_clone_all() { - do_clone "ffmpeg" "https://github.com/FFmpeg/FFmpeg.git" - #do_clone "fribidi" "http://anongit.freedesktop.org/git/fribidi/fribidi.git" - do_clone "libass" "https://github.com/libass/libass.git" - do_clone "mpv" "https://github.com/mpv-player/mpv.git" + do_clone "ffmpeg" "https://github.com/FFmpeg/FFmpeg.git" + #do_clone "fribidi" "http://anongit.freedesktop.org/git/fribidi/fribidi.git" + do_clone "libass" "https://github.com/libass/libass.git" + do_clone "libplacebo" "https://github.com/haasn/libplacebo.git" + do_clone "mpv" "https://github.com/mpv-player/mpv.git" } do_gitmaster() @@ -47,7 +49,7 @@ do_releasetag() local prefix= # by default, don't use a prefix case "$1" in ffmpeg) prefix=n;; # e.g. n3.3.1 - mpv) prefix=v;; # e.g. v0.26.0 + mpv|libplacebo) prefix=v;; # e.g. v0.26.0 esac ( @@ -86,6 +88,7 @@ checkout() checkout_ffmpeg=master #checkout_fribidi=release checkout_libass=master +checkout_libplacebo=master checkout_mpv=master @@ -96,6 +99,7 @@ checkout_all() checkout ffmpeg $checkout_ffmpeg #$checkout fribidi $checkout_fribidi checkout libass $checkout_libass + checkout libplacebo $checkout_libplacebo checkout mpv $checkout_mpv } @@ -124,6 +128,7 @@ case "$1" in checkout_ffmpeg="master -" #checkout_fribidi="master -" checkout_libass="master -" + checkout_libplacebo="master -" checkout_mpv="master -" ;; --release) diff --git a/use-libplacebo-custom b/use-libplacebo-custom new file mode 100755 index 0000000..121da4f --- /dev/null +++ b/use-libplacebo-custom @@ -0,0 +1,10 @@ +#!/bin/sh +set -e +export LC_ALL=C + +if [ -z "$1" ]; then + echo "Aborting. Please provide a commit hash or a tag/branch name." + exit 1 +fi + +scripts/switch-branch libplacebo "@$1" diff --git a/use-libplacebo-master b/use-libplacebo-master new file mode 100755 index 0000000..ab9ec59 --- /dev/null +++ b/use-libplacebo-master @@ -0,0 +1,5 @@ +#!/bin/sh +set -e +export LC_ALL=C + +scripts/switch-branch libplacebo master diff --git a/use-libplacebo-release b/use-libplacebo-release new file mode 100755 index 0000000..9ec7ad5 --- /dev/null +++ b/use-libplacebo-release @@ -0,0 +1,5 @@ +#!/bin/sh +set -e +export LC_ALL=C + +scripts/switch-branch libplacebo release |