fix: 修复MSD上传功能和多项构建优化

- 修复MSD上传中prefix参数编码问题
- 移除重复的uploading-sub元素定义
- 优化Python依赖库清理和缓存管理
- 改进Rockchip硬件加速库构建流程
- 增强国际化语言检测和设置
- 修正ttyd下载地址和系统服务配置
This commit is contained in:
mofeng-git
2025-08-25 20:14:50 +08:00
parent ccdfd52b75
commit ecc27c2be7
9 changed files with 65 additions and 40 deletions

View File

@@ -103,12 +103,18 @@ RUN --security=insecure pip config set global.index-url https://pypi.tuna.tsingh
pycparser pyelftools pyghmi pygments pyparsing pyotp qrcode requests \
semantic-version setproctitle six spidev tabulate urllib3 wrapt xlib \
yarl pyserial pyyaml zstandard supervisor pyfatfs pyserial python-periphery \
python-ldap python-pam pyrad pyudev pyusb luma.oled pyserial-asyncio
python-ldap python-pam pyrad pyudev pyusb luma.oled pyserial-asyncio \
&& rm -rf /root/.cache/pip/* /tmp/pip-* \
&& if [ ${TARGETARCH} = arm ]; then \
umount /root/.cargo 2>/dev/null || true \
&& rm -rf /root/.cargo /root/rustup-init.sh; \
fi
# 编译 python vedev库
# 编译 python evdev库
RUN git clone --depth=1 https://github.com/gvalkov/python-evdev.git /tmp/python-evdev \
&& cd /tmp/python-evdev \
&& python3 setup.py bdist_wheel --dist-dir /tmp/wheel/
&& python3 setup.py bdist_wheel --dist-dir /tmp/wheel/ \
&& rm -rf /tmp/python-evdev
# 编译安装 libnice、libsrtp、libwebsockets 和 janus-gateway
RUN git clone --depth=1 https://gitlab.freedesktop.org/libnice/libnice /tmp/libnice \
@@ -120,14 +126,14 @@ RUN git clone --depth=1 https://gitlab.freedesktop.org/libnice/libnice /tmp/libn
&& tar xf libsrtp-2.2.0.tar.gz \
&& cd libsrtp-2.2.0 \
&& ./configure --prefix=/usr --enable-openssl \
&& make shared_library -j && make install \
&& make shared_library -j$(nproc) && make install \
&& cd /tmp \
&& rm -rf /tmp/libsrtp* \
&& git clone --depth=1 https://github.com/warmcat/libwebsockets /tmp/libwebsockets \
&& cd /tmp/libwebsockets \
&& mkdir build && cd build \
&& cmake -DLWS_MAX_SMP=1 -DLWS_WITHOUT_EXTENSIONS=0 -DCMAKE_INSTALL_PREFIX:PATH=/usr -DCMAKE_C_FLAGS="-fpic" .. \
&& make -j && make install \
&& make -j$(nproc) && make install \
&& cd /tmp \
&& rm -rf /tmp/libwebsockets \
&& git clone --depth=1 https://github.com/meetecho/janus-gateway.git /tmp/janus-gateway \
@@ -136,29 +142,35 @@ RUN git clone --depth=1 https://gitlab.freedesktop.org/libnice/libnice /tmp/libn
&& ./configure --enable-static --enable-websockets --enable-plugin-audiobridge \
--disable-data-channels --disable-rabbitmq --disable-mqtt --disable-all-plugins \
--disable-all-loggers --prefix=/usr \
&& make -j && make install \
&& make -j$(nproc) && make install \
&& cd /tmp \
&& rm -rf /tmp/janus-gateway
# 编译 Rockchip MPP、RGA 和 FFmpeg仅 arm64
RUN if [ ${TARGETARCH} = arm64 ]; then \
git clone --depth=1 https://github.com/rockchip-linux/mpp.git /tmp/mpp \
&& cd /tmp/mpp \
&& cmake -DRKPLATFORM=ON -DCMAKE_INSTALL_PREFIX=/usr . \
git clone -b jellyfin-mpp --depth=1 https://github.com/nyanmisaka/mpp.git /tmp/rkmpp \
&& mkdir -p /tmp/rkmpp/rkmpp_build && cd /tmp/rkmpp/rkmpp_build \
&& cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON -DBUILD_TEST=OFF .. \
&& make -j$(nproc) \
&& make install \
&& make install DESTDIR=/opt \
&& git clone --depth=1 -b 1.9.1 https://github.com/airockchip/librga /tmp/librga \
&& cd /tmp/librga \
&& meson setup --prefix=/usr rkrga_build \
&& git clone -b jellyfin-rga --depth=1 https://github.com/nyanmisaka/rk-mirrors.git /tmp/rkrga \
&& cd /tmp/ \
&& meson setup rkrga rkrga_build --prefix=/usr --libdir=lib --buildtype=release -Dcpp_args=-fpermissive -Dlibdrm=false -Dlibrga_demo=false \
&& meson configure rkrga_build > /dev/null \
&& ninja -C rkrga_build install \
&& DESTDIR=/opt ninja -C rkrga_build install \
&& git clone --depth=1 https://github.com/nyanmisaka/ffmpeg-rockchip.git /tmp/ffmpeg-rockchip \
&& git clone https://github.com/nyanmisaka/ffmpeg-rockchip.git /tmp/ffmpeg-rockchip \
&& cd /tmp/ffmpeg-rockchip \
&& ./configure --prefix=/usr --enable-gpl --enable-version3 --enable-libdrm --enable-rkmpp --enable-rkrga --enable-alsa --enable-libv4l2 --enable-libx264 --enable-v4l2-m2m --disable-programs \
&& ./configure --prefix=/usr --enable-gpl --enable-version3 --enable-libdrm --enable-rkmpp --enable-rkrga \
--enable-libv4l2 --enable-libx264 --enable-shared --disable-programs \
--disable-doc --disable-htmlpages --disable-manpages --disable-network --disable-protocols \
--disable-decoders --disable-debug --disable-alsa \
&& make -j$(nproc) \
&& make install \
&& make install DESTDIR=/opt; \
&& make install DESTDIR=/opt \
&& cd /opt && tar -czf /tmp/arm64-libs.tar.gz usr/ \
&& rm -rf /tmp/rkmpp /tmp/rkrga /tmp/ffmpeg-rockchip /opt/usr; \
fi
# 编译 ustreamer
@@ -166,7 +178,7 @@ RUN echo "Building ustreamer with timestamp cache bust" \
&& sed --in-place --expression 's|^#include "refcount.h"$|#include "../refcount.h"|g' /usr/include/janus/plugins/plugin.h \
&& TIMESTAMP=$(date +%s%N) \
&& git clone --depth=1 https://github.com/mofeng-git/ustreamer /tmp/ustreamer-${TIMESTAMP} \
&& make -j WITH_PYTHON=1 WITH_JANUS=1 WITH_FFMPEG=1 -C /tmp/ustreamer-${TIMESTAMP} \
&& make -j$(nproc) WITH_PYTHON=1 WITH_JANUS=1 WITH_FFMPEG=1 -C /tmp/ustreamer-${TIMESTAMP} \
&& /tmp/ustreamer-${TIMESTAMP}/ustreamer -v \
&& cp /tmp/ustreamer-${TIMESTAMP}/python/dist/*.whl /tmp/wheel/ \
&& mv /tmp/ustreamer-${TIMESTAMP} /tmp/ustreamer