Skip to content

Commit

Permalink
Update build scripts and dependencies
Browse files Browse the repository at this point in the history
Signed-off-by: nyanmisaka <nst799610810@gmail.com>
  • Loading branch information
nyanmisaka committed Aug 3, 2024
1 parent 3f7ecec commit 24a9646
Show file tree
Hide file tree
Showing 14 changed files with 61 additions and 36 deletions.
2 changes: 1 addition & 1 deletion Dockerfile.in
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ ENV LLVM_VER=LLVM_RELEASE_VERSION
ENV SOURCE_DIR=/ffmpeg
ENV ARTIFACT_DIR=/dist
ENV TARGET_DIR=/usr/lib/jellyfin-ffmpeg
ENV DPKG_INSTALL_LIST=${SOURCE_DIR}/debian/jellyfin-ffmpeg6.install
ENV DPKG_INSTALL_LIST=${SOURCE_DIR}/debian/jellyfin-ffmpeg7.install
ENV PATH=${TARGET_DIR}/bin:${PATH}
ENV PKG_CONFIG_PATH=${TARGET_DIR}/lib/pkgconfig:${PKG_CONFIG_PATH}
ENV LD_LIBRARY_PATH=${TARGET_DIR}/lib:${TARGET_DIR}/lib/mfx:${TARGET_DIR}/lib/xorg:${LD_LIBRARY_PATH}
Expand Down
1 change: 1 addition & 0 deletions builder/images/base-win64/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 && \
curl "https://github.com/gcc-mirror/gcc/commit/747c4b58573ea00419f64293a61537eb69f43307.patch" > packages/gcc/14.1.0/9999-fix-inline.patch && \
./bootstrap && \
./configure --enable-local && \
make -j$(nproc) && \
Expand Down
10 changes: 8 additions & 2 deletions builder/scripts.d/45-harfbuzz.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,15 @@ ffbuild_dockerbuild() {
return -1
fi

export LIBS="-lpthread"

meson "${myconf[@]}" ..
ninja -j$(nproc)
ninja install
}

ffbuild_configure() {
echo --enable-libharfbuzz
}

ffbuild_unconfigure() {
echo --disable-libharfbuzz
}
4 changes: 2 additions & 2 deletions builder/scripts.d/50-dxva.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ ffbuild_dockerbuild() {
}

ffbuild_configure() {
[[ $TARGET == win* ]] && echo --enable-dxva2 --enable-d3d11va
[[ $TARGET == win* ]] && echo --enable-dxva2 --enable-d3d11va --enable-d3d12va
}

ffbuild_unconfigure() {
[[ $TARGET == win* ]] && echo --disable-dxva2 --disable-d3d11va
[[ $TARGET == win* ]] && echo --disable-dxva2 --disable-d3d11va --disable-d3d12va
}
6 changes: 6 additions & 0 deletions builder/scripts.d/50-libbluray.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ ffbuild_dockerbuild() {
git-mini-clone "$SCRIPT_REPO" "$SCRIPT_COMMIT" libbluray
cd libbluray

if [[ $TARGET == mac* ]]; then
gsed -i 's/dec_init/libbluray_dec_init/g' src/libbluray/disc/*.c src/libbluray/disc/*.h
else
sed -i 's/dec_init/libbluray_dec_init/g' src/libbluray/disc/*.c src/libbluray/disc/*.h
fi

./bootstrap

local myconf=(
Expand Down
6 changes: 4 additions & 2 deletions builder/variants/defaults-gpl.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
FF_CONFIGURE="--enable-gpl --enable-version3 --enable-lto --disable-ffplay --disable-debug --disable-doc --disable-ptx-compression --disable-sdl2"
FF_CONFIGURE="--enable-gpl --enable-version3 --disable-ffplay --disable-debug --disable-doc --disable-ptx-compression --disable-sdl2"
FF_CFLAGS=""
FF_CXXFLAGS=""
FF_LDFLAGS=""
GIT_BRANCH="jellyfin"
LICENSE_FILE="COPYING.GPLv3"

[[ $TARGET == linux* ]] && FF_CONFIGURE+=" --disable-libxcb --disable-xlib" || true
[[ $TARGET == linux* ]] && FF_CONFIGURE+=" --disable-libxcb --disable-xlib --enable-lto=auto" || true
[[ $TARGET == win* ]] && FF_CONFIGURE+=" --enable-lto=auto" || true
[[ $TARGET == mac* ]] && FF_CONFIGURE+=" --enable-lto=thin" || true
Empty file modified builder/variants/defaults-mac.sh
100644 → 100755
Empty file.
13 changes: 8 additions & 5 deletions debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@ export V=1

ORIG_VERSION := $(shell dpkg-parsechangelog -S version)
VERSION_SUFFIX := $(shell lsb_release -c -s)
PACKAGEVERSION := "$(ORIG_VERSION)-$(VERSION_SUFFIX)"
PACKAGE_VERSION := "$(ORIG_VERSION)-$(VERSION_SUFFIX)"
FLTO_OPTIONS := auto
ifeq ($(VERSION_SUFFIX),focal)
FLTO_OPTIONS := $(shell nproc)
endif

CONFIG := --prefix=${TARGET_DIR} \
--target-os=linux \
Expand All @@ -16,7 +20,7 @@ CONFIG := --prefix=${TARGET_DIR} \
--disable-libxcb \
--disable-sdl2 \
--disable-xlib \
--enable-lto \
--enable-lto=${FLTO_OPTIONS} \
--enable-gpl \
--enable-version3 \
--enable-shared \
Expand All @@ -30,6 +34,7 @@ CONFIG := --prefix=${TARGET_DIR} \
--enable-libfreetype \
--enable-libfribidi \
--enable-libfontconfig \
--enable-libharfbuzz \
--enable-libbluray \
--enable-libmp3lame \
--enable-libopus \
Expand All @@ -47,8 +52,6 @@ CONFIG := --prefix=${TARGET_DIR} \
--enable-libfdk-aac \

CONFIG_x86 := --arch=amd64 \
--enable-libshaderc \
--enable-libplacebo \
--enable-vulkan \
--enable-vaapi \
--enable-amf \
Expand Down Expand Up @@ -92,7 +95,7 @@ endif
dh $@

override_dh_gencontrol:
dh_gencontrol -- -v$(PACKAGEVERSION)
dh_gencontrol -- -v$(PACKAGE_VERSION)

override_dh_auto_configure:
./configure $(CONFIG)
Expand Down
7 changes: 5 additions & 2 deletions docker-build-win64.sh
Original file line number Diff line number Diff line change
Expand Up @@ -230,8 +230,9 @@ make install
popd

# LIBBLURAY
git clone --depth=1 https://code.videolan.org/videolan/libbluray.git
git clone -b 1.3.4 --depth=1 https://code.videolan.org/videolan/libbluray.git
pushd libbluray
sed -i 's/dec_init/libbluray_dec_init/g' src/libbluray/disc/*.{c,h}
./bootstrap
./configure \
--prefix=${FF_DEPS_PREFIX} \
Expand Down Expand Up @@ -592,7 +593,7 @@ fi
--disable-w32threads \
--enable-pthreads \
--enable-shared \
--enable-lto \
--enable-lto=auto \
--enable-gpl \
--enable-version3 \
--enable-schannel \
Expand All @@ -605,6 +606,7 @@ fi
--enable-libfreetype \
--enable-libfribidi \
--enable-libfontconfig \
--enable-libharfbuzz \
--enable-libass \
--enable-libbluray \
--enable-libmp3lame \
Expand All @@ -623,6 +625,7 @@ fi
--enable-opencl \
--enable-dxva2 \
--enable-d3d11va \
--enable-d3d12va \
--enable-amf \
--enable-libvpl \
--enable-ffnvcodec \
Expand Down
40 changes: 20 additions & 20 deletions docker-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -599,25 +599,25 @@ prepare_extra_amd64() {
fi

# LIBPLACEBO
pushd ${SOURCE_DIR}
git clone -b v6.338.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} \
--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
# pushd ${SOURCE_DIR}
# git clone -b v6.338.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} \
# --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
}

# Prepare extra headers, libs and drivers for {arm,aarch64}-linux-gnu*
Expand Down Expand Up @@ -783,5 +783,5 @@ popd

# Move the artifacts out
mkdir -p ${ARTIFACT_DIR}/deb
mv /jellyfin-ffmpeg{,6}_* ${ARTIFACT_DIR}/deb/
mv /jellyfin-ffmpeg{,7}_* ${ARTIFACT_DIR}/deb/
chown -Rc $(stat -c %u:%g ${ARTIFACT_DIR}) ${ARTIFACT_DIR}
1 change: 1 addition & 0 deletions msys2/PKGBUILD/30-mingw-w64-harfbuzz/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ build() {
-Dgobject=disabled \
-Dicu=disabled \
-Dcpp_std=c++17 \
-Dfreetype=enabled \
-Dgdi=disabled \
-Dgraphite=disabled \
-Ddirectwrite=disabled \
Expand Down
1 change: 1 addition & 0 deletions msys2/PKGBUILD/30-mingw-w64-libbluray/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export FF_MINGW_PREFIX="${MINGW_TOOLCHAIN_PREFIX}/ffbuild"

prepare() {
cd ${srcdir}/${_realname}-${pkgver}
sed -i 's/dec_init/libbluray_dec_init/g' src/libbluray/disc/*.c src/libbluray/disc/*.h
}

build() {
Expand Down
2 changes: 1 addition & 1 deletion msys2/PKGBUILD/50-mingw-w64-libvpl/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
_realname=libvpl
pkgbase=mingw-w64-jellyfin-${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-jellyfin-${_realname}")
pkgver=2.11.0
pkgver=2.12.0
pkgrel=1
pkgdesc="Intel Video Processing Library (mingw-w64)"
arch=('any')
Expand Down
4 changes: 3 additions & 1 deletion msys2/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ PKG_CONFIG_PATH=/clang64/ffbuild/lib/pkgconfig ./configure --cc=clang \
--disable-doc \
--disable-sdl2 \
--disable-ptx-compression \
--enable-lto \
--enable-lto=thin \
--enable-gpl \
--enable-version3 \
--enable-schannel \
Expand All @@ -55,6 +55,7 @@ PKG_CONFIG_PATH=/clang64/ffbuild/lib/pkgconfig ./configure --cc=clang \
--enable-libfreetype \
--enable-libfribidi \
--enable-libfontconfig \
--enable-libharfbuzz \
--enable-libass \
--enable-libbluray \
--enable-libmp3lame \
Expand All @@ -73,6 +74,7 @@ PKG_CONFIG_PATH=/clang64/ffbuild/lib/pkgconfig ./configure --cc=clang \
--enable-opencl \
--enable-dxva2 \
--enable-d3d11va \
--enable-d3d12va \
--enable-amf \
--enable-libvpl \
--enable-ffnvcodec \
Expand Down

0 comments on commit 24a9646

Please sign in to comment.