From d3542108962870b6a359442294b60b72d194c2e4 Mon Sep 17 00:00:00 2001 From: BtbN Date: Sun, 6 Sep 2020 21:55:59 +0200 Subject: [PATCH] Add soxr --- build.sh | 4 +++- scripts.d/50-soxr.sh | 43 +++++++++++++++++++++++++++++++++++++++++++ util/vars.sh | 8 ++++++++ 3 files changed, 54 insertions(+), 1 deletion(-) create mode 100755 scripts.d/50-soxr.sh diff --git a/build.sh b/build.sh index 5b7f16f..28c48b2 100755 --- a/build.sh +++ b/build.sh @@ -25,12 +25,14 @@ for script in scripts.d/*.sh; do FF_CFLAGS+=" $(get_output $script cflags)" FF_CXXFLAGS+=" $(get_output $script cxxflags)" FF_LDFLAGS+=" $(get_output $script ldflags)" + FF_LIBS+=" $(get_output $script libs)" done FF_CONFIGURE="$(xargs <<< "$FF_CONFIGURE")" FF_CFLAGS="$(xargs <<< "$FF_CFLAGS")" FF_CXXFLAGS="$(xargs <<< "$FF_CXXFLAGS")" FF_LDFLAGS="$(xargs <<< "$FF_LDFLAGS")" +FF_LIBS="$(xargs <<< "$FF_LIBS")" rm -rf ffbuild mkdir ffbuild @@ -44,7 +46,7 @@ docker run --rm -i -u "$(id -u):$(id -g)" -v $PWD/ffbuild:/ffbuild "$IMAGE" bash cd ffmpeg git checkout $GIT_BRANCH - ./configure --prefix=/ffbuild/prefix --pkg-config-flags="--static" \$FFBUILD_TARGET_FLAGS $FF_CONFIGURE --extra-cflags="$FF_CFLAGS" --extra-cxxflags="$FF_CXXFLAGS" --extra-ldflags="$FF_LDFLAGS" + ./configure --prefix=/ffbuild/prefix --pkg-config-flags="--static" \$FFBUILD_TARGET_FLAGS $FF_CONFIGURE --extra-cflags="$FF_CFLAGS" --extra-cxxflags="$FF_CXXFLAGS" --extra-ldflags="$FF_LDFLAGS" --extra-libs="$FF_LIBS" make -j\$(nproc) make install EOF diff --git a/scripts.d/50-soxr.sh b/scripts.d/50-soxr.sh new file mode 100755 index 0000000..a770bbd --- /dev/null +++ b/scripts.d/50-soxr.sh @@ -0,0 +1,43 @@ +#!/bin/bash + +SOXR_REPO="https://git.code.sf.net/p/soxr/code" +SOXR_COMMIT="945b592b70470e29f917f4de89b4281fbbd540c0" + +ffbuild_enabled() { + return 0 +} + +ffbuild_dockerstage() { + to_df "ADD $SELF /stage.sh" + to_df "RUN run_stage" +} + +ffbuild_dockerbuild() { + git-mini-clone "$SOXR_REPO" "$SOXR_COMMIT" soxr + cd soxr + + mkdir build && cd build + + cmake -DCMAKE_TOOLCHAIN_FILE="$FFBUILD_CMAKE_TOOLCHAIN" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="$FFBUILD_PREFIX" -DBUILD_TESTS=OFF -DBUILD_EXAMPLES=OFF -DBUILD_SHARED_LIBS=OFF .. + make -j$(nproc) + make install + + cd ../.. + rm -rf soxr +} + +ffbuild_configure() { + echo --enable-libsoxr +} + +ffbuild_unconfigure() { + echo --disable-libsoxr +} + +ffbuild_ldflags() { + echo -pthread +} + +ffbuild_libs() { + echo -lgomp +} diff --git a/util/vars.sh b/util/vars.sh index 13b6253..94ca7e2 100644 --- a/util/vars.sh +++ b/util/vars.sh @@ -41,3 +41,11 @@ ffbuild_ldflags() { ffbuild_unldflags() { return 0 } + +ffbuild_libs() { + return 0 +} + +ffbuild_unlibs() { + return 0 +}