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 --enable-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