Skip to content

Commit

Permalink
linuxarm64: enable rkmpp and rkrga for portable builds (#403)
Browse files Browse the repository at this point in the history
  • Loading branch information
bjia56 authored Jul 24, 2024
1 parent e108294 commit ffb3842
Show file tree
Hide file tree
Showing 3 changed files with 89 additions and 2 deletions.
36 changes: 36 additions & 0 deletions builder/scripts.d/50-rkmpp.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/bin/bash

SCRIPT_REPO="https://github.com/nyanmisaka/mpp.git"
SCRIPT_COMMIT="66af270e1e54432d0767cf929a5c4aee2b456d8c"

ffbuild_enabled() {
[[ $TARGET == linux* ]] && [[ $TARGET == *arm64 ]] && return 0
return -1
}

ffbuild_dockerbuild() {
git-mini-clone "$SCRIPT_REPO" "$SCRIPT_COMMIT" rkmpp
cd rkmpp

mkdir rkmpp_build && cd rkmpp_build

cmake -GNinja \
-DCMAKE_TOOLCHAIN_FILE="$FFBUILD_CMAKE_TOOLCHAIN" \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX="$FFBUILD_PREFIX" \
-DBUILD_TEST=OFF \
-DBUILD_SHARED_LIBS=OFF ..

ninja -j$(nproc)
ninja install

echo "Libs.private: -lstdc++" >> "$FFBUILD_PREFIX"/lib/pkgconfig/rockchip_mpp.pc
}

ffbuild_configure() {
echo --enable-rkmpp
}

ffbuild_unconfigure() {
echo --disable-rkmpp
}
51 changes: 51 additions & 0 deletions builder/scripts.d/50-rkrga.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
#!/bin/bash

SCRIPT_REPO="https://github.com/nyanmisaka/rk-mirrors.git"
SCRIPT_COMMIT="a9fc19e6b906d7cecd6bcefbd45e5e151831d33f"

ffbuild_enabled() {
[[ $TARGET == linux* ]] && [[ $TARGET == *arm64 ]] && return 0
return -1
}

ffbuild_dockerbuild() {
git-mini-clone "$SCRIPT_REPO" "$SCRIPT_COMMIT" rkrga
cd rkrga

sed -i 's/shared_library/library/g' meson.build

mkdir rkrga_build && cd rkrga_build

local myconf=(
--prefix="$FFBUILD_PREFIX"
--buildtype=release
--default-library=static
-Dcpp_args=-fpermissive
-Dlibdrm=false
-Dlibrga_demo=false
)

if [[ $TARGET == linux* ]]; then
myconf+=(
--cross-file=/cross.meson
)
else
echo "Unknown target"
return -1
fi

meson "${myconf[@]}" ..

ninja -j$(nproc)
ninja install

echo "Libs.private: -lstdc++" >> "$FFBUILD_PREFIX"/lib/pkgconfig/librga.pc
}

ffbuild_configure() {
echo --enable-rkrga
}

ffbuild_unconfigure() {
echo --disable-rkrga
}
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,8 @@ Index: jellyfin-ffmpeg/configure
{ enabled libdrm ||
die "ERROR: rkmpp requires --enable-libdrm"; }
}
+enabled rkrga && require rkrga rga/RgaApi.h c_RkRgaBlit -lrga &&
+ { require rkrga rga/im2d.h querystring -lrga &&
+enabled rkrga && require_pkg_config rkrga librga rga/RgaApi.h c_RkRgaBlit &&
+ { require_pkg_config rkrga librga rga/im2d.h querystring &&
+ { enabled rkmpp ||
+ die "ERROR: rkrga requires --enable-rkmpp"; }
+ }
Expand Down

0 comments on commit ffb3842

Please sign in to comment.