2019-02-23 22:01:55 -05:00
#!/bin/bash
# Builds the DEB inside the Docker container
set -o errexit
set -o xtrace
2022-10-02 00:30:06 +08:00
DEBIAN_ADDR = http://deb.debian.org/debian/
2025-06-02 15:52:52 +08:00
UBUNTU_ARCHIVE_ADDR = http://mirrors.kernel.org/ubuntu/ # http://archive.ubuntu.com/ubuntu/
2024-01-29 11:44:49 +08:00
UBUNTU_PORTS_ADDR = http://ports.ubuntu.com/ubuntu-ports/
2020-04-09 13:19:31 +08:00
2025-05-08 01:37:32 +08:00
# Prepare common extra libs for amd64 and arm64
2020-10-25 02:51:00 +08:00
prepare_extra_common() {
2022-05-27 03:36:12 +08:00
case ${ ARCH } in
'amd64' )
2024-04-21 14:24:00 +08:00
CROSS_PREFIX_OPT = ""
2022-05-27 03:36:12 +08:00
CROSS_OPT = ""
CMAKE_TOOLCHAIN_OPT = ""
MESON_CROSS_OPT = ""
;;
'arm64' )
2024-04-21 14:24:00 +08:00
CROSS_PREFIX_OPT = "aarch64-linux-gnu-"
2022-05-27 03:36:12 +08:00
CROSS_OPT = "--host=aarch64-linux-gnu CC=aarch64-linux-gnu-gcc CXX=aarch64-linux-gnu-g++"
CMAKE_TOOLCHAIN_OPT = "-DCMAKE_TOOLCHAIN_FILE= ${ SOURCE_DIR } /toolchain- ${ ARCH } .cmake"
MESON_CROSS_OPT = "--cross-file= ${ SOURCE_DIR } /cross- ${ ARCH } .meson"
;;
esac
2024-04-21 14:24:00 +08:00
# ICONV
pushd ${ SOURCE_DIR }
mkdir iconv
pushd iconv
2025-01-20 03:05:24 +08:00
iconv_ver = "1.18"
2024-06-29 06:22:29 +08:00
iconv_link = "https://mirrors.kernel.org/gnu/libiconv/libiconv- ${ iconv_ver } .tar.gz"
2024-04-21 14:24:00 +08:00
wget ${ iconv_link } -O iconv.tar.gz
tar xaf iconv.tar.gz
pushd libiconv-${ iconv_ver }
./configure \
${ CROSS_OPT } \
--prefix= ${ TARGET_DIR } \
--disable-static \
--enable-{ shared,extra-encodings} \
--with-pic
make -j$( nproc) && make install && make install DESTDIR = ${ SOURCE_DIR } /iconv
echo "iconv ${ TARGET_DIR } /lib/libiconv.so* usr/lib/jellyfin-ffmpeg/lib" >> ${ DPKG_INSTALL_LIST }
popd
popd
popd
# ZLIB
pushd ${ SOURCE_DIR }
git clone -b v1.3.1 --depth= 1 https://github.com/madler/zlib.git
pushd zlib
CROSS_PREFIX = ${ CROSS_PREFIX_OPT } ./configure \
--prefix= ${ TARGET_DIR } \
--shared
make -j$( nproc) && make install && make install DESTDIR = ${ SOURCE_DIR } /zlib
echo "zlib ${ TARGET_DIR } /lib/libz.so* usr/lib/jellyfin-ffmpeg/lib" >> ${ DPKG_INSTALL_LIST }
popd
popd
# LIBXML2
pushd ${ SOURCE_DIR }
2025-05-28 23:33:29 +08:00
libxml2_ver = "v2.14.3"
2024-07-24 22:33:56 +08:00
git clone -b ${ libxml2_ver } --depth= 1 https://github.com/GNOME/libxml2.git
2024-04-21 14:24:00 +08:00
pushd libxml2
./autogen.sh \
${ CROSS_OPT } \
--prefix= ${ TARGET_DIR } \
--disable-{ static,maintainer-mode} \
--enable-shared \
--without-python
make -j$( nproc) && make install && make install DESTDIR = ${ SOURCE_DIR } /libxml2
echo "libxml2 ${ TARGET_DIR } /lib/libxml2.so* usr/lib/jellyfin-ffmpeg/lib" >> ${ DPKG_INSTALL_LIST }
popd
popd
# FREETYPE
pushd ${ SOURCE_DIR }
2025-04-17 17:15:59 +08:00
git clone -b VER-2-13-3 --depth= 1 https://github.com/freetype/freetype.git
2024-04-21 14:24:00 +08:00
pushd freetype
./autogen.sh
./configure \
${ CROSS_OPT } \
--prefix= ${ TARGET_DIR } \
--enable-shared \
--disable-static
make -j$( nproc) && make install && make install DESTDIR = ${ SOURCE_DIR } /freetype
echo "freetype ${ TARGET_DIR } /lib/libfreetype.so* usr/lib/jellyfin-ffmpeg/lib" >> ${ DPKG_INSTALL_LIST }
popd
popd
# FRIBIDI
pushd ${ SOURCE_DIR }
2024-09-28 17:58:57 +08:00
git clone -b v1.0.16 --depth= 1 https://github.com/fribidi/fribidi.git
2024-04-21 14:24:00 +08:00
meson setup fribidi fribidi_build \
${ MESON_CROSS_OPT } \
--prefix= ${ TARGET_DIR } \
--libdir= lib \
--buildtype= release \
--default-library= shared \
-D{ bin,docs,tests}= false
meson configure fribidi_build
2024-07-24 22:33:56 +08:00
ninja -j$( nproc) -C fribidi_build install
2024-04-21 14:24:00 +08:00
cp -a ${ TARGET_DIR } /lib/libfribidi.so* ${ SOURCE_DIR } /fribidi
2024-07-24 22:33:56 +08:00
echo "fribidi/libfribidi.so* usr/lib/jellyfin-ffmpeg/lib" >> ${ DPKG_INSTALL_LIST }
2024-04-21 14:24:00 +08:00
popd
# FONTCONFIG
pushd ${ SOURCE_DIR }
mkdir fontconfig
pushd fontconfig
2025-01-20 03:05:24 +08:00
fc_ver = "2.16.0"
2024-04-21 14:24:00 +08:00
fc_link = "https://www.freedesktop.org/software/fontconfig/release/fontconfig- ${ fc_ver } .tar.xz"
wget ${ fc_link } -O fc.tar.gz
tar xaf fc.tar.gz
pushd fontconfig-${ fc_ver }
./configure \
${ CROSS_OPT } \
--prefix= ${ TARGET_DIR } \
--sysconfdir= /etc \
--localstatedir= /var \
--disable-{ static,docs} \
--enable-{ shared,libxml2,iconv}
make -j$( nproc) && make install && make install DESTDIR = ${ SOURCE_DIR } /fontconfig
echo "fontconfig ${ TARGET_DIR } /lib/libfontconfig.so* usr/lib/jellyfin-ffmpeg/lib" >> ${ DPKG_INSTALL_LIST }
popd
popd
popd
# HARFBUZZ
pushd ${ SOURCE_DIR }
2025-04-17 17:15:59 +08:00
git clone -b 10.4.0 --depth= 1 https://github.com/harfbuzz/harfbuzz.git
2024-07-24 22:33:56 +08:00
meson setup harfbuzz harfbuzz_build \
${ MESON_CROSS_OPT } \
2024-04-21 14:24:00 +08:00
--prefix= ${ TARGET_DIR } \
2024-07-24 22:33:56 +08:00
--libdir= lib \
--buildtype= release \
--default-library= shared \
-Dfreetype= enabled \
-D{ glib,gobject,cairo,chafa,icu}= disabled \
-D{ tests,introspection,docs,utilities}= disabled
meson configure harfbuzz_build
ninja -j$( nproc) -C harfbuzz_build install
cp -a ${ TARGET_DIR } /lib/libharfbuzz.so* ${ SOURCE_DIR } /harfbuzz
echo "harfbuzz/libharfbuzz.so* usr/lib/jellyfin-ffmpeg/lib" >> ${ DPKG_INSTALL_LIST }
2024-04-21 14:24:00 +08:00
popd
2025-05-24 02:53:36 +08:00
# UNIBREAK
pushd ${ SOURCE_DIR }
git clone --depth= 1 https://github.com/adah1972/libunibreak.git
pushd libunibreak
./bootstrap
./configure \
${ CROSS_OPT } \
--prefix= ${ TARGET_DIR } \
--enable-shared \
--disable-static \
--with-pic
make -j$( nproc) && make install && make install DESTDIR = ${ SOURCE_DIR } /libunibreak
echo "libunibreak ${ TARGET_DIR } /lib/libunibreak.so* usr/lib/jellyfin-ffmpeg/lib" >> ${ DPKG_INSTALL_LIST }
popd
popd
2024-04-21 14:24:00 +08:00
# LIBASS
pushd ${ SOURCE_DIR }
2024-07-24 22:33:56 +08:00
git clone -b 0.17.3 --depth= 1 https://github.com/libass/libass.git
2024-04-21 14:24:00 +08:00
pushd libass
./autogen.sh
./configure \
${ CROSS_OPT } \
--prefix= ${ TARGET_DIR } \
--disable-static \
2025-05-24 02:53:36 +08:00
--enable-{ shared,libunibreak} \
2024-04-21 14:24:00 +08:00
--with-pic
make -j$( nproc) && make install && make install DESTDIR = ${ SOURCE_DIR } /libass
echo "libass ${ TARGET_DIR } /lib/libass.so* usr/lib/jellyfin-ffmpeg/lib" >> ${ DPKG_INSTALL_LIST }
popd
popd
2022-05-27 03:36:12 +08:00
# FFTW3
pushd ${ SOURCE_DIR }
mkdir fftw3
pushd fftw3
fftw3_ver = "3.3.10"
fftw3_link = "https://fftw.org/fftw- ${ fftw3_ver } .tar.gz"
wget ${ fftw3_link } -O fftw3.tar.gz
tar xaf fftw3.tar.gz
pushd fftw-${ fftw3_ver }
if [ " ${ ARCH } " = "amd64" ] ; then
fftw3_optimizations = "--enable-sse2 --enable-avx --enable-avx-128-fma --enable-avx2 --enable-avx512"
else
2022-06-23 19:21:05 +08:00
fftw3_optimizations = "--enable-neon"
2022-05-27 03:36:12 +08:00
fi
./configure \
${ CROSS_OPT } \
--prefix= ${ TARGET_DIR } \
--disable-{ static,doc} \
2022-06-23 19:21:05 +08:00
--enable-{ shared,single,threads,fortran} \
2022-05-27 03:36:12 +08:00
$fftw3_optimizations \
--with-our-malloc \
--with-combined-threads \
--with-incoming-stack-boundary= 2
make -j$( nproc) && make install && make install DESTDIR = ${ SOURCE_DIR } /fftw3
2022-06-23 19:21:05 +08:00
echo "fftw3 ${ TARGET_DIR } /lib/libfftw3f.so* usr/lib/jellyfin-ffmpeg/lib" >> ${ DPKG_INSTALL_LIST }
2022-05-27 03:36:12 +08:00
popd
popd
popd
# CHROMAPRINT
pushd ${ SOURCE_DIR }
git clone --depth= 1 https://github.com/acoustid/chromaprint.git
pushd chromaprint
2023-03-04 06:46:34 +08:00
echo "Libs.private: -lfftw3f -lstdc++" >> libchromaprint.pc.cmake
echo "Cflags.private: -DCHROMAPRINT_NODLL" >> libchromaprint.pc.cmake
2022-05-27 03:36:12 +08:00
mkdir build
pushd build
cmake \
${ CMAKE_TOOLCHAIN_OPT } \
-DCMAKE_INSTALL_PREFIX= ${ TARGET_DIR } \
-DCMAKE_BUILD_TYPE= Release \
-DBUILD_SHARED_LIBS= ON \
-DBUILD_{ TOOLS,TESTS}= OFF \
2022-06-23 19:21:05 +08:00
-DFFT_LIB= fftw3f \
2022-05-27 03:36:12 +08:00
..
make -j$( nproc) && make install && make install DESTDIR = ${ SOURCE_DIR } /chromaprint
echo "chromaprint ${ TARGET_DIR } /lib/libchromaprint.so* usr/lib/jellyfin-ffmpeg/lib" >> ${ DPKG_INSTALL_LIST }
popd
popd
popd
2022-05-02 00:53:56 +08:00
# ZIMG
2020-12-02 20:13:25 +08:00
pushd ${ SOURCE_DIR }
2023-03-04 06:46:34 +08:00
git clone --recursive --depth= 1 https://github.com/sekrit-twc/zimg.git
2020-12-02 20:13:25 +08:00
pushd zimg
./autogen.sh
./configure --prefix= ${ TARGET_DIR } ${ CROSS_OPT }
make -j $( nproc) && make install && make install DESTDIR = ${ SOURCE_DIR } /zimg
2022-05-05 03:34:33 +08:00
echo "zimg ${ TARGET_DIR } /lib/libzimg.so* usr/lib/jellyfin-ffmpeg/lib" >> ${ DPKG_INSTALL_LIST }
2020-12-02 20:13:25 +08:00
popd
popd
2022-05-02 00:53:56 +08:00
# DAV1D
2020-10-25 02:51:00 +08:00
pushd ${ SOURCE_DIR }
2025-02-12 01:10:22 +08:00
git clone -b 1.5.1 --depth= 1 https://code.videolan.org/videolan/dav1d.git
2022-05-27 03:36:12 +08:00
meson setup dav1d dav1d_build \
${ MESON_CROSS_OPT } \
--prefix= ${ TARGET_DIR } \
--libdir= lib \
--buildtype= release \
-Ddefault_library= shared \
2024-07-24 22:33:56 +08:00
-Denable_asm= true \
2022-05-27 03:36:12 +08:00
-Denable_{ tools,tests,examples}= false
meson configure dav1d_build
2024-07-24 22:33:56 +08:00
ninja -j$( nproc) -C dav1d_build install
2023-02-21 13:03:24 +08:00
cp -a ${ TARGET_DIR } /lib/libdav1d.so* ${ SOURCE_DIR } /dav1d
2024-07-24 22:33:56 +08:00
echo "dav1d/libdav1d.so* usr/lib/jellyfin-ffmpeg/lib" >> ${ DPKG_INSTALL_LIST }
2020-10-25 02:51:00 +08:00
popd
2022-04-20 21:58:23 +02:00
2024-01-29 11:44:49 +08:00
# SVT-AV1
pushd ${ SOURCE_DIR }
2025-04-17 17:15:59 +08:00
git clone -b v3.0.2 --depth= 1 https://gitlab.com/AOMediaCodec/SVT-AV1.git
2024-01-29 11:44:49 +08:00
pushd SVT-AV1
mkdir build
pushd build
cmake \
${ CMAKE_TOOLCHAIN_OPT } \
-DCMAKE_INSTALL_PREFIX= ${ TARGET_DIR } \
-DCMAKE_BUILD_TYPE= Release \
-DBUILD_SHARED_LIBS= ON \
-DBUILD_{ TESTING,APPS,DEC}= OFF \
..
make -j$( nproc) && make install && make install DESTDIR = ${ SOURCE_DIR } /SVT-AV1
echo "SVT-AV1 ${ TARGET_DIR } /lib/libSvtAv1Enc.so* usr/lib/jellyfin-ffmpeg/lib" >> ${ DPKG_INSTALL_LIST }
popd
popd
2022-05-02 00:53:56 +08:00
# FDK-AAC-STRIPPED
2022-04-20 21:58:23 +02:00
pushd ${ SOURCE_DIR }
2025-04-17 17:15:59 +08:00
mkdir fdk-aac-stripped
2022-04-20 21:58:23 +02:00
pushd fdk-aac-stripped
2025-04-17 17:15:59 +08:00
fdk_aac_ver = "stripped4"
fdk_aac_link = "https://gitlab.freedesktop.org/wtaymans/fdk-aac-stripped/-/archive/ ${ fdk_aac_ver } /fdk-aac-stripped- ${ fdk_aac_ver } .tar.gz"
wget ${ fdk_aac_link } -O fdk-aac-stripped.tar.gz
tar xaf fdk-aac-stripped.tar.gz
pushd fdk-aac-stripped-${ fdk_aac_ver }
2022-04-20 21:58:23 +02:00
./autogen.sh
2022-05-02 00:53:56 +08:00
./configure \
--disable-{ static,silent-rules} \
--prefix= ${ TARGET_DIR } CFLAGS = "-O3 -DNDEBUG" CXXFLAGS = "-O3 -DNDEBUG" ${ CROSS_OPT }
2022-04-20 21:58:23 +02:00
make -j$( nproc) && make install && make install DESTDIR = ${ SOURCE_DIR } /fdk-aac-stripped
2022-05-05 03:34:33 +08:00
echo "fdk-aac-stripped ${ TARGET_DIR } /lib/libfdk-aac.so* usr/lib/jellyfin-ffmpeg/lib" >> ${ DPKG_INSTALL_LIST }
2022-04-20 21:58:23 +02:00
popd
popd
2025-04-17 17:15:59 +08:00
popd
2020-10-25 02:51:00 +08:00
2022-05-02 00:53:56 +08:00
# FFNVCODEC
2020-10-24 16:28:18 +08:00
pushd ${ SOURCE_DIR }
2024-02-12 02:09:42 +08:00
git clone -b n12.0.16.1 --depth= 1 https://github.com/FFmpeg/nv-codec-headers.git
2020-10-24 16:28:18 +08:00
pushd nv-codec-headers
2025-02-11 19:59:58 +08:00
make PREFIX = ${ TARGET_DIR } install
2020-10-24 16:28:18 +08:00
popd
popd
2025-02-11 19:59:58 +08:00
}
2020-06-17 20:41:48 -05:00
2025-02-11 19:59:58 +08:00
# Prepare extra headers, libs and drivers for x86_64-linux-gnu
prepare_extra_amd64() {
2022-05-02 00:53:56 +08:00
# AMF
2020-04-09 13:19:31 +08:00
# https://www.ffmpeg.org/general.html#AMD-AMF_002fVCE
2024-07-24 22:33:56 +08:00
pushd ${ SOURCE_DIR }
mkdir amf-headers
pushd amf-headers
2025-05-01 03:10:01 +08:00
amf_ver = "1.4.36"
2024-10-16 18:12:45 +08:00
amf_link = "https://github.com/GPUOpen-LibrariesAndSDKs/AMF/releases/download/v ${ amf_ver } /AMF-headers-v ${ amf_ver } .tar.gz"
2024-07-24 22:33:56 +08:00
wget ${ amf_link } -O amf.tar.gz
tar xaf amf.tar.gz
2024-10-16 18:12:45 +08:00
pushd amf-headers-v${ amf_ver } /AMF
2020-04-09 13:19:31 +08:00
mkdir -p /usr/include/AMF
mv * /usr/include/AMF
popd
2024-07-24 22:33:56 +08:00
popd
popd
2020-04-09 13:19:31 +08:00
2022-05-02 00:53:56 +08:00
# LIBDRM
pushd ${ SOURCE_DIR }
2022-06-14 01:07:05 +08:00
mkdir libdrm
pushd libdrm
2024-12-14 18:32:10 +08:00
libdrm_ver = "2.4.124"
2022-06-14 01:07:05 +08:00
libdrm_link = "https://dri.freedesktop.org/libdrm/libdrm- ${ libdrm_ver } .tar.xz"
wget ${ libdrm_link } -O libdrm.tar.xz
tar xaf libdrm.tar.xz
meson setup libdrm-${ libdrm_ver } drm_build \
2022-05-02 00:53:56 +08:00
--prefix= ${ TARGET_DIR } \
--libdir= lib \
--buildtype= release \
2022-09-02 17:47:45 +08:00
-D{ udev,tests,install-test-programs}= false \
-D{ amdgpu,radeon,intel}= enabled \
-D{ valgrind,freedreno,vc4,vmwgfx,nouveau,man-pages}= disabled
2022-05-02 00:53:56 +08:00
meson configure drm_build
2024-07-24 22:33:56 +08:00
ninja -j$( nproc) -C drm_build install
2023-02-21 13:03:24 +08:00
cp -a ${ TARGET_DIR } /lib/libdrm*.so* ${ SOURCE_DIR } /libdrm
2022-06-14 01:07:05 +08:00
cp ${ TARGET_DIR } /share/libdrm/*.ids ${ SOURCE_DIR } /libdrm
echo "libdrm/libdrm*.so* usr/lib/jellyfin-ffmpeg/lib" >> ${ DPKG_INSTALL_LIST }
echo "libdrm/*.ids usr/lib/jellyfin-ffmpeg/share/libdrm" >> ${ DPKG_INSTALL_LIST }
popd
2022-05-02 00:53:56 +08:00
popd
# LIBVA
2020-04-09 13:19:31 +08:00
pushd ${ SOURCE_DIR }
2024-07-24 22:33:56 +08:00
git clone -b 2.22.0 --depth= 1 https://github.com/intel/libva.git
2020-04-09 13:19:31 +08:00
pushd libva
2023-08-05 02:12:35 +08:00
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
2020-04-09 13:19:31 +08:00
./autogen.sh
2022-05-02 00:53:56 +08:00
./configure \
--prefix= ${ TARGET_DIR } \
--enable-drm \
--disable-{ glx,x11,wayland,docs}
2020-04-09 13:19:31 +08:00
make -j$( nproc) && make install && make install DESTDIR = ${ SOURCE_DIR } /intel
2022-05-05 03:34:33 +08:00
echo "intel ${ TARGET_DIR } /lib/libva.so* usr/lib/jellyfin-ffmpeg/lib" >> ${ DPKG_INSTALL_LIST }
echo "intel ${ TARGET_DIR } /lib/libva-drm.so* usr/lib/jellyfin-ffmpeg/lib" >> ${ DPKG_INSTALL_LIST }
2020-04-09 13:19:31 +08:00
popd
popd
2022-05-02 00:53:56 +08:00
# LIBVA-UTILS
2022-02-25 16:48:43 +01:00
pushd ${ SOURCE_DIR }
2024-07-24 22:33:56 +08:00
git clone -b 2.22.0 --depth= 1 https://github.com/intel/libva-utils.git
2022-02-25 16:48:43 +01:00
pushd libva-utils
./autogen.sh
./configure --prefix= ${ TARGET_DIR }
make -j$( nproc) && make install && make install DESTDIR = ${ SOURCE_DIR } /intel
2022-05-05 03:34:33 +08:00
echo "intel ${ TARGET_DIR } /bin/vainfo usr/lib/jellyfin-ffmpeg" >> ${ DPKG_INSTALL_LIST }
2022-02-25 16:48:43 +01:00
popd
popd
2022-05-02 00:53:56 +08:00
# INTEL-VAAPI-DRIVER
2020-04-09 13:19:31 +08:00
pushd ${ SOURCE_DIR }
2023-03-04 06:46:34 +08:00
git clone --depth= 1 https://github.com/intel/intel-vaapi-driver.git
2020-04-09 13:19:31 +08:00
pushd intel-vaapi-driver
./autogen.sh
./configure LIBVA_DRIVERS_PATH = ${ TARGET_DIR } /lib/dri
make -j$( nproc) && make install
mkdir -p ${ SOURCE_DIR } /intel/dri
2023-02-21 13:03:24 +08:00
cp -a ${ TARGET_DIR } /lib/dri/i965*.so ${ SOURCE_DIR } /intel/dri
2022-05-05 03:34:33 +08:00
echo "intel/dri/i965*.so usr/lib/jellyfin-ffmpeg/lib/dri" >> ${ DPKG_INSTALL_LIST }
2020-04-09 13:19:31 +08:00
popd
popd
2022-05-02 00:53:56 +08:00
# GMMLIB
2020-07-17 00:32:10 +08:00
pushd ${ SOURCE_DIR }
2025-05-09 20:46:40 +08:00
git clone -b intel-gmmlib-22.7.2 --depth= 1 https://github.com/intel/gmmlib.git
2020-07-17 00:32:10 +08:00
pushd gmmlib
mkdir build && pushd build
cmake -DCMAKE_INSTALL_PREFIX= ${ TARGET_DIR } ..
make -j$( nproc) && make install && make install DESTDIR = ${ SOURCE_DIR } /intel
2022-05-05 03:34:33 +08:00
echo "intel ${ TARGET_DIR } /lib/libigdgmm.so* usr/lib/jellyfin-ffmpeg/lib" >> ${ DPKG_INSTALL_LIST }
2020-07-17 00:32:10 +08:00
popd
popd
popd
2020-04-09 13:19:31 +08:00
2023-03-04 06:46:34 +08:00
# MediaSDK (RT only)
2022-03-05 20:40:35 +08:00
# Provides MSDK runtime (libmfxhw64.so.1) for 11th Gen Rocket Lake and older
2020-07-17 00:32:10 +08:00
pushd ${ SOURCE_DIR }
2023-06-03 16:05:06 +08:00
git clone -b intel-mediasdk-23.2.2 --depth= 1 https://github.com/Intel-Media-SDK/MediaSDK.git
2020-07-17 00:32:10 +08:00
pushd MediaSDK
2025-04-17 17:15:59 +08:00
# Fix build in gcc 13
2023-10-16 19:45:33 +08:00
wget -q -O - https://github.com/Intel-Media-SDK/MediaSDK/commit/8fb9f5f.patch | git apply
2025-04-17 17:15:59 +08:00
# Fix ADI issue with VPL patch
2024-08-10 17:03:44 +08:00
wget -q -O - https://github.com/intel/vpl-gpu-rt/commit/e025c82.patch | git apply
2025-04-17 17:15:59 +08:00
# Fix missing entries in PicStruct validation with VPL patch
wget -q -O - https://github.com/intel/vpl-gpu-rt/commit/c7eb030.patch | git apply
2020-07-17 00:32:10 +08:00
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
2021-11-27 17:55:54 +08:00
cmake -DCMAKE_INSTALL_PREFIX= ${ TARGET_DIR } \
2023-03-04 06:46:34 +08:00
-DBUILD_RUNTIME= ON \
-DBUILD_{ SAMPLES,TUTORIALS,OPENCL}= OFF \
2022-03-05 20:40:35 +08:00
-DBUILD_TUTORIALS= OFF \
2021-11-27 17:55:54 +08:00
..
2020-07-17 00:32:10 +08:00
make -j$( nproc) && make install && make install DESTDIR = ${ SOURCE_DIR } /intel
2023-03-04 06:46:34 +08:00
echo "intel ${ TARGET_DIR } /lib/libmfxhw64.so* usr/lib/jellyfin-ffmpeg/lib" >> ${ DPKG_INSTALL_LIST }
2020-07-17 00:32:10 +08:00
popd
popd
popd
2024-01-29 11:44:49 +08:00
# LIBVPL (dispatcher + header)
2023-08-05 02:12:35 +08:00
# Provides VPL header and dispatcher (libvpl.so.2) for FFmpeg
# Both MSDK and VPL runtime can be loaded by VPL dispatcher
2023-03-04 06:46:34 +08:00
pushd ${ SOURCE_DIR }
2025-05-15 08:30:01 +08:00
git clone -b v2.15.0 --depth= 1 https://github.com/intel/libvpl.git
2024-01-29 11:44:49 +08:00
pushd libvpl
sed -i 's|ParseEnvSearchPaths(ONEVPL_PRIORITY_PATH_VAR, searchDirList)|searchDirList.push_back("/usr/lib/jellyfin-ffmpeg/lib")|g' libvpl/src/mfx_dispatcher_vpl_loader.cpp
2023-03-04 06:46:34 +08:00
mkdir build && pushd build
cmake -DCMAKE_INSTALL_PREFIX= ${ TARGET_DIR } \
-DCMAKE_INSTALL_BINDIR= ${ TARGET_DIR } /bin \
-DCMAKE_INSTALL_LIBDIR= ${ TARGET_DIR } /lib \
-DCMAKE_BUILD_TYPE= Release \
-DBUILD_SHARED_LIBS= ON \
2024-08-10 17:03:44 +08:00
-DINSTALL_{ DEV,LIB}= ON \
-DBUILD_{ TESTS,EXAMPLES,EXPERIMENTAL}= OFF \
2023-03-04 06:46:34 +08:00
..
make -j$( nproc) && make install && make install DESTDIR = ${ SOURCE_DIR } /intel
2025-05-15 08:30:01 +08:00
echo "Libs.private: -lstdc++" >> ${ TARGET_DIR } /lib/pkgconfig/vpl.pc
2023-03-04 06:46:34 +08:00
echo "intel ${ TARGET_DIR } /lib/libvpl.so* usr/lib/jellyfin-ffmpeg/lib" >> ${ DPKG_INSTALL_LIST }
popd
popd
popd
2024-04-21 12:42:12 +08:00
# VPL-GPU-RT (RT only)
2022-03-05 20:40:35 +08:00
# Provides VPL runtime (libmfx-gen.so.1.2) for 11th Gen Tiger Lake and newer
pushd ${ SOURCE_DIR }
2025-05-28 23:33:29 +08:00
git clone -b intel-onevpl-25.2.3 --depth= 1 https://github.com/intel/vpl-gpu-rt.git
2024-04-21 12:42:12 +08:00
pushd vpl-gpu-rt
2025-04-17 17:15:59 +08:00
# Fix missing entries in PicStruct validation
wget -q -O - https://github.com/intel/vpl-gpu-rt/commit/c7eb030.patch | git apply
2022-03-05 20:40:35 +08:00
mkdir build && pushd build
2023-04-01 18:55:31 +08:00
cmake -DCMAKE_INSTALL_PREFIX= ${ TARGET_DIR } \
-DCMAKE_INSTALL_LIBDIR= ${ TARGET_DIR } /lib \
-DCMAKE_BUILD_TYPE= Release \
-DBUILD_RUNTIME= ON \
-DBUILD_{ TESTS,TOOLS}= OFF \
-DMFX_ENABLE_{ KERNELS,ENCTOOLS,AENC}= ON \
..
2022-03-05 20:40:35 +08:00
make -j$( nproc) && make install && make install DESTDIR = ${ SOURCE_DIR } /intel
2022-05-05 03:34:33 +08:00
echo "intel ${ TARGET_DIR } /lib/libmfx-gen* usr/lib/jellyfin-ffmpeg/lib" >> ${ DPKG_INSTALL_LIST }
2022-03-05 20:40:35 +08:00
popd
popd
popd
2022-05-02 00:53:56 +08:00
# MEDIA-DRIVER
2020-04-09 13:19:31 +08:00
# Full Feature Build: ENABLE_KERNELS=ON(Default) ENABLE_NONFREE_KERNELS=ON(Default)
# Free Kernel Build: ENABLE_KERNELS=ON ENABLE_NONFREE_KERNELS=OFF
2022-02-02 17:20:01 +01:00
pushd ${ SOURCE_DIR }
2025-05-28 23:33:29 +08:00
git clone -b intel-media-25.2.3 --depth= 1 https://github.com/intel/media-driver.git
2022-02-02 17:20:01 +01:00
pushd media-driver
2024-12-24 23:14:01 +08:00
# Enable VC1 decode on DG2 (note that MTL+ is not supported)
2025-04-17 17:15:59 +08:00
wget -q -O - https://github.com/intel/media-driver/commit/25fb926.patch | git apply
2022-02-02 17:20:01 +01:00
mkdir build && pushd build
cmake -DCMAKE_INSTALL_PREFIX= ${ TARGET_DIR } \
-DENABLE_KERNELS= ON \
-DENABLE_NONFREE_KERNELS= ON \
LIBVA_DRIVERS_PATH = ${ TARGET_DIR } /lib/dri \
..
make -j$( nproc) && make install && make install DESTDIR = ${ SOURCE_DIR } /intel
2022-05-05 03:34:33 +08:00
echo "intel ${ TARGET_DIR } /lib/libigfxcmrt.so* usr/lib/jellyfin-ffmpeg/lib" >> ${ DPKG_INSTALL_LIST }
2022-02-02 17:20:01 +01:00
mkdir -p ${ SOURCE_DIR } /intel/dri
2023-02-21 13:03:24 +08:00
cp -a ${ TARGET_DIR } /lib/dri/iHD*.so ${ SOURCE_DIR } /intel/dri
2022-05-05 03:34:33 +08:00
echo "intel/dri/iHD*.so usr/lib/jellyfin-ffmpeg/lib/dri" >> ${ DPKG_INSTALL_LIST }
2022-02-02 17:20:01 +01:00
popd
popd
popd
2022-05-02 00:53:56 +08:00
# Vulkan Headers
pushd ${ SOURCE_DIR }
2025-05-28 23:33:29 +08:00
git clone -b v1.4.315 --depth= 1 https://github.com/KhronosGroup/Vulkan-Headers.git
2022-05-02 00:53:56 +08:00
pushd Vulkan-Headers
mkdir build && pushd build
cmake \
-DCMAKE_BUILD_TYPE= Release \
-DCMAKE_INSTALL_PREFIX= ${ TARGET_DIR } ..
make -j$( nproc) && make install
popd
popd
popd
# Vulkan ICD Loader
pushd ${ SOURCE_DIR }
2025-05-28 23:33:29 +08:00
git clone -b v1.4.315 --depth= 1 https://github.com/KhronosGroup/Vulkan-Loader.git
2022-05-02 00:53:56 +08:00
pushd Vulkan-Loader
mkdir build && pushd build
cmake \
-DCMAKE_BUILD_TYPE= Release \
-DCMAKE_INSTALL_PREFIX= ${ TARGET_DIR } \
-DVULKAN_HEADERS_INSTALL_DIR= " ${ TARGET_DIR } " \
-DCMAKE_INSTALL_SYSCONFDIR= ${ TARGET_DIR } /share \
-DCMAKE_INSTALL_DATADIR= ${ TARGET_DIR } /share \
-DCMAKE_INSTALL_LIBDIR= lib \
-DBUILD_TESTS= OFF \
-DBUILD_WSI_{ XCB,XLIB,WAYLAND} _SUPPORT = ON ..
make -j$( nproc) && make install
2023-02-21 13:03:24 +08:00
cp -a ${ TARGET_DIR } /lib/libvulkan.so* ${ SOURCE_DIR } /Vulkan-Loader
2022-05-05 03:34:33 +08:00
echo "Vulkan-Loader/libvulkan.so* usr/lib/jellyfin-ffmpeg/lib" >> ${ DPKG_INSTALL_LIST }
2022-05-02 00:53:56 +08:00
popd
popd
popd
# SHADERC
2025-05-28 23:33:29 +08:00
shaderc_ver = "v2025.2"
2022-05-02 00:53:56 +08:00
pushd ${ SOURCE_DIR }
2024-03-22 20:52:21 +08:00
git clone -b ${ shaderc_ver } --depth= 1 https://github.com/google/shaderc.git
2022-05-02 00:53:56 +08:00
pushd shaderc
./utils/git-sync-deps
mkdir build && pushd build
cmake \
-GNinja \
-DCMAKE_BUILD_TYPE= Release \
-DCMAKE_INSTALL_PREFIX= ${ TARGET_DIR } \
-DSHADERC_SKIP_{ TESTS,EXAMPLES,COPYRIGHT_CHECK}= ON \
-DENABLE_{ GLSLANG_BINARIES,EXCEPTIONS}= ON \
-DENABLE_CTEST= OFF \
-DSPIRV_SKIP_EXECUTABLES= ON \
2022-05-04 07:39:03 +08:00
-DSPIRV_TOOLS_BUILD_STATIC= ON \
-DBUILD_SHARED_LIBS= OFF ..
2022-05-02 00:53:56 +08:00
ninja -j$( nproc)
ninja install
2023-02-21 13:03:24 +08:00
cp -a ${ TARGET_DIR } /lib/libshaderc_shared.so* ${ SOURCE_DIR } /shaderc
2022-05-05 03:34:33 +08:00
echo "shaderc/libshaderc_shared* usr/lib/jellyfin-ffmpeg/lib" >> ${ DPKG_INSTALL_LIST }
2022-05-02 00:53:56 +08:00
popd
popd
popd
# MESA
# Minimal libs for AMD VAAPI, AMD RADV and Intel ANV
2025-04-17 16:54:48 +08:00
if [[ ${ LLVM_VER } -ge 15 ]] ; then
if [[ ${ LLVMSPIRVLIB_VER } -ge 15 ]] ; then
# Intel ANV requires llvmspirvlib >= 15
mesa_vk_drv = "amd,intel"
mesa_llvm_clc = "enabled"
apt-get install -y { llvm-,libllvmspirvlib-,libclc-,libclang-,libclang-cpp} ${ LLVMSPIRVLIB_VER } -dev libudev-dev
else
mesa_vk_drv = "amd"
mesa_llvm_clc = "disabled"
apt-get install -y libudev-dev
2024-03-22 20:52:21 +08:00
fi
2022-05-02 00:53:56 +08:00
pushd ${ SOURCE_DIR }
2025-04-17 16:54:48 +08:00
mkdir mesa
pushd mesa
2025-05-28 23:33:29 +08:00
mesa_ver = "mesa-25.0.7"
2025-04-17 16:54:48 +08:00
mesa_link = "https://gitlab.freedesktop.org/mesa/mesa/-/archive/ ${ mesa_ver } /mesa- ${ mesa_ver } .tar.gz"
wget ${ mesa_link } -O mesa.tar.gz
tar xaf mesa.tar.gz
# Cherry-pick fixes targeting mesa-stable
wget -q -O - https://gitlab.freedesktop.org/mesa/mesa/-/commit/ee4d7e98.patch | git -C mesa-${ mesa_ver } apply
meson setup mesa-${ mesa_ver } mesa_build \
2022-05-02 00:53:56 +08:00
--prefix= ${ TARGET_DIR } \
--libdir= lib \
--buildtype= release \
--wrap-mode= nofallback \
-Db_ndebug= true \
-Db_lto= false \
2023-01-19 17:57:01 +08:00
-Dplatforms= x11 \
2022-05-02 00:53:56 +08:00
-Dgallium-drivers= radeonsi \
2025-04-17 16:54:48 +08:00
-Dvulkan-drivers= ${ mesa_vk_drv } \
2022-05-02 00:53:56 +08:00
-Dvulkan-layers= device-select,overlay \
-Degl= disabled \
2025-04-17 16:54:48 +08:00
-Dgallium-{ extra-hud,nine,rusticl}= false \
-Dgallium-{ vdpau,xa,opencl}= disabled \
2022-05-02 00:53:56 +08:00
-Dgallium-va= enabled \
2025-04-17 16:54:48 +08:00
-Dvideo-codecs= all \
2022-05-02 00:53:56 +08:00
-Dgbm= disabled \
-Dgles1= disabled \
-Dgles2= disabled \
-Dopengl= false \
2025-04-17 16:54:48 +08:00
-Dglvnd= disabled \
2022-05-02 00:53:56 +08:00
-Dglx= disabled \
-Dlibunwind= disabled \
2025-04-17 16:54:48 +08:00
-Dllvm= ${ mesa_llvm_clc } \
-Damd-use-llvm= false \
2022-05-02 00:53:56 +08:00
-Dlmsensors= disabled \
-Dosmesa= false \
-Dshared-glapi= disabled \
-Dvalgrind= disabled \
-Dtools=[] \
-Dzstd= enabled \
2025-04-17 16:54:48 +08:00
-Dmicrosoft-clc= disabled \
-Dintel-elk= false
2022-05-02 00:53:56 +08:00
meson configure mesa_build
2024-07-24 22:33:56 +08:00
ninja -j$( nproc) -C mesa_build install
2023-02-21 13:03:24 +08:00
cp -a ${ TARGET_DIR } /lib/libvulkan_*.so ${ SOURCE_DIR } /mesa
cp -a ${ TARGET_DIR } /lib/libVkLayer_MESA*.so ${ SOURCE_DIR } /mesa
2025-04-17 16:54:48 +08:00
# radeonsi_drv_video.so -> libgallium_drv_video.so is soft link
cp ${ TARGET_DIR } /lib/dri/radeonsi_drv_video.so ${ SOURCE_DIR } /mesa
2022-05-05 03:34:33 +08:00
echo "mesa/lib*.so usr/lib/jellyfin-ffmpeg/lib" >> ${ DPKG_INSTALL_LIST }
echo "mesa/radeonsi_drv_video.so usr/lib/jellyfin-ffmpeg/lib/dri" >> ${ DPKG_INSTALL_LIST }
2022-05-02 00:53:56 +08:00
cp ${ TARGET_DIR } /share/drirc.d/*.conf ${ SOURCE_DIR } /mesa
2022-05-05 03:34:33 +08:00
echo "mesa/*defaults.conf usr/lib/jellyfin-ffmpeg/share/drirc.d" >> ${ DPKG_INSTALL_LIST }
2022-05-02 00:53:56 +08:00
cp ${ TARGET_DIR } /share/vulkan/{ icd.d,explicit_layer.d,implicit_layer.d} /*.json ${ SOURCE_DIR } /mesa
2022-05-05 03:34:33 +08:00
echo "mesa/*icd.x86_64.json usr/lib/jellyfin-ffmpeg/share/vulkan/icd.d" >> ${ DPKG_INSTALL_LIST }
echo "mesa/*overlay.json usr/lib/jellyfin-ffmpeg/share/vulkan/explicit_layer.d" >> ${ DPKG_INSTALL_LIST }
echo "mesa/*device_select.json usr/lib/jellyfin-ffmpeg/share/vulkan/implicit_layer.d" >> ${ DPKG_INSTALL_LIST }
2022-05-02 00:53:56 +08:00
popd
2025-04-17 16:54:48 +08:00
popd
2022-05-02 00:53:56 +08:00
fi
# LIBPLACEBO
2024-09-04 01:00:29 +08:00
pushd ${ SOURCE_DIR }
2025-05-28 23:33:29 +08:00
git clone -b v7.351.0 --recursive --depth= 1 https://github.com/haasn/libplacebo.git
2025-04-17 16:54:48 +08:00
# Wa for the regression made in Mesa RADV
git -C libplacebo apply ${ SOURCE_DIR } /builder/patches/libplacebo/*.patch
2024-09-04 01:00:29 +08:00
sed -i 's|env: python_env,||g' libplacebo/src/vulkan/meson.build
meson setup libplacebo placebo_build \
--prefix= ${ TARGET_DIR } \
--libdir= lib \
--buildtype= release \
--default-library= shared \
-Dvulkan= enabled \
-Dvk-proc-addr= enabled \
-Dvulkan-registry= ${ TARGET_DIR } /share/vulkan/registry/vk.xml \
-Dshaderc= enabled \
-Dglslang= disabled \
-D{ demos,tests,bench,fuzz}= false
meson configure placebo_build
ninja -j$( nproc) -C placebo_build install
cp -a ${ TARGET_DIR } /lib/libplacebo.so* ${ SOURCE_DIR } /libplacebo
echo "libplacebo/libplacebo* usr/lib/jellyfin-ffmpeg/lib" >> ${ DPKG_INSTALL_LIST }
popd
2020-04-09 13:19:31 +08:00
}
2022-02-25 16:48:43 +01:00
2024-01-29 11:44:49 +08:00
# Prepare extra headers, libs and drivers for {arm,aarch64}-linux-gnu*
prepare_extra_arm() {
# RKMPP
pushd ${ SOURCE_DIR }
2025-05-28 23:33:29 +08:00
git clone -b jellyfin-mpp-next --depth= 1 https://github.com/nyanmisaka/mpp.git rkmpp
2024-01-29 11:44:49 +08:00
pushd rkmpp
mkdir rkmpp_build
pushd rkmpp_build
cmake \
${ CMAKE_TOOLCHAIN_OPT } \
-DCMAKE_INSTALL_PREFIX= ${ TARGET_DIR } \
-DCMAKE_BUILD_TYPE= Release \
-DBUILD_SHARED_LIBS= ON \
-DBUILD_TEST= OFF \
..
make -j$( nproc) && make install && make install DESTDIR = ${ SOURCE_DIR } /rkmpp
echo "rkmpp ${ TARGET_DIR } /lib/librockchip*.* usr/lib/jellyfin-ffmpeg/lib" >> ${ DPKG_INSTALL_LIST }
popd
popd
popd
# RKRGA
pushd ${ SOURCE_DIR }
2025-05-28 23:33:29 +08:00
git clone -b jellyfin-rga-next --depth= 1 https://github.com/nyanmisaka/rk-mirrors.git rkrga
2024-01-29 11:44:49 +08:00
meson setup rkrga rkrga_build \
${ MESON_CROSS_OPT } \
--prefix= ${ TARGET_DIR } \
--libdir= lib \
--buildtype= release \
--default-library= shared \
-Dcpp_args= -fpermissive \
-Dlibdrm= false \
-Dlibrga_demo= false
meson configure rkrga_build
2024-07-24 22:33:56 +08:00
ninja -j$( nproc) -C rkrga_build install
2024-01-29 11:44:49 +08:00
cp -a ${ TARGET_DIR } /lib/librga.so* ${ SOURCE_DIR } /rkrga
echo "rkrga/librga.so* usr/lib/jellyfin-ffmpeg/lib" >> ${ DPKG_INSTALL_LIST }
popd
}
2019-02-23 22:01:55 -05:00
# Prepare the cross-toolchain
2019-04-29 10:39:32 -04:00
prepare_crossbuild_env_arm64() {
# Prepare the Ubuntu-specific cross-build requirements
2022-10-02 00:30:06 +08:00
if [[ $( lsb_release -i -s ) == "Debian" ]] ; then
CODENAME = " $( lsb_release -c -s ) "
echo "deb [arch=amd64] ${ DEBIAN_ADDR } ${ CODENAME } -backports main restricted universe multiverse" >> /etc/apt/sources.list
echo "deb [arch=arm64] ${ DEBIAN_ADDR } ${ CODENAME } -backports main restricted universe multiverse" >> /etc/apt/sources.list
fi
2019-04-29 10:39:32 -04:00
if [[ $( lsb_release -i -s ) == "Ubuntu" ]] ; then
CODENAME = " $( lsb_release -c -s ) "
2024-04-21 12:42:12 +08:00
# Remove the default sources
rm -f /etc/apt/sources.list /etc/apt/sources.list.d/ubuntu.sources
2019-04-29 10:39:32 -04:00
# Add arch-specific list files
cat <<EOF > /etc/apt/sources.list.d/amd64.list
2022-10-02 00:30:06 +08:00
deb [arch=amd64] ${UBUNTU_ARCHIVE_ADDR} ${CODENAME} main restricted universe multiverse
deb [arch=amd64] ${UBUNTU_ARCHIVE_ADDR} ${CODENAME}-updates main restricted universe multiverse
deb [arch=amd64] ${UBUNTU_ARCHIVE_ADDR} ${CODENAME}-backports main restricted universe multiverse
deb [arch=amd64] ${UBUNTU_ARCHIVE_ADDR} ${CODENAME}-security main restricted universe multiverse
2019-04-29 10:39:32 -04:00
EOF
cat <<EOF > /etc/apt/sources.list.d/arm64.list
2022-10-02 00:30:06 +08:00
deb [arch=arm64] ${UBUNTU_PORTS_ADDR} ${CODENAME} main restricted universe multiverse
deb [arch=arm64] ${UBUNTU_PORTS_ADDR} ${CODENAME}-updates main restricted universe multiverse
deb [arch=arm64] ${UBUNTU_PORTS_ADDR} ${CODENAME}-backports main restricted universe multiverse
deb [arch=arm64] ${UBUNTU_PORTS_ADDR} ${CODENAME}-security main restricted universe multiverse
2019-04-29 10:39:32 -04:00
EOF
fi
2024-04-21 14:24:00 +08:00
# Add arm64 architecture
2019-04-29 10:39:32 -04:00
dpkg --add-architecture arm64
# Update and install cross-gcc-dev
2024-04-21 12:42:12 +08:00
apt-get update && apt-get dist-upgrade -y
2019-04-29 10:39:32 -04:00
yes | apt-get install -y cross-gcc-dev
# Generate gcc cross source
TARGET_LIST = "arm64" cross-gcc-gensource ${ GCC_VER }
# Install dependencies
pushd cross-gcc-packages-amd64/cross-gcc-${ GCC_VER } -arm64
ln -fs /usr/share/zoneinfo/America/Toronto /etc/localtime
2024-04-21 14:24:00 +08:00
yes | apt-get install -y -o Dpkg::Options::= "--force-overwrite" -o APT::Immediate-Configure= 0 gcc-${ GCC_VER } -source gcc-${ GCC_VER } -aarch64-linux-gnu g++-${ GCC_VER } -aarch64-linux-gnu libstdc++6-arm64-cross binutils-aarch64-linux-gnu bison flex libtool gdb sharutils netbase libmpc-dev libmpfr-dev systemtap-sdt-dev autogen expect chrpath zip libc6-dev:arm64 linux-libc-dev:arm64 libgcc1:arm64 libstdc++6:arm64
2019-04-29 10:39:32 -04:00
popd
}
2019-02-23 22:01:55 -05:00
# Set the architecture-specific options
case ${ ARCH } in
'amd64' )
2024-04-21 14:24:00 +08:00
apt-get update && apt-get dist-upgrade -y
2020-10-25 02:51:00 +08:00
prepare_extra_common
2020-07-15 21:33:59 +08:00
prepare_extra_amd64
2019-02-23 22:01:55 -05:00
CONFIG_SITE = ""
DEP_ARCH_OPT = ""
BUILD_ARCH_OPT = ""
;;
2019-04-29 10:39:32 -04:00
'arm64' )
prepare_crossbuild_env_arm64
2020-10-25 02:51:00 +08:00
ln -s /usr/bin/aarch64-linux-gnu-gcc-${ GCC_VER } /usr/bin/aarch64-linux-gnu-gcc
ln -s /usr/bin/aarch64-linux-gnu-gcc-ar-${ GCC_VER } /usr/bin/aarch64-linux-gnu-gcc-ar
ln -s /usr/bin/aarch64-linux-gnu-g++-${ GCC_VER } /usr/bin/aarch64-linux-gnu-g++
prepare_extra_common
2024-01-29 11:44:49 +08:00
prepare_extra_arm
2019-04-29 10:39:32 -04:00
CONFIG_SITE = "/etc/dpkg-cross/cross-config. ${ ARCH } "
DEP_ARCH_OPT = "--host-arch arm64"
BUILD_ARCH_OPT = "-aarm64"
;;
2019-02-23 22:01:55 -05:00
esac
# Move to source directory
pushd ${ SOURCE_DIR }
# Install dependencies and build the deb
yes | mk-build-deps -i ${ DEP_ARCH_OPT }
dpkg-buildpackage -b -rfakeroot -us -uc ${ BUILD_ARCH_OPT }
popd
# Move the artifacts out
mkdir -p ${ ARTIFACT_DIR } /deb
2024-08-03 19:19:58 +08:00
mv /jellyfin-ffmpeg{ ,7} _* ${ ARTIFACT_DIR } /deb/
2019-05-16 10:47:02 -04:00
chown -Rc $( stat -c %u:%g ${ ARTIFACT_DIR } ) ${ ARTIFACT_DIR }