From ee89e8c29b37ca2439e66a401f979cc5daee552e Mon Sep 17 00:00:00 2001 From: BtbN Date: Sun, 20 Sep 2020 00:46:24 +0200 Subject: [PATCH] Add opencore-amr --- scripts.d/50-opencore-amr.sh | 57 ++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100755 scripts.d/50-opencore-amr.sh diff --git a/scripts.d/50-opencore-amr.sh b/scripts.d/50-opencore-amr.sh new file mode 100755 index 0000000..96c139d --- /dev/null +++ b/scripts.d/50-opencore-amr.sh @@ -0,0 +1,57 @@ +#!/bin/bash + +OAMR_SRC="https://sourceforge.net/projects/opencore-amr/files/opencore-amr/opencore-amr-0.1.5.tar.gz/download" + +ffbuild_enabled() { + return 0 +} + +ffbuild_dockerstage() { + to_df "ADD $SELF /stage.sh" + to_df "RUN run_stage" +} + +ffbuild_dockerbuild() { + mkdir opencore + cd opencore + wget -O opencore.tar.gz "$OAMR_SRC" + tar xaf opencore.tar.gz + rm opencore.tar.gz + cd opencore* + + autoreconf -i + + local myconf=( + --prefix="$FFBUILD_PREFIX" + --disable-shared + --enable-static + --with-pic + --enable-amrnb-encoder + --enable-amrnb-decoder + --disable-examples + ) + + if [[ $TARGET == win* ]]; then + myconf+=( + --host="$FFBUILD_TOOLCHAIN" + ) + else + echo "Unknown target" + return -1 + fi + + ./configure "${myconf[@]}" + make -j$(nproc) + make install + + cd .. + rm -rf opencore +} + +ffbuild_configure() { + echo --enable-libopencore-amrnb --enable-libopencore-amrwb +} + +ffbuild_unconfigure() { + echo --disable-libopencore-amrnb --disable-libopencore-amrwb +}