ultra fix more and more files
This commit is contained in:
88
scripts/build-deps-ffmpeg.sh
Executable file
88
scripts/build-deps-ffmpeg.sh
Executable file
@@ -0,0 +1,88 @@
|
||||
|
||||
set -e
|
||||
|
||||
BASE_FFMPEG_ARGS="--fatal-warnings --enable-pic --enable-static --disable-shared --disable-all --disable-vulkan --enable-avcodec --enable-swscale --enable-decoder=h264 --enable-decoder=hevc --enable-decoder=av1 --enable-libdav1d --enable-decoder=libdav1d --enable-libdrm --enable-decoder=h264_v4l2m2m --enable-decoder=hevc_v4l2m2m --extra-cflags=-I/usr/include/libdrm"
|
||||
USE_PLATFORM_FFMPEG=0
|
||||
RKMPP="--prefix=/usr --enable-gpl --enable-version3 --enable-libdrm --enable-rkmpp --enable-rkrga"
|
||||
|
||||
echo "Building dependencies for $TARGET"
|
||||
|
||||
# Build and install our SDL2 build
|
||||
# Получаем все нужные пути через pkg-config автоматически
|
||||
# Это добавит и FreeType, и HarfBuzz, и SDL2
|
||||
export CFLAGS="$(pkg-config --cflags freetype2 harfbuzz sdl2) -O2 -g"
|
||||
export LDFLAGS="$(pkg-config --libs freetype2 harfbuzz sdl2)"
|
||||
export CXXFLAGS="-O2 -g"
|
||||
|
||||
cd /opt/SDL2
|
||||
./configure --enable-static --enable-shared --enable-video-kmsdrm --disable-video-rpi --disable-freetype-builtin --disable-harfbuzz-builtin
|
||||
make -j8
|
||||
cat sdl2.pc
|
||||
make install
|
||||
|
||||
# Build and install SDL_ttf
|
||||
# Since we'll be linking statically, we need to use Libs.private instead of Libs, but
|
||||
# there's no way to tell QMake to use the Libs.private section, so we have to replace
|
||||
# Libs with Libs.private ourselves prior to installation.
|
||||
|
||||
|
||||
export CPPFLAGS="$(pkg-config --cflags freetype2 harfbuzz)"
|
||||
export LDFLAGS="$(pkg-config --libs-only-L freetype2 harfbuzz)"
|
||||
export LIBS="$(pkg-config --libs-only-l freetype2 harfbuzz)"
|
||||
|
||||
cd /opt/SDL_ttf
|
||||
./autogen.sh
|
||||
./configure --enable-static --disable-shared --disable-freetype-builtin --disable-harfbuzz-builtin
|
||||
make -j8
|
||||
sed -i 's/-lSDL2_ttf/-lSDL2_ttf -lfreetype/g' SDL2_ttf.pc
|
||||
cat SDL2_ttf.pc
|
||||
make install
|
||||
|
||||
# Build MPP
|
||||
cd /opt/rkmpp
|
||||
mkdir rkmpp_build
|
||||
cd rkmpp_build
|
||||
cmake \
|
||||
-DCMAKE_INSTALL_PREFIX=/usr \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DBUILD_SHARED_LIBS=ON \
|
||||
-DBUILD_TEST=OFF \
|
||||
..
|
||||
make -j8
|
||||
make install
|
||||
|
||||
# Build RGA
|
||||
cd /opt
|
||||
meson setup rkrga rkrga_build \
|
||||
--prefix=/usr \
|
||||
--libdir=lib \
|
||||
--buildtype=release \
|
||||
--default-library=shared \
|
||||
-Dcpp_args=-fpermissive \
|
||||
-Dlibdrm=false \
|
||||
-Dlibrga_demo=false
|
||||
meson configure rkrga_build
|
||||
ninja -C rkrga_build install
|
||||
|
||||
# Build FFmpeg and its dependencies if we're not using the platform version
|
||||
|
||||
# Build and install libdav1d
|
||||
cd /opt/dav1d
|
||||
meson setup build -Ddefault_library=static -Dbuildtype=debugoptimized -Denable_tools=false -Denable_tests=false
|
||||
ninja -C build
|
||||
ninja install -C build
|
||||
|
||||
# FFmpeg's architecture detection uses 'uname -m' which will be incorrect when
|
||||
# natively executing a different hardware-compatible ABI (like armhf on aarch64
|
||||
# or i686 on x86_64). We have to override that detection ourselves here.
|
||||
FFMPEG_ARCH=$(dpkg --print-architecture)
|
||||
if [ "$FFMPEG_ARCH" == "armhf" ]; then
|
||||
# Most dpkg architectures are handled by FFmpeg, but armhf is a special case
|
||||
FFMPEG_ARCH=arm
|
||||
fi
|
||||
|
||||
# Build and install FFmpeg
|
||||
cd /opt/ffmpeg
|
||||
./configure --arch=$FFMPEG_ARCH $RKMPP $BASE_FFMPEG_ARGS $DAV1D_FFMPEG_ARGS #$EXTRA_FFMPEG_ARGS
|
||||
make -j8
|
||||
make install
|
||||
@@ -1,65 +1,40 @@
|
||||
|
||||
set -e
|
||||
|
||||
BASE_FFMPEG_ARGS="--fatal-warnings --enable-pic --enable-static --disable-shared --disable-all --disable-vulkan --enable-avcodec --enable-swscale --enable-decoder=h264 --enable-decoder=hevc --enable-decoder=av1 --enable-libdav1d --enable-decoder=libdav1d --enable-libdrm --enable-decoder=h264_v4l2m2m --enable-decoder=hevc_v4l2m2m --extra-cflags=-I/usr/include/libdrm"
|
||||
USE_PLATFORM_FFMPEG=0
|
||||
|
||||
echo "Building dependencies for $TARGET"
|
||||
if [ "$TARGET" == "rpi" ] || [ "$TARGET" == "rpi64" ]; then
|
||||
# Use the platform-provided FFmpeg version on Raspberry Pi OS
|
||||
USE_PLATFORM_FFMPEG=1
|
||||
elif [ "$TARGET" == "l4t" ]; then
|
||||
# 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
|
||||
# Enable VAAPI and VDPAU decoders (TODO: Add Vulkan Video if we ever actually ship this for desktop platforms)
|
||||
EXTRA_FFMPEG_ARGS="--enable-hwaccel=h264_vaapi --enable-hwaccel=hevc_vaapi --enable-hwaccel=av1_vaapi --enable-hwaccel=h264_vdpau --enable-hwaccel=hevc_vdpau --enable-hwaccel=av1_vdpau"
|
||||
elif [ "$TARGET" == "embedded" ]; then
|
||||
# Enable stateless V4L2 support
|
||||
EXTRA_FFMPEG_ARGS="--enable-v4l2-request --enable-hwaccel=h264_v4l2request --enable-hwaccel=hevc_v4l2request --enable-hwaccel=av1_v4l2request"
|
||||
else
|
||||
echo "Unrecognized target: $TARGET"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Build and install our SDL2 build
|
||||
cd /opt/SDL2
|
||||
./configure --enable-static --disable-shared --enable-video-kmsdrm --disable-video-rpi
|
||||
make -j$(nproc)
|
||||
|
||||
#export CFLAGS="-I/usr/include/freetype2 -O2 -g"
|
||||
#export LDFLAGS="-L/usr/local/lib"
|
||||
# Получаем все нужные пути через pkg-config автоматически
|
||||
# Это добавит и FreeType, и HarfBuzz, и SDL2
|
||||
export CFLAGS="$(pkg-config --cflags freetype2 harfbuzz sdl2) -O2 -g"
|
||||
export LDFLAGS="$(pkg-config --libs freetype2 harfbuzz sdl2)"
|
||||
export CXXFLAGS="-O2 -g"
|
||||
|
||||
./configure --enable-static --enable-shared --enable-video-kmsdrm --disable-video-rpi --disable-freetype-builtin --disable-harfbuzz-builtin
|
||||
make -j8
|
||||
cat sdl2.pc
|
||||
make install
|
||||
|
||||
export CPPFLAGS="$(pkg-config --cflags freetype2 harfbuzz)"
|
||||
export LDFLAGS="$(pkg-config --libs-only-L freetype2 harfbuzz)"
|
||||
export LIBS="$(pkg-config --libs-only-l freetype2 harfbuzz)"
|
||||
|
||||
# Build and install SDL_ttf
|
||||
# Since we'll be linking statically, we need to use Libs.private instead of Libs, but
|
||||
# there's no way to tell QMake to use the Libs.private section, so we have to replace
|
||||
# Libs with Libs.private ourselves prior to installation.
|
||||
cd /opt/SDL_ttf
|
||||
./autogen.sh
|
||||
./configure --enable-static --disable-shared
|
||||
make -j$(nproc)
|
||||
./configure --enable-static --disable-shared --disable-freetype-builtin --disable-harfbuzz-builtin
|
||||
make -j8
|
||||
sed -i 's/-lSDL2_ttf/-lSDL2_ttf -lfreetype/g' SDL2_ttf.pc
|
||||
cat SDL2_ttf.pc
|
||||
make install
|
||||
|
||||
# Build FFmpeg and its dependencies if we're not using the platform version
|
||||
if [ "$USE_PLATFORM_FFMPEG" == "0" ]; then
|
||||
# Build and install libdav1d
|
||||
cd /opt/dav1d
|
||||
meson setup build -Ddefault_library=static -Dbuildtype=debugoptimized -Denable_tools=false -Denable_tests=false
|
||||
ninja -C build
|
||||
ninja install -C build
|
||||
|
||||
# FFmpeg's architecture detection uses 'uname -m' which will be incorrect when
|
||||
# natively executing a different hardware-compatible ABI (like armhf on aarch64
|
||||
# or i686 on x86_64). We have to override that detection ourselves here.
|
||||
FFMPEG_ARCH=$(dpkg --print-architecture)
|
||||
if [ "$FFMPEG_ARCH" == "armhf" ]; then
|
||||
# Most dpkg architectures are handled by FFmpeg, but armhf is a special case
|
||||
FFMPEG_ARCH=arm
|
||||
fi
|
||||
|
||||
# Build and install FFmpeg
|
||||
cd /opt/FFmpeg
|
||||
./configure --arch=$FFMPEG_ARCH $BASE_FFMPEG_ARGS $EXTRA_FFMPEG_ARGS $DAV1D_FFMPEG_ARGS
|
||||
make -j$(nproc)
|
||||
make install
|
||||
fi
|
||||
# Build and install libdav1d
|
||||
cd /opt/dav1d
|
||||
meson setup build -Ddefault_library=static -Dbuildtype=debugoptimized -Denable_tools=false -Denable_tests=false
|
||||
ninja -C build
|
||||
ninja install -C build
|
||||
|
||||
@@ -1,31 +1,21 @@
|
||||
|
||||
set -e
|
||||
|
||||
# Check out the source without the Windows/Mac prebuilts
|
||||
[[ ! -z "$COMMIT" ]] || COMMIT="master"
|
||||
COMMIT="master"
|
||||
echo "Checking out $COMMIT"
|
||||
git clone https://github.com/moonlight-stream/moonlight-qt.git
|
||||
cd moonlight-qt
|
||||
git checkout $COMMIT
|
||||
git log -1
|
||||
git -c submodule.libs.update=none submodule update --init --recursive
|
||||
#git clone https://git.byte-mate.ru/drholy/moonlight-qt.git
|
||||
cd /opt/moonlight-qt
|
||||
#git checkout $COMMIT
|
||||
#git log -1
|
||||
#git -c submodule.libs.update=none submodule update --init --recursive
|
||||
|
||||
ldconfig
|
||||
|
||||
# Grab the verson metadata
|
||||
VERSION=`cat app/version.txt`
|
||||
|
||||
# Determine extra target-specific dependencies
|
||||
if [ "$TARGET" == "rpi" ] || [ "$TARGET" == "rpi64" ]; then
|
||||
EXTRA_CONFIG="CONFIG+=gpuslow CONFIG+=disable-mmal"
|
||||
EXTRA_BUILD_DEPS="libavcodec-dev, libavformat-dev, libswscale-dev,"
|
||||
elif [ "$TARGET" == "l4t" ]; then
|
||||
:
|
||||
elif [ "$TARGET" == "desktop" ]; then
|
||||
EXTRA_BUILD_DEPS="libva-dev, libvdpau-dev,"
|
||||
elif [ "$TARGET" == "embedded" ]; then
|
||||
EXTRA_CONFIG="CONFIG+=gpuslow"
|
||||
else
|
||||
echo "Unrecognized target: $TARGET"
|
||||
exit 1
|
||||
fi
|
||||
EXTRA_CONFIG="CONFIG+=gpuslow"
|
||||
|
||||
# Jammy requires libqt6opengl6-dev to use Qt Quick Controls
|
||||
if [ "$DISTRO" == "jammy" ]; then
|
||||
@@ -65,6 +55,16 @@ sed -i "s/EXTRA_CONFIG/$EXTRA_CONFIG/g" debian/rules
|
||||
cat debian/rules
|
||||
|
||||
# Build the package
|
||||
export DEB_BUILD_OPTIONS="parallel=1"
|
||||
export DEB_CFLAGS_APPEND="-O1"
|
||||
export DEB_CXXFLAGS_APPEND="-O1"
|
||||
# Указываем pkg-config искать библиотеки в папках, куда мы их ставили
|
||||
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/local/share/pkgconfig:/usr/lib/aarch64-linux-gnu/pkgconfig
|
||||
# Помогаем линковщику найти сами файлы .a / .so
|
||||
export LDFLAGS="-L/usr/local/lib -Wl,-rpath,/usr/local/lib $LDFLAGS"
|
||||
export LIBS="-lharfbuzz $LIBS"
|
||||
export CPPFLAGS="-I/usr/local/include $CPPFLAGS"
|
||||
ldconfig
|
||||
debuild -us -uc
|
||||
|
||||
# Copy the output to the out directory
|
||||
|
||||
@@ -3,8 +3,12 @@ set -e
|
||||
export DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
apt-get update
|
||||
apt-get install -y curl g++ make ninja-build devscripts fakeroot debhelper git nasm libgbm-dev libdrm-dev libasound2-dev libdbus-1-dev libegl1-mesa-dev libgl1-mesa-dev libgles2-mesa-dev libglu1-mesa-dev libibus-1.0-dev libpulse-dev libudev-dev libx11-dev libxcursor-dev libxext-dev libxi-dev libxinerama-dev libxkbcommon-dev libxrandr-dev libxss-dev libxt-dev libxv-dev libxxf86vm-dev cmake libgl-dev meson wayland-protocols libwayland-dev libdecor-0-dev libfreetype-dev libpipewire-0.3-dev
|
||||
apt-get install -y --no-install-recommends libssl-dev qt6-base-dev qt6-declarative-dev libqt6svg6-dev libopus-dev gnupg
|
||||
apt-get install -y --no-install-recommends \
|
||||
python3-requests python3-urllib3 libgdk-pixbuf-2.0-0 && \
|
||||
apt-get install -f -y && \
|
||||
dpkg --configure -a
|
||||
apt-get install -f -y autoconf curl g++ make ninja-build devscripts fakeroot debhelper git nasm libgbm-dev libdrm-dev libasound2-dev libdbus-1-dev libegl1-mesa-dev libgl1-mesa-dev libgles2-mesa-dev libglu1-mesa-dev libibus-1.0-dev libpulse-dev libudev-dev libx11-dev libxcursor-dev libxext-dev libxi-dev libxinerama-dev libxkbcommon-dev libxrandr-dev libxss-dev libxt-dev libxv-dev libxxf86vm-dev cmake libgl-dev meson wayland-protocols libwayland-dev libdecor-0-dev libfreetype-dev libfreetype6-dev libharfbuzz-dev libpipewire-0.3-dev
|
||||
apt-get install -f -y --no-install-recommends libssl-dev qt6-base-dev qt6-declarative-dev libqt6svg6-dev libopus-dev gnupg
|
||||
|
||||
# Install FFmpeg if we're using the OS-provided version
|
||||
if [ "$TARGET" == "rpi" ] || [ "$TARGET" == "rpi64" ]; then
|
||||
|
||||
Reference in New Issue
Block a user