summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorzeromind <zeromind@gmx.com>2022-08-31 22:17:09 +0000
committerKevin Mitchell <kevmitch@gmail.com>2022-08-31 15:59:07 -0700
commitdb240a2a9b3045410ec1f47262be93222e4d0a54 (patch)
tree42fa26a59df6e0f4575f863a6fc100deebd294df /scripts
parent383e54c100319a95e77d97372d0659d58ad8c582 (diff)
downloadmpv-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.
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/ffmpeg-config3
-rwxr-xr-xscripts/libplacebo-build4
-rwxr-xr-xscripts/libplacebo-clean6
-rwxr-xr-xscripts/libplacebo-config30
-rwxr-xr-xscripts/mpv-config4
5 files changed, 46 insertions, 1 deletions
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