FFmpeg-Builds/scripts.d/50-libjxl/45-brotli.sh
2022-12-02 16:21:37 +01:00

34 lines
1,018 B
Bash
Executable file

#!/bin/bash
SCRIPT_REPO="https://github.com/google/brotli.git"
SCRIPT_COMMIT="3914999fcc1fda92e750ef9190aa6db9bf7bdb07"
ffbuild_enabled() {
return 0
}
ffbuild_dockerbuild() {
git-mini-clone "$SCRIPT_REPO" "$SCRIPT_COMMIT" brotli
cd brotli
mkdir build && cd build
cmake -G Ninja -DCMAKE_TOOLCHAIN_FILE="$FFBUILD_CMAKE_TOOLCHAIN" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="$FFBUILD_PREFIX" -DCMAKE_POSITION_INDEPENDENT_CODE=ON ..
ninja -j$(nproc)
ninja install
# Build system is severely lacking in options, clean up after it
rm -r "${FFBUILD_PREFIX}"/bin
mv "${FFBUILD_PREFIX}"/lib/libbrotlienc{-static,}.a
mv "${FFBUILD_PREFIX}"/lib/libbrotlidec{-static,}.a
mv "${FFBUILD_PREFIX}"/lib/libbrotlicommon{-static,}.a
if [[ $TARGET == win* ]]; then
rm "${FFBUILD_PREFIX}"/lib/libbrotli*.dll.a
elif [[ $TARGET == linux* ]]; then
rm "${FFBUILD_PREFIX}"/lib/libbrotli*.so*
else
echo "Unknown target"
return -1
fi
}