Files
jellyfin-ffmpeg/builder/scripts.d/50-libplacebo.sh
T

73 lines
1.6 KiB
Bash
Raw Normal View History

2022-11-11 18:15:45 +08:00
#!/bin/bash
SCRIPT_REPO="https://code.videolan.org/videolan/libplacebo.git"
2026-05-28 10:55:08 +08:00
SCRIPT_COMMIT="cee9b076f2c63104ccfd497fa79c39a867293ec4"
2022-11-11 18:15:45 +08:00
ffbuild_enabled() {
2024-02-24 00:07:11 +08:00
[[ $TARGET == mac* ]] && return -1
2022-11-11 18:15:45 +08:00
return 0
}
2025-04-17 16:54:48 +08:00
ffbuild_dockerstage() {
to_df "RUN --mount=src=${SELF},dst=/stage.sh --mount=src=patches/libplacebo,dst=/patches run_stage /stage.sh"
}
2022-11-11 18:15:45 +08:00
ffbuild_dockerbuild() {
git-mini-clone "$SCRIPT_REPO" "$SCRIPT_COMMIT" placebo
cd placebo
git submodule update --init --recursive
2025-04-17 16:54:48 +08:00
for patch in /patches/*.patch; do
echo "Applying $patch"
patch -p1 < "$patch"
done
2024-02-12 02:09:42 +08:00
sed -i 's/DPL_EXPORT/DPL_STATIC/' src/meson.build
2022-11-11 18:15:45 +08:00
mkdir build && cd build
local myconf=(
--prefix="$FFBUILD_PREFIX"
--buildtype=release
--default-library=static
-Dvulkan=enabled
2026-05-28 10:55:08 +08:00
-Dvk-proc-addr=enabled
2022-11-11 18:15:45 +08:00
-Dvulkan-registry="$FFBUILD_PREFIX"/share/vulkan/registry/vk.xml
-Dshaderc=enabled
-Dglslang=disabled
-Ddemos=false
-Dtests=false
-Dbench=false
-Dfuzz=false
)
if [[ $TARGET == win* ]]; then
myconf+=(
-Dd3d11=enabled
)
fi
if [[ $TARGET == win* || $TARGET == linux* ]]; then
myconf+=(
--cross-file=/cross.meson
)
else
echo "Unknown target"
return -1
fi
meson "${myconf[@]}" ..
ninja -j$(nproc)
ninja install
echo "Libs.private: -lstdc++" >> "$FFBUILD_PREFIX"/lib/pkgconfig/libplacebo.pc
}
ffbuild_configure() {
echo --enable-libplacebo
}
ffbuild_unconfigure() {
echo --disable-libplacebo
}