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
|
|
|
|
}
|
|
|
|
|
2023-06-18 14:44:57 +00:00
|
|
|
ffbuild_dockerbuild() {
|
2023-06-18 19:25:50 +00:00
|
|
|
cd "$FFBUILD_DLDIR/$SELF"
|
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
|
|
|
|
}
|