Add libjxl for JPEG-XL support
This commit is contained in:
parent
aef227430c
commit
71b37989a5
2 changed files with 89 additions and 0 deletions
34
scripts.d/50-libjxl/45-brotli.sh
Executable file
34
scripts.d/50-libjxl/45-brotli.sh
Executable file
|
@ -0,0 +1,34 @@
|
|||
#!/bin/bash
|
||||
|
||||
BROTLI_REPO="https://github.com/google/brotli.git"
|
||||
BROTLI_COMMIT="f4153a09f87cbb9c826d8fc12c74642bb2d879ea"
|
||||
|
||||
ffbuild_enabled() {
|
||||
return 0
|
||||
}
|
||||
|
||||
ffbuild_dockerbuild() {
|
||||
git-mini-clone "$BROTLI_REPO" "$BROTLI_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
|
||||
}
|
55
scripts.d/50-libjxl/50-libjxl.sh
Executable file
55
scripts.d/50-libjxl/50-libjxl.sh
Executable file
|
@ -0,0 +1,55 @@
|
|||
#!/bin/bash
|
||||
|
||||
JXL_REPO="https://github.com/libjxl/libjxl.git"
|
||||
JXL_COMMIT="638ca594d54c0f9eb16a8c236770418750e4cbec"
|
||||
|
||||
ffbuild_enabled() {
|
||||
[[ $ADDINS_STR == *4.4* ]] && return -1
|
||||
[[ $ADDINS_STR == *5.0* ]] && return -1
|
||||
return 0
|
||||
}
|
||||
|
||||
ffbuild_dockerbuild() {
|
||||
git-mini-clone "$JXL_REPO" "$JXL_COMMIT" jxl
|
||||
cd jxl
|
||||
git submodule update --init --recursive --depth 1 --recommend-shallow third_party/{highway,skcms}
|
||||
|
||||
mkdir build && cd build
|
||||
|
||||
if [[ $TARGET == linux* ]]; then
|
||||
# our glibc is too old(<2.25), and their detection fails for some reason
|
||||
export CXXFLAGS="$CXXFLAGS -DVQSORT_GETRANDOM=0 -DVQSORT_SECURE_SEED=0"
|
||||
fi
|
||||
|
||||
cmake -G Ninja -DCMAKE_TOOLCHAIN_FILE="$FFBUILD_CMAKE_TOOLCHAIN" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="$FFBUILD_PREFIX" -DCMAKE_POSITION_INDEPENDENT_CODE=ON \
|
||||
-DBUILD_SHARED_LIBS=OFF -DJPEGXL_STATIC=OFF -DJPEGXL_ENABLE_TOOLS=OFF -DJPEGXL_ENABLE_VIEWERS=OFF -DJPEGXL_EMSCRIPTEN=OFF -DJPEGXL_ENABLE_DOXYGEN=OFF \
|
||||
-DBUILD_TESTING=OFF -DJPEGXL_ENABLE_EXAMPLES=OFF -DJPEGXL_ENABLE_MANPAGES=OFF -DJPEGXL_ENABLE_JNI=OFF -DJPEGXL_ENABLE_PLUGINS=OFF \
|
||||
-DJPEGXL_ENABLE_DEVTOOLS=OFF -DJPEGXL_ENABLE_BENCHMARK=OFF -DJPEGXL_BUNDLE_LIBPNG=OFF -DJPEGXL_ENABLE_SJPEG=OFF -DJPEGXL_FORCE_SYSTEM_BROTLI=ON ..
|
||||
ninja -j$(nproc)
|
||||
ninja install
|
||||
|
||||
echo "Cflags.private: -DJXL_STATIC_DEFINE=1" >> "${FFBUILD_PREFIX}"/lib/pkgconfig/libjxl.pc
|
||||
echo "Libs.private: -lstdc++" >> "${FFBUILD_PREFIX}"/lib/pkgconfig/libjxl.pc
|
||||
|
||||
echo "Cflags.private: -DJXL_STATIC_DEFINE=1" >> "${FFBUILD_PREFIX}"/lib/pkgconfig/libjxl_threads.pc
|
||||
echo "Libs.private: -lstdc++" >> "${FFBUILD_PREFIX}"/lib/pkgconfig/libjxl_threads.pc
|
||||
|
||||
if [[ $TARGET == win* ]]; then
|
||||
echo "Libs.private: -ladvapi32" >> "${FFBUILD_PREFIX}"/lib/pkgconfig/libjxl.pc
|
||||
echo "Libs.private: -ladvapi32" >> "${FFBUILD_PREFIX}"/lib/pkgconfig/libjxl_threads.pc
|
||||
|
||||
mv "${FFBUILD_PREFIX}"/lib/libjxl{-static,}.a
|
||||
mv "${FFBUILD_PREFIX}"/lib/libjxl_dec{-static,}.a
|
||||
mv "${FFBUILD_PREFIX}"/lib/libjxl_threads{-static,}.a
|
||||
fi
|
||||
}
|
||||
|
||||
ffbuild_configure() {
|
||||
echo --enable-libjxl
|
||||
}
|
||||
|
||||
ffbuild_unconfigure() {
|
||||
[[ $ADDINS_STR == *4.4* ]] && return 0
|
||||
[[ $ADDINS_STR == *5.0* ]] && return 0
|
||||
echo --disable-libjxl
|
||||
}
|
Loading…
Reference in a new issue