FFmpeg-Builds/scripts.d/50-rubberband.sh
2021-04-04 02:24:14 +02:00

61 lines
1.2 KiB
Bash
Executable file

#!/bin/bash
# https://breakfastquay.com/rubberband/
RUBBERBAND_SRC="https://breakfastquay.com/files/releases/rubberband-1.9.1.tar.bz2"
ffbuild_enabled() {
[[ $VARIANT == gpl* ]] || return -1
return 0
}
ffbuild_dockerstage() {
to_df "ADD $SELF /stage.sh"
to_df "RUN run_stage"
}
ffbuild_dockerbuild() {
mkdir rubberband
cd rubberband
wget "$RUBBERBAND_SRC" -O rubberband.tar.gz
tar xaf rubberband.tar.gz
rm rubberband.tar.gz
cd rubberband*
# Fix broken cross compilation
sed -i 's/build_machine.system/host_machine.system/' meson.build
mkdir build && cd build
local myconf=(
--prefix="$FFBUILD_PREFIX"
-Dno_shared=true
)
if [[ $TARGET == win* ]]; then
myconf+=(
--cross-file=/cross.meson
)
else
echo "Unknown target"
return -1
fi
meson "${myconf[@]}" ..
ninja -j$(nproc)
ninja install
# Fix static linking
echo "Requires.private: fftw3 samplerate" >> "$FFBUILD_PREFIX"/lib/pkgconfig/rubberband.pc
cd ../../..
rm -rf rubberband
}
ffbuild_configure() {
echo --enable-librubberband
}
ffbuild_unconfigure() {
echo --disable-librubberband
}