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-04-18 14:23:16 +00:00
|
|
|
SCRIPT_COMMIT="80d0ff2df4785e0d3b0050205541914faffd583d"
|
2020-09-05 15:52:40 +00:00
|
|
|
|
|
|
|
ffbuild_enabled() {
|
|
|
|
[[ $TARGET == win32 ]] && return -1
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
|
|
|
ffbuild_dockerbuild() {
|
2022-07-12 15:54:12 +00:00
|
|
|
git-mini-clone "$SCRIPT_REPO" "$SCRIPT_COMMIT" rav1e
|
2021-04-04 02:08:20 +00:00
|
|
|
cd rav1e
|
2020-09-05 15:52:40 +00:00
|
|
|
|
2021-05-13 00:17:17 +00:00
|
|
|
local myconf=(
|
2022-11-06 13:06:20 +00:00
|
|
|
--prefix="$FFBUILD_PREFIX"
|
|
|
|
--library-type=staticlib
|
|
|
|
--crt-static
|
|
|
|
--release
|
2021-05-13 00:17:17 +00:00
|
|
|
)
|
|
|
|
|
2022-08-16 15:10:37 +00:00
|
|
|
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
|
|
|
|
|
2022-08-16 15:10:37 +00:00
|
|
|
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"
|
2022-08-16 15:10:37 +00:00
|
|
|
EOF
|
|
|
|
fi
|
2022-05-09 22:15:31 +00:00
|
|
|
|
2022-08-16 15:10:37 +00:00
|
|
|
cargo cinstall -v "${myconf[@]}"
|
2023-01-29 13:09:53 +00:00
|
|
|
|
|
|
|
chmod 644 "${FFBUILD_PREFIX}"/lib/*rav1e*
|
2020-09-05 15:52:40 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
ffbuild_configure() {
|
|
|
|
echo --enable-librav1e
|
|
|
|
}
|
|
|
|
|
|
|
|
ffbuild_unconfigure() {
|
|
|
|
echo --disable-librav1e
|
|
|
|
}
|