From c385fd39e949314974d409b0d1e47513dc6620fa Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Mon, 18 Mar 2024 05:46:00 +0000 Subject: [PATCH] Add package for L4T Jammy --- .gitmodules | 3 +++ Dockerfile.l4t.jammy | 28 ++++++++++++++++++++++++++++ FFmpeg-l4t-new | 1 + build-l4t-jammy.sh | 4 ++++ do-release.sh | 3 +++ push-images.sh | 2 ++ scripts/build-deps.sh | 8 ++++---- 7 files changed, 45 insertions(+), 4 deletions(-) create mode 100644 Dockerfile.l4t.jammy create mode 160000 FFmpeg-l4t-new create mode 100755 build-l4t-jammy.sh diff --git a/.gitmodules b/.gitmodules index e903ab0..9d729f2 100644 --- a/.gitmodules +++ b/.gitmodules @@ -22,3 +22,6 @@ [submodule "dav1d"] path = dav1d url = https://code.videolan.org/videolan/dav1d.git +[submodule "FFmpeg-l4t-new"] + path = FFmpeg-l4t-new + url = https://github.com/theofficialgman/FFmpeg.git diff --git a/Dockerfile.l4t.jammy b/Dockerfile.l4t.jammy new file mode 100644 index 0000000..4ff24e6 --- /dev/null +++ b/Dockerfile.l4t.jammy @@ -0,0 +1,28 @@ +FROM arm64v8/ubuntu:jammy + +ENV TARGET=l4t +ENV DISTRO=jammy + +COPY scripts/install-base-deps.sh /opt/scripts/ +RUN /bin/bash -c /opt/scripts/install-base-deps.sh && \ + echo "deb https://theofficialgman.github.io/l4t-debs/ l4t $DISTRO" >> /etc/apt/sources.list && \ + apt-key adv --fetch-key https://theofficialgman.github.io/l4t-debs/pgp-key.public && \ + mkdir -p /opt/nvidia/l4t-packages/ && \ + echo >> /opt/nvidia/l4t-packages/.nv-l4t-disable-boot-fw-update-in-preinstall && \ + apt-get update && \ + apt-get install -y -o Dpkg::Options::="--force-confold" libv4l-dev nvidia-bsp-32-3 nvidia-l4t-multimedia-utils && \ + apt-get clean -y && \ + rm -rf /var/lib/apt/lists/* + +COPY dav1d /opt/dav1d +COPY FFmpeg-l4t-new /opt/FFmpeg +COPY SDL2 /opt/SDL2 +COPY SDL_ttf /opt/SDL_ttf + +COPY scripts/build-deps.sh /opt/scripts/ +RUN /bin/bash -c /opt/scripts/build-deps.sh + +COPY scripts/build-package.sh /opt/scripts/ + +VOLUME "/out" +ENTRYPOINT [ "/bin/bash", "-c", "/opt/scripts/build-package.sh" ] diff --git a/FFmpeg-l4t-new b/FFmpeg-l4t-new new file mode 160000 index 0000000..ac6ab5a --- /dev/null +++ b/FFmpeg-l4t-new @@ -0,0 +1 @@ +Subproject commit ac6ab5a6decc38b6149c9a77fd574008debe7377 diff --git a/build-l4t-jammy.sh b/build-l4t-jammy.sh new file mode 100755 index 0000000..1860854 --- /dev/null +++ b/build-l4t-jammy.sh @@ -0,0 +1,4 @@ +TARGET_NAME="l4t-jammy" +DOCKERFILE="Dockerfile.l4t.jammy" + +. ./build-common.sh diff --git a/do-release.sh b/do-release.sh index 2b3b977..6c68f5e 100755 --- a/do-release.sh +++ b/do-release.sh @@ -23,10 +23,12 @@ wait ./build-armhf-bookworm.sh $1 & ./build-aarch64-bookworm.sh $1 & ./build-riscv64-sid.sh $1 & +./build-l4t-jammy.sh $1 & wait # Push the moonlight-qt packages to Cloudsmith repos cloudsmith push deb moonlight-game-streaming/moonlight-l4t/ubuntu/bionic out_l4t-bionic/moonlight-qt_*.deb +cloudsmith push deb moonlight-game-streaming/moonlight-l4t/ubuntu/jammy out_l4t-jammy/moonlight-qt_*.deb cloudsmith push deb moonlight-game-streaming/moonlight-qt/raspbian/buster out_rpi-buster/moonlight-qt_*.deb cloudsmith push deb moonlight-game-streaming/moonlight-qt/raspbian/bullseye out_rpi-buster/moonlight-qt_*.deb cloudsmith push deb moonlight-game-streaming/moonlight-qt/raspbian/bookworm out_rpi-bookworm/moonlight-qt_*.deb @@ -41,6 +43,7 @@ cloudsmith push deb moonlight-game-streaming/moonlight-qt/debian/sid out_riscv64 # Push the moonlight-qt-dbgsym packages to Cloudsmith repos cloudsmith push deb moonlight-game-streaming/moonlight-l4t/ubuntu/bionic out_l4t-bionic/moonlight-qt-dbgsym_*.ddeb +cloudsmith push deb moonlight-game-streaming/moonlight-l4t/ubuntu/jammy out_l4t-jammy/moonlight-qt-dbgsym_*.ddeb cloudsmith push deb moonlight-game-streaming/moonlight-qt/raspbian/buster out_rpi-buster/moonlight-qt-dbgsym_*.deb cloudsmith push deb moonlight-game-streaming/moonlight-qt/raspbian/bullseye out_rpi-buster/moonlight-qt-dbgsym_*.deb cloudsmith push deb moonlight-game-streaming/moonlight-qt/raspbian/bookworm out_rpi-bookworm/moonlight-qt-dbgsym_*.deb diff --git a/push-images.sh b/push-images.sh index 7f96424..4ae1cf6 100755 --- a/push-images.sh +++ b/push-images.sh @@ -21,6 +21,7 @@ docker build --pull -f Dockerfile.aarch64.bookworm -t cgutman/moonlight-packagin docker build --pull -f Dockerfile.armhf.bullseye -t cgutman/moonlight-packaging:armhf-bullseye_$TAG_UNIQUE_ID . & docker build --pull -f Dockerfile.armhf.bookworm -t cgutman/moonlight-packaging:armhf-bookworm_$TAG_UNIQUE_ID . & docker build --pull -f Dockerfile.riscv64.sid -t cgutman/moonlight-packaging:riscv64-sid_$TAG_UNIQUE_ID . & +docker build --pull -f Dockerfile.l4t.jammy -t cgutman/moonlight-packaging:l4t-jammy_$TAG_UNIQUE_ID . & wait docker push cgutman/moonlight-packaging:rpi-buster_$TAG_UNIQUE_ID @@ -28,6 +29,7 @@ docker push cgutman/moonlight-packaging:rpi64-buster_$TAG_UNIQUE_ID docker push cgutman/moonlight-packaging:rpi-bookworm_$TAG_UNIQUE_ID docker push cgutman/moonlight-packaging:rpi64-bookworm_$TAG_UNIQUE_ID docker push cgutman/moonlight-packaging:l4t-bionic_$TAG_UNIQUE_ID +docker push cgutman/moonlight-packaging:l4t-jammy_$TAG_UNIQUE_ID docker push cgutman/moonlight-packaging:armhf-bullseye_$TAG_UNIQUE_ID docker push cgutman/moonlight-packaging:armhf-bookworm_$TAG_UNIQUE_ID docker push cgutman/moonlight-packaging:aarch64-bullseye_$TAG_UNIQUE_ID diff --git a/scripts/build-deps.sh b/scripts/build-deps.sh index 4e82080..5de45da 100755 --- a/scripts/build-deps.sh +++ b/scripts/build-deps.sh @@ -30,8 +30,8 @@ if [ "$TARGET" == "rpi" ] || [ "$TARGET" == "rpi64" ]; then EXTRA_FFMPEG_ARGS="$EXTRA_FFMPEG_ARGS --enable-mmal --enable-decoder=h264_mmal" fi elif [ "$TARGET" == "l4t" ]; then - # Enable NVV4L2 decoders - EXTRA_FFMPEG_ARGS="--enable-nvv4l2 --enable-decoder=h264_nvv4l2 --enable-decoder=hevc_nvv4l2" + # Enable NVV4L2 decoders (and VP9 decoder to work around compilation error in NVV4L2 fallback code) + EXTRA_FFMPEG_ARGS="--enable-nvv4l2 --enable-decoder=h264_nvv4l2 --enable-decoder=hevc_nvv4l2 --enable-decoder=vp9" elif [ "$TARGET" == "desktop" ]; then # We need to install the NVDEC headers cd /opt/nv-codec-headers @@ -67,7 +67,7 @@ cat SDL2_ttf.pc make install # FFmpeg-l4t is too old to support dav1d 1.2.1 -if [ "$TARGET" != "l4t" ]; then +if [ "$TARGET" != "l4t" ] || [ "$DISTRO" != "bionic" ]; then # Build and install libdav1d cd /opt/dav1d meson setup build -Ddefault_library=static -Dbuildtype=debugoptimized -Denable_tools=false -Denable_tests=false @@ -85,6 +85,6 @@ make install if [ "$TARGET" == "l4t" ]; then # Patch libavcodec.pc to provide the proper library path for libnvbuf_utils.so - sed -i 's|-lnvbuf_utils|-L/usr/lib/aarch64-linux-gnu/tegra/ -lnvbuf_utils|g' /usr/local/lib/pkgconfig/libavcodec.pc + sed -i 's|-lnvbuf_utils|-L/usr/lib/aarch64-linux-gnu/tegra -Wl,-rpath=/usr/lib/aarch64-linux-gnu/tegra -lnvbuf_utils|g' /usr/local/lib/pkgconfig/libavcodec.pc cat /usr/local/lib/pkgconfig/libavcodec.pc fi