FFmpeg-Builds/scripts.d/50-rav1e.sh

56 lines
1.2 KiB
Bash
Raw Permalink Normal View History

2020-09-05 15:52:40 +00:00
#!/bin/bash
2022-07-12 15:54:12 +00:00
SCRIPT_REPO="https://github.com/xiph/rav1e.git"
2023-07-08 15:37:10 +00:00
SCRIPT_COMMIT="5ec4f95d9fe1a9295fe8239e2860c8f84e5e2336"
2020-09-05 15:52:40 +00:00
ffbuild_enabled() {
[[ $TARGET == win32 ]] && return -1
return 0
}
ffbuild_dockerbuild() {
cd "$FFBUILD_DLDIR/$SELF"
2020-09-05 15:52:40 +00:00
local myconf=(
2022-11-06 13:06:20 +00:00
--prefix="$FFBUILD_PREFIX"
--library-type=staticlib
--crt-static
--release
)
if [[ -n "$FFBUILD_RUST_TARGET" ]]; then
2022-09-12 20:46:28 +00:00
unset PKG_CONFIG_LIBDIR
2022-09-12 19:27:05 +00:00
2022-09-12 21:47:09 +00:00
export CC="gcc"
export CXX="g++"
export TARGET_CC="${FFBUILD_CROSS_PREFIX}gcc"
export TARGET_CXX="${FFBUILD_CROSS_PREFIX}g++"
export CROSS_COMPILE=1
export TARGET_CFLAGS="$CFLAGS"
export TARGET_CXXFLAGS="$CFLAGS"
unset CFLAGS
unset CXXFLAGS
myconf+=(
--target="$FFBUILD_RUST_TARGET"
)
cat <<EOF >$CARGO_HOME/config.toml
[target.$FFBUILD_RUST_TARGET]
2022-09-12 20:46:28 +00:00
linker = "${FFBUILD_CROSS_PREFIX}gcc"
2022-09-12 19:27:05 +00:00
ar = "${FFBUILD_CROSS_PREFIX}ar"
EOF
fi
2022-05-09 22:15:31 +00:00
cargo cinstall -v "${myconf[@]}"
chmod 644 "${FFBUILD_PREFIX}"/lib/*rav1e*
2020-09-05 15:52:40 +00:00
}
ffbuild_configure() {
echo --enable-librav1e
}
ffbuild_unconfigure() {
echo --disable-librav1e
}