From d6fb869c4cb321f6b492f9482084e6df4a3f1f4e Mon Sep 17 00:00:00 2001 From: nyanmisaka Date: Sat, 4 Mar 2023 20:20:00 +0800 Subject: [PATCH] Update build script and dependencies Signed-off-by: nyanmisaka --- Dockerfile.in | 6 ++-- debian/jellyfin-ffmpeg5.install | 8 ++++++ debian/rules | 5 ++-- docker-build-win64.sh | 13 +++------ docker-build.sh | 50 +++++++++++++++------------------ 5 files changed, 41 insertions(+), 41 deletions(-) diff --git a/Dockerfile.in b/Dockerfile.in index cba68cc48..405a6f7e6 100644 --- a/Dockerfile.in +++ b/Dockerfile.in @@ -26,11 +26,13 @@ RUN apt-get update \ && yes | apt-get install -y apt-transport-https curl ninja-build debhelper gnupg wget devscripts mmv equivs git nasm pkg-config subversion dh-autoreconf libpciaccess-dev libwayland-dev libx11-dev libx11-xcb-dev libxcb-dri2-0-dev libxcb-dri3-dev libxcb-present-dev libxcb-shm0-dev libxcb-sync-dev libxshmfence-dev libxext-dev libxfixes-dev libxcb1-dev libxrandr-dev libzstd-dev libelf-dev python3-pip zip unzip tar flex bison # Install newer tools from pip3 -RUN pip3 install --upgrade pip \ - && pip3 install meson cmake mako jinja2 +RUN pip3 install $(pip3 help install | grep -o "\-\-break-system-packages") --upgrade pip \ + && pip3 install $(pip3 help install | grep -o "\-\-break-system-packages") meson cmake mako jinja2 + # Avoids timeouts when using git and disable the detachedHead advice RUN git config --global http.postbuffer 524288000 \ && git config --global advice.detachedHead false + # Link to docker-build script RUN ln -sf ${SOURCE_DIR}/docker-build.sh /docker-build.sh diff --git a/debian/jellyfin-ffmpeg5.install b/debian/jellyfin-ffmpeg5.install index bea2b03ae..0509a621a 100644 --- a/debian/jellyfin-ffmpeg5.install +++ b/debian/jellyfin-ffmpeg5.install @@ -1,2 +1,10 @@ ffmpeg usr/lib/jellyfin-ffmpeg ffprobe usr/lib/jellyfin-ffmpeg +libavcodec/libavcodec.so* usr/lib/jellyfin-ffmpeg/lib +libavdevice/libavdevice.so* usr/lib/jellyfin-ffmpeg/lib +libavfilter/libavfilter.so* usr/lib/jellyfin-ffmpeg/lib +libavformat/libavformat.so* usr/lib/jellyfin-ffmpeg/lib +libavutil/libavutil.so* usr/lib/jellyfin-ffmpeg/lib +libpostproc/libpostproc.so* usr/lib/jellyfin-ffmpeg/lib +libswresample/libswresample.so* usr/lib/jellyfin-ffmpeg/lib +libswscale/libswscale.so* usr/lib/jellyfin-ffmpeg/lib diff --git a/debian/rules b/debian/rules index 177c021a9..71331d732 100755 --- a/debian/rules +++ b/debian/rules @@ -17,14 +17,14 @@ CONFIG := --prefix=${TARGET_DIR} \ --disable-doc \ --disable-ffplay \ --disable-ptx-compression \ - --disable-shared \ + --disable-static \ --disable-libxcb \ --disable-sdl2 \ --disable-xlib \ --enable-lto \ --enable-gpl \ --enable-version3 \ - --enable-static \ + --enable-shared \ --enable-gmp \ --enable-gnutls \ --enable-chromaprint \ @@ -105,7 +105,6 @@ override_dh_auto_clean: dh_auto_clean || true override_dh_auto_install: - make -j1 install-data DESTDIR=/srv/build/ffmpeg/jellyfin-ffmpeg/debian/jellyfin-ffmpeg AM_UPDATE_INFO_DIR=no override_dh_usrlocal: diff --git a/docker-build-win64.sh b/docker-build-win64.sh index f22d8465a..f05902094 100755 --- a/docker-build-win64.sh +++ b/docker-build-win64.sh @@ -67,13 +67,9 @@ make install popd # FREETYPE -mkdir freetype +git clone --depth=1 https://gitlab.freedesktop.org/freetype/freetype.git pushd freetype -ft_ver="2.13.0" -ft_link="https://download.savannah.gnu.org/releases/freetype/freetype-${ft_ver}.tar.gz" -wget ${ft_link} -O ft.tar.gz -tar xaf ft.tar.gz -pushd freetype-${ft_ver} +./autogen.sh ./configure \ --prefix=${FF_DEPS_PREFIX} \ --host=${FF_TOOLCHAIN} \ @@ -82,7 +78,6 @@ pushd freetype-${ft_ver} make -j$(nproc) make install popd -popd # FRIBIDI git clone --depth=1 https://github.com/fribidi/fribidi.git @@ -488,7 +483,7 @@ make install popd # OpenCL headers -git clone --depth=1 https://github.com/KhronosGroup/OpenCL-Headers +git clone --depth=1 https://github.com/KhronosGroup/OpenCL-Headers.git pushd OpenCL-Headers/CL mkdir -p ${FF_DEPS_PREFIX}/include/CL mv * ${FF_DEPS_PREFIX}/include/CL @@ -532,7 +527,7 @@ make PREFIX=${FF_DEPS_PREFIX} install popd # AMF -git clone --depth=1 https://github.com/GPUOpen-LibrariesAndSDKs/AMF +git clone --depth=1 https://github.com/GPUOpen-LibrariesAndSDKs/AMF.git pushd AMF/amf/public/include mkdir -p ${FF_DEPS_PREFIX}/include/AMF mv * ${FF_DEPS_PREFIX}/include/AMF diff --git a/docker-build.sh b/docker-build.sh index 8e30f7bff..6105a9050 100755 --- a/docker-build.sh +++ b/docker-build.sh @@ -80,7 +80,7 @@ prepare_extra_common() { # ZIMG pushd ${SOURCE_DIR} - git clone --recursive --depth=1 https://github.com/sekrit-twc/zimg + git clone --recursive --depth=1 https://github.com/sekrit-twc/zimg.git pushd zimg ./autogen.sh ./configure --prefix=${TARGET_DIR} ${CROSS_OPT} @@ -160,7 +160,7 @@ prepare_extra_amd64() { # FFNVCODEC pushd ${SOURCE_DIR} - git clone -b n11.1.5.2 --depth=1 https://github.com/FFmpeg/nv-codec-headers + git clone -b n11.1.5.2 --depth=1 https://github.com/FFmpeg/nv-codec-headers.git pushd nv-codec-headers make make install @@ -169,7 +169,7 @@ prepare_extra_amd64() { # AMF # https://www.ffmpeg.org/general.html#AMD-AMF_002fVCE - git clone --depth=1 https://github.com/GPUOpen-LibrariesAndSDKs/AMF + git clone --depth=1 https://github.com/GPUOpen-LibrariesAndSDKs/AMF.git pushd AMF/amf/public/include mkdir -p /usr/include/AMF mv * /usr/include/AMF @@ -201,7 +201,7 @@ prepare_extra_amd64() { # LIBVA pushd ${SOURCE_DIR} - git clone -b 2.17.0 --depth=1 https://github.com/intel/libva + git clone -b 2.17.0 --depth=1 https://github.com/intel/libva.git pushd libva sed -i 's|getenv("LIBVA_DRIVERS_PATH")|"/usr/lib/jellyfin-ffmpeg/lib/dri:/usr/lib/x86_64-linux-gnu/dri:/usr/lib/dri:/usr/local/lib/dri"|g' va/va.c sed -i 's|getenv("LIBVA_DRIVER_NAME")|getenv("LIBVA_DRIVER_NAME_JELLYFIN")|g' va/va.c @@ -218,7 +218,7 @@ prepare_extra_amd64() { # LIBVA-UTILS pushd ${SOURCE_DIR} - git clone -b 2.17.1 --depth=1 https://github.com/intel/libva-utils + git clone -b 2.17.1 --depth=1 https://github.com/intel/libva-utils.git pushd libva-utils ./autogen.sh ./configure --prefix=${TARGET_DIR} @@ -229,7 +229,7 @@ prepare_extra_amd64() { # INTEL-VAAPI-DRIVER pushd ${SOURCE_DIR} - git clone --depth=1 https://github.com/intel/intel-vaapi-driver + git clone --depth=1 https://github.com/intel/intel-vaapi-driver.git pushd intel-vaapi-driver ./autogen.sh ./configure LIBVA_DRIVERS_PATH=${TARGET_DIR}/lib/dri @@ -242,7 +242,7 @@ prepare_extra_amd64() { # GMMLIB pushd ${SOURCE_DIR} - git clone -b intel-gmmlib-22.3.3 --depth=1 https://github.com/intel/gmmlib + git clone -b intel-gmmlib-22.3.4 --depth=1 https://github.com/intel/gmmlib.git pushd gmmlib mkdir build && pushd build cmake -DCMAKE_INSTALL_PREFIX=${TARGET_DIR} .. @@ -256,7 +256,7 @@ prepare_extra_amd64() { # Provides MSDK runtime (libmfxhw64.so.1) for 11th Gen Rocket Lake and older # Provides MFX dispatcher (libmfx.so.1) for FFmpeg pushd ${SOURCE_DIR} - git clone -b intel-mediasdk-23.1.1 --depth=1 https://github.com/Intel-Media-SDK/MediaSDK + git clone -b intel-mediasdk-23.1.2 --depth=1 https://github.com/Intel-Media-SDK/MediaSDK.git pushd MediaSDK sed -i 's|MFX_PLUGINS_CONF_DIR "/plugins.cfg"|"/usr/lib/jellyfin-ffmpeg/lib/mfx/plugins.cfg"|g' api/mfx_dispatch/linux/mfxloader.cpp mkdir build && pushd build @@ -276,7 +276,7 @@ prepare_extra_amd64() { # Provides VPL runtime (libmfx-gen.so.1.2) for 11th Gen Tiger Lake and newer # Both MSDK and VPL runtime can be loaded by MFX dispatcher (libmfx.so.1) pushd ${SOURCE_DIR} - git clone -b intel-onevpl-23.1.1 --depth=1 https://github.com/oneapi-src/oneVPL-intel-gpu + git clone -b intel-onevpl-23.1.2 --depth=1 https://github.com/oneapi-src/oneVPL-intel-gpu.git pushd oneVPL-intel-gpu mkdir build && pushd build cmake -DCMAKE_INSTALL_PREFIX=${TARGET_DIR} .. @@ -290,10 +290,10 @@ prepare_extra_amd64() { # Full Feature Build: ENABLE_KERNELS=ON(Default) ENABLE_NONFREE_KERNELS=ON(Default) # Free Kernel Build: ENABLE_KERNELS=ON ENABLE_NONFREE_KERNELS=OFF pushd ${SOURCE_DIR} - git clone -b intel-media-23.1.1 --depth=1 https://github.com/intel/media-driver + git clone -b intel-media-23.1.2 --depth=1 https://github.com/intel/media-driver.git pushd media-driver # Possible fix for TGLx timeout caused by 'HCP Scalability Decode' under heavy load - wget -q -O - https://github.com/intel/media-driver/commit/284750bf2619112627dd8c60bd5c8032c7780606.patch | git apply + wget -q -O - https://github.com/intel/media-driver/commit/284750bf.patch | git apply mkdir build && pushd build cmake -DCMAKE_INSTALL_PREFIX=${TARGET_DIR} \ -DENABLE_KERNELS=ON \ @@ -311,7 +311,7 @@ prepare_extra_amd64() { # Vulkan Headers pushd ${SOURCE_DIR} - git clone -b v1.3.240 --depth=1 https://github.com/KhronosGroup/Vulkan-Headers + git clone -b v1.3.240 --depth=1 https://github.com/KhronosGroup/Vulkan-Headers.git pushd Vulkan-Headers mkdir build && pushd build cmake \ @@ -324,7 +324,7 @@ prepare_extra_amd64() { # Vulkan ICD Loader pushd ${SOURCE_DIR} - git clone -b v1.3.240 --depth=1 https://github.com/KhronosGroup/Vulkan-Loader + git clone -b v1.3.240 --depth=1 https://github.com/KhronosGroup/Vulkan-Loader.git pushd Vulkan-Loader mkdir build && pushd build cmake \ @@ -345,7 +345,7 @@ prepare_extra_amd64() { # SHADERC pushd ${SOURCE_DIR} - git clone -b v2023.2 --depth=1 https://github.com/google/shaderc + git clone -b v2023.2 --depth=1 https://github.com/google/shaderc.git pushd shaderc ./utils/git-sync-deps mkdir build && pushd build @@ -372,25 +372,22 @@ prepare_extra_amd64() { if [[ ${LLVM_VER} -ge 11 ]]; then apt-get install -y llvm-${LLVM_VER}-dev libudev-dev pushd ${SOURCE_DIR} - mkdir mesa + git clone https://gitlab.freedesktop.org/mesa/mesa.git pushd mesa - mesa_ver="22.3.5" - mesa_link="https://mesa.freedesktop.org/archive/mesa-${mesa_ver}.tar.xz" - wget ${mesa_link} -O mesa.tar.xz - tar xaf mesa.tar.xz - # reduce encode overhead with optimized buffer types - wget -O - https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20376.patch | git apply - wget -O - https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20989.patch | git apply + git reset --hard "a19a37e8" + # fix av1 main nv12 decoding + wget -q -O - https://gitlab.freedesktop.org/mesa/mesa/-/commit/39c6f1f5.patch | git apply + popd # disable the broken hevc packed header - MESA_VA_PIC="mesa-${mesa_ver}/src/gallium/frontends/va/picture.c" - MESA_VA_CONF="mesa-${mesa_ver}/src/gallium/frontends/va/config.c" + MESA_VA_PIC="mesa/src/gallium/frontends/va/picture.c" + MESA_VA_CONF="mesa/src/gallium/frontends/va/config.c" sed -i 's|handleVAEncPackedHeaderParameterBufferType(context, buf);||g' ${MESA_VA_PIC} sed -i 's|handleVAEncPackedHeaderDataBufferType(context, buf);||g' ${MESA_VA_PIC} sed -i 's|if (u_reduce_video_profile(ProfileToPipe(profile)) == PIPE_VIDEO_FORMAT_HEVC)|if (0)|g' ${MESA_VA_CONF} # force reporting all packed headers are supported sed -i 's|value = VA_ENC_PACKED_HEADER_NONE;|value = 0x0000001f;|g' ${MESA_VA_CONF} sed -i 's|if (attrib_list\[i\].type == VAConfigAttribEncPackedHeaders)|if (0)|g' ${MESA_VA_CONF} - meson setup mesa-${mesa_ver} mesa_build \ + meson setup mesa mesa_build \ --prefix=${TARGET_DIR} \ --libdir=lib \ --buildtype=release \ @@ -398,7 +395,6 @@ prepare_extra_amd64() { -Db_ndebug=true \ -Db_lto=false \ -Dplatforms=x11 \ - -Ddri-drivers=[] \ -Dgallium-drivers=radeonsi \ -Dvulkan-drivers=amd,intel \ -Dvulkan-layers=device-select,overlay \ @@ -441,7 +437,7 @@ prepare_extra_amd64() { # LIBPLACEBO pushd ${SOURCE_DIR} - git clone -b v5.229.2 --recursive --depth=1 https://github.com/haasn/libplacebo + git clone -b v5.229.2 --recursive --depth=1 https://github.com/haasn/libplacebo.git sed -i 's|env: python_env,||g' libplacebo/src/vulkan/meson.build meson setup libplacebo placebo_build \ --prefix=${TARGET_DIR} \