mirror of
https://github.com/jellyfin/jellyfin-ffmpeg.git
synced 2026-09-02 21:03:08 +03:00
Merge pull request #732 from nyanmisaka/fix-build
Update scripts to fix build issues
This commit is contained in:
@@ -3,6 +3,7 @@ FROM $GH_REPO/base:latest
|
||||
|
||||
RUN --mount=src=ct-ng-config,dst=/.config \
|
||||
git clone --filter=blob:none https://github.com/crosstool-ng/crosstool-ng.git /ct-ng && cd /ct-ng && \
|
||||
rm -rf packages/linux/*/chksum && \
|
||||
./bootstrap && \
|
||||
./configure --enable-local && \
|
||||
make -j$(nproc) && \
|
||||
|
||||
@@ -76,7 +76,7 @@ CT_DOWNLOAD_AGENT_WGET=y
|
||||
# CT_DOWNLOAD_AGENT_NONE is not set
|
||||
# CT_FORBID_DOWNLOAD is not set
|
||||
# CT_FORCE_DOWNLOAD is not set
|
||||
CT_CONNECT_TIMEOUT=10
|
||||
CT_CONNECT_TIMEOUT=60
|
||||
CT_DOWNLOAD_WGET_OPTIONS="--passive-ftp --tries=3 -nc --progress=dot:binary"
|
||||
# CT_ONLY_DOWNLOAD is not set
|
||||
# CT_USE_MIRROR is not set
|
||||
@@ -333,7 +333,7 @@ CT_LINUX_V_4_18=y
|
||||
# CT_LINUX_V_3_4 is not set
|
||||
# CT_LINUX_V_3_2 is not set
|
||||
CT_LINUX_VERSION="4.18.20"
|
||||
CT_LINUX_MIRRORS="$(CT_Mirrors kernel.org linux ${CT_LINUX_VERSION})"
|
||||
CT_LINUX_MIRRORS="$(CT_Mirrors kernel.org linux ${CT_LINUX_VERSION}) https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/snapshot"
|
||||
CT_LINUX_ARCHIVE_FILENAME="@{pkg_name}-@{version}"
|
||||
CT_LINUX_ARCHIVE_DIRNAME="@{pkg_name}-@{version}"
|
||||
CT_LINUX_ARCHIVE_FORMATS=".tar.xz .tar.gz"
|
||||
|
||||
@@ -3,6 +3,7 @@ FROM $GH_REPO/base:latest
|
||||
|
||||
RUN --mount=src=ct-ng-config,dst=/.config \
|
||||
git clone --filter=blob:none https://github.com/crosstool-ng/crosstool-ng.git /ct-ng && cd /ct-ng && \
|
||||
rm -rf packages/linux/*/chksum && \
|
||||
./bootstrap && \
|
||||
./configure --enable-local && \
|
||||
make -j$(nproc) && \
|
||||
|
||||
@@ -76,7 +76,7 @@ CT_DOWNLOAD_AGENT_WGET=y
|
||||
# CT_DOWNLOAD_AGENT_NONE is not set
|
||||
# CT_FORBID_DOWNLOAD is not set
|
||||
# CT_FORCE_DOWNLOAD is not set
|
||||
CT_CONNECT_TIMEOUT=10
|
||||
CT_CONNECT_TIMEOUT=60
|
||||
CT_DOWNLOAD_WGET_OPTIONS="--passive-ftp --tries=3 -nc --progress=dot:binary"
|
||||
# CT_ONLY_DOWNLOAD is not set
|
||||
# CT_USE_MIRROR is not set
|
||||
@@ -339,7 +339,7 @@ CT_LINUX_V_4_18=y
|
||||
# CT_LINUX_V_3_12 is not set
|
||||
# CT_LINUX_V_3_10 is not set
|
||||
CT_LINUX_VERSION="4.18.20"
|
||||
CT_LINUX_MIRRORS="$(CT_Mirrors kernel.org linux ${CT_LINUX_VERSION})"
|
||||
CT_LINUX_MIRRORS="$(CT_Mirrors kernel.org linux ${CT_LINUX_VERSION}) https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/snapshot"
|
||||
CT_LINUX_ARCHIVE_FILENAME="@{pkg_name}-@{version}"
|
||||
CT_LINUX_ARCHIVE_DIRNAME="@{pkg_name}-@{version}"
|
||||
CT_LINUX_ARCHIVE_FORMATS=".tar.xz .tar.gz"
|
||||
|
||||
@@ -40,11 +40,13 @@ ffbuild_dockerbuild() {
|
||||
)
|
||||
elif [[ $TARGET == linux64 ]]; then
|
||||
myconf+=(
|
||||
--openssldir=/etc/ssl
|
||||
--cross-compile-prefix="$FFBUILD_CROSS_PREFIX"
|
||||
linux-x86_64
|
||||
)
|
||||
elif [[ $TARGET == linuxarm64 ]]; then
|
||||
myconf+=(
|
||||
--openssldir=/etc/ssl
|
||||
--cross-compile-prefix="$FFBUILD_CROSS_PREFIX"
|
||||
linux-aarch64
|
||||
)
|
||||
|
||||
@@ -31,7 +31,7 @@ ffbuild_dockerbuild() {
|
||||
fi
|
||||
|
||||
export CFLAGS="$RAW_CFLAGS"
|
||||
export LDFLAFS="$RAW_LDFLAGS"
|
||||
export LDFLAGS="$RAW_LDFLAGS"
|
||||
|
||||
./configure "${myconf[@]}"
|
||||
make -j$(nproc)
|
||||
|
||||
@@ -32,7 +32,7 @@ ffbuild_dockerbuild() {
|
||||
fi
|
||||
|
||||
export CFLAGS="$RAW_CFLAGS"
|
||||
export LDFLAFS="$RAW_LDFLAGS"
|
||||
export LDFLAGS="$RAW_LDFLAGS"
|
||||
|
||||
./configure "${myconf[@]}"
|
||||
make -j$(nproc)
|
||||
|
||||
@@ -43,7 +43,7 @@ ffbuild_dockerbuild() {
|
||||
fi
|
||||
|
||||
export CFLAGS="$RAW_CFLAGS"
|
||||
export LDFLAFS="$RAW_LDFLAGS"
|
||||
export LDFLAGS="$RAW_LDFLAGS"
|
||||
|
||||
./configure "${myconf[@]}"
|
||||
make -j$(nproc)
|
||||
|
||||
@@ -41,7 +41,7 @@ ffbuild_dockerbuild() {
|
||||
fi
|
||||
|
||||
export CFLAGS="$RAW_CFLAGS -D_GNU_SOURCE"
|
||||
export LDFLAFS="$RAW_LDFLAGS"
|
||||
export LDFLAGS="$RAW_LDFLAGS"
|
||||
|
||||
./configure "${myconf[@]}"
|
||||
make -j$(nproc)
|
||||
|
||||
@@ -31,7 +31,7 @@ ffbuild_dockerbuild() {
|
||||
fi
|
||||
|
||||
export CFLAGS="$RAW_CFLAGS"
|
||||
export LDFLAFS="$RAW_LDFLAGS"
|
||||
export LDFLAGS="$RAW_LDFLAGS"
|
||||
|
||||
./configure "${myconf[@]}"
|
||||
make -j$(nproc)
|
||||
|
||||
@@ -37,7 +37,7 @@ ffbuild_dockerbuild() {
|
||||
fi
|
||||
|
||||
export CFLAGS="$RAW_CFLAGS"
|
||||
export LDFLAFS="$RAW_LDFLAGS"
|
||||
export LDFLAGS="$RAW_LDFLAGS"
|
||||
|
||||
./configure "${myconf[@]}"
|
||||
make -j$(nproc)
|
||||
|
||||
@@ -37,7 +37,7 @@ ffbuild_dockerbuild() {
|
||||
fi
|
||||
|
||||
export CFLAGS="$RAW_CFLAGS"
|
||||
export LDFLAFS="$RAW_LDFLAGS"
|
||||
export LDFLAGS="$RAW_LDFLAGS"
|
||||
|
||||
./configure "${myconf[@]}"
|
||||
make -j$(nproc)
|
||||
|
||||
@@ -37,7 +37,7 @@ ffbuild_dockerbuild() {
|
||||
fi
|
||||
|
||||
export CFLAGS="$RAW_CFLAGS"
|
||||
export LDFLAFS="$RAW_LDFLAGS"
|
||||
export LDFLAGS="$RAW_LDFLAGS"
|
||||
|
||||
./configure "${myconf[@]}"
|
||||
make -j$(nproc)
|
||||
|
||||
@@ -37,7 +37,7 @@ ffbuild_dockerbuild() {
|
||||
fi
|
||||
|
||||
export CFLAGS="$RAW_CFLAGS"
|
||||
export LDFLAFS="$RAW_LDFLAGS"
|
||||
export LDFLAGS="$RAW_LDFLAGS"
|
||||
|
||||
./configure "${myconf[@]}"
|
||||
make -j$(nproc)
|
||||
|
||||
@@ -37,7 +37,7 @@ ffbuild_dockerbuild() {
|
||||
fi
|
||||
|
||||
export CFLAGS="$RAW_CFLAGS"
|
||||
export LDFLAFS="$RAW_LDFLAGS"
|
||||
export LDFLAGS="$RAW_LDFLAGS"
|
||||
|
||||
./configure "${myconf[@]}"
|
||||
make -j$(nproc)
|
||||
|
||||
@@ -31,7 +31,7 @@ ffbuild_dockerbuild() {
|
||||
fi
|
||||
|
||||
export CFLAGS="$RAW_CFLAGS"
|
||||
export LDFLAFS="$RAW_LDFLAGS"
|
||||
export LDFLAGS="$RAW_LDFLAGS"
|
||||
|
||||
./configure "${myconf[@]}"
|
||||
make -j$(nproc)
|
||||
|
||||
@@ -37,7 +37,7 @@ ffbuild_dockerbuild() {
|
||||
fi
|
||||
|
||||
export CFLAGS="$RAW_CFLAGS"
|
||||
export LDFLAFS="$RAW_LDFLAGS"
|
||||
export LDFLAGS="$RAW_LDFLAGS"
|
||||
|
||||
./configure "${myconf[@]}"
|
||||
make -j$(nproc)
|
||||
|
||||
@@ -38,7 +38,7 @@ ffbuild_dockerbuild() {
|
||||
fi
|
||||
|
||||
export CFLAGS="$RAW_CFLAGS"
|
||||
export LDFLAFS="$RAW_LDFLAGS"
|
||||
export LDFLAGS="$RAW_LDFLAGS"
|
||||
|
||||
./configure "${myconf[@]}"
|
||||
make -j$(nproc)
|
||||
|
||||
@@ -31,7 +31,7 @@ ffbuild_dockerbuild() {
|
||||
fi
|
||||
|
||||
export CFLAGS="$RAW_CFLAGS"
|
||||
export LDFLAFS="$RAW_LDFLAGS"
|
||||
export LDFLAGS="$RAW_LDFLAGS"
|
||||
|
||||
meson setup "${myconf[@]}" ..
|
||||
ninja -j$(nproc)
|
||||
|
||||
@@ -40,7 +40,7 @@ ffbuild_dockerbuild() {
|
||||
fi
|
||||
|
||||
export CFLAGS="$RAW_CFLAGS"
|
||||
export LDFLAFS="$RAW_LDFLAGS"
|
||||
export LDFLAGS="$RAW_LDFLAGS"
|
||||
|
||||
meson "${myconf[@]}" ..
|
||||
ninja -j$(nproc)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
SCRIPT_REPO="https://github.com/intel/libva.git"
|
||||
SCRIPT_COMMIT="dbf83dc3b1ce6bad46e1628aaf2da5ef731157b8"
|
||||
SCRIPT_COMMIT="add80723247b8031fb8de14d8f599923d3759242"
|
||||
|
||||
ffbuild_enabled() {
|
||||
[[ $TARGET != linux* ]] && return -1
|
||||
@@ -57,7 +57,7 @@ ffbuild_dockerbuild() {
|
||||
fi
|
||||
|
||||
export CFLAGS="$RAW_CFLAGS"
|
||||
export LDFLAFS="$RAW_LDFLAGS"
|
||||
export LDFLAGS="$RAW_LDFLAGS"
|
||||
|
||||
meson setup "${myconf[@]}" ..
|
||||
ninja -j$(nproc)
|
||||
|
||||
+10
-4
@@ -3563,7 +3563,7 @@ Index: FFmpeg/libavcodec/rkmppenc.c
|
||||
+ av_log(avctx, AV_LOG_ERROR, "ff_get_encode_buffer failed: %d\n", ret);
|
||||
+ goto exit;
|
||||
+ }
|
||||
+ memcpy(packet->data, mpp_packet_get_data(mpp_pkt), mpp_pkt_length);
|
||||
+ memcpy(packet->data, mpp_packet_get_pos(mpp_pkt), mpp_pkt_length);
|
||||
+ }
|
||||
|
||||
- int64_t pts = mpp_packet_get_pts(packet);
|
||||
@@ -4489,7 +4489,7 @@ Index: FFmpeg/libavfilter/rkrga_common.c
|
||||
===================================================================
|
||||
--- /dev/null
|
||||
+++ FFmpeg/libavfilter/rkrga_common.c
|
||||
@@ -0,0 +1,1447 @@
|
||||
@@ -0,0 +1,1453 @@
|
||||
+/*
|
||||
+ * Copyright (c) 2023 NyanMisaka
|
||||
+ *
|
||||
@@ -5361,8 +5361,14 @@ Index: FFmpeg/libavfilter/rkrga_common.c
|
||||
+ if (!src || !dst)
|
||||
+ return AVERROR(EINVAL);
|
||||
+
|
||||
+ scale_ratio_w = (float)dst->act_w / (float)src->act_w;
|
||||
+ scale_ratio_h = (float)dst->act_h / (float)src->act_h;
|
||||
+ if ((src->rotate_mode & 0x04) == 0x04 /* HAL_TRANSFORM_ROT_90 */ ||
|
||||
+ (src->rotate_mode & 0x07) == 0x07 /* HAL_TRANSFORM_ROT_270 */) {
|
||||
+ scale_ratio_w = (float)dst->act_h / (float)src->act_w;
|
||||
+ scale_ratio_h = (float)dst->act_w / (float)src->act_h;
|
||||
+ } else {
|
||||
+ scale_ratio_w = (float)dst->act_w / (float)src->act_w;
|
||||
+ scale_ratio_h = (float)dst->act_h / (float)src->act_h;
|
||||
+ }
|
||||
+
|
||||
+ /* P010 requires RGA3 */
|
||||
+ if (!r->has_rga3 &&
|
||||
|
||||
+3
-3
@@ -352,7 +352,7 @@ prepare_extra_amd64() {
|
||||
|
||||
# LIBVA
|
||||
pushd ${SOURCE_DIR}
|
||||
git clone -b 2.23.0 --depth=1 https://github.com/intel/libva.git
|
||||
git clone -b 2.24.0 --depth=1 https://github.com/intel/libva.git
|
||||
pushd libva
|
||||
sed -i 's|secure_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|secure_getenv("LIBVA_DRIVER_NAME")|secure_getenv("LIBVA_DRIVER_NAME_JELLYFIN")|g' va/va.c
|
||||
@@ -454,7 +454,7 @@ prepare_extra_amd64() {
|
||||
# VPL-GPU-RT (RT only)
|
||||
# Provides VPL runtime (libmfx-gen.so.1.2) for 11th Gen Tiger Lake and newer
|
||||
pushd ${SOURCE_DIR}
|
||||
git clone -b intel-onevpl-26.2.3 --depth=1 https://github.com/intel/vpl-gpu-rt.git
|
||||
git clone -b intel-onevpl-26.2.4 --depth=1 https://github.com/intel/vpl-gpu-rt.git
|
||||
pushd vpl-gpu-rt
|
||||
# Fix missing entries in PicStruct validation
|
||||
wget -q -O - https://github.com/intel/vpl-gpu-rt/commit/c7eb030.patch | git apply
|
||||
@@ -476,7 +476,7 @@ 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-26.2.3 --depth=1 https://github.com/intel/media-driver.git
|
||||
git clone -b intel-media-26.2.4 --depth=1 https://github.com/intel/media-driver.git
|
||||
pushd media-driver
|
||||
# Enable VC1 decode on DG2 (note that MTL+ is not supported)
|
||||
wget -q -O - https://github.com/intel/media-driver/commit/e47702f.patch | git apply
|
||||
|
||||
@@ -20,14 +20,18 @@ makedepends=("${MINGW_PACKAGE_PREFIX}-cc"
|
||||
"${MINGW_PACKAGE_PREFIX}-cmake"
|
||||
"${MINGW_PACKAGE_PREFIX}-ninja"
|
||||
"${MINGW_PACKAGE_PREFIX}-python")
|
||||
source=("https://github.com/google/shaderc/archive/v${pkgver}/${_realname}-${pkgver}.tar.gz")
|
||||
source=("${_realname}"::"git+https://github.com/google/${_realname}.git#tag=v${pkgver}")
|
||||
sha256sums=('SKIP')
|
||||
|
||||
export MINGW_TOOLCHAIN_PREFIX="${MINGW_PREFIX}"
|
||||
export FF_MINGW_PREFIX="${MINGW_TOOLCHAIN_PREFIX}/ffbuild"
|
||||
|
||||
prepare() {
|
||||
cd "${srcdir}/${_realname}-${pkgver}"
|
||||
cd "${srcdir}/${_realname}"
|
||||
|
||||
# Fixup "IS NOT TOP-LEVEL GIT DIRECTORY" on Windows
|
||||
sed -i 's/def is_git_toplevel(git, directory):/&\n return True/' utils/git-sync-deps
|
||||
|
||||
./utils/git-sync-deps || return 1
|
||||
}
|
||||
|
||||
@@ -44,7 +48,7 @@ build() {
|
||||
MSYS2_ARG_CONV_EXCL="-DCMAKE_INSTALL_PREFIX=" \
|
||||
${MINGW_TOOLCHAIN_PREFIX}/bin/cmake.exe \
|
||||
-GNinja \
|
||||
-DCMAKE_INSTALL_PREFIX=${FF_MINGW_PREFIX} \
|
||||
-DCMAKE_INSTALL_PREFIX="${FF_MINGW_PREFIX}" \
|
||||
"${_extra_config[@]}" \
|
||||
-DBUILD_SHARED_LIBS=OFF \
|
||||
-DENABLE_GLSLANG_BINARIES=ON \
|
||||
@@ -54,7 +58,7 @@ build() {
|
||||
-DSHADERC_SKIP_COPYRIGHT_CHECK=ON \
|
||||
-DSHADERC_ENABLE_WERROR_COMPILE=OFF \
|
||||
-DPython_EXECUTABLE="${MINGW_TOOLCHAIN_PREFIX}/bin/python.exe" \
|
||||
../${_realname}-${pkgver}
|
||||
"../${_realname}"
|
||||
|
||||
${MINGW_TOOLCHAIN_PREFIX}/bin/cmake.exe --build ./
|
||||
}
|
||||
@@ -76,6 +80,6 @@ package() {
|
||||
cp shaderc_combined.pc shaderc.pc
|
||||
popd
|
||||
|
||||
install -Dm644 "${srcdir}/${_realname}-${pkgver}/LICENSE" \
|
||||
install -Dm644 "${srcdir}/${_realname}/LICENSE" \
|
||||
"${pkgdir}${FF_MINGW_PREFIX}/share/licenses/${_realname}/LICENSE"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user