Files
BMLFS/build-scripts/libjxl.build
2024-02-12 10:08:31 -06:00

57 lines
1.9 KiB
Bash

#! /bin/bash
# libjxl - libJPEGXL
# Source: https://github.com/libjxl/libjxl/archive/refs/tags/v0.9.2.tar.gz
#
# $BUILD = Directory to temporarily install
# $PKGS = Directory to store built packages
#
# DEPS
# Required: cmake brotli gfk-pix-buf giflib lcms2 libjpeg-turbo libpng
# Required: highway
# Recommended: NONE
# Optional: gtest ascidoc
patch -Np1 -i ../patches/libjxl-alpine/no-werror.patch
cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr \
-DBUILD_TESTING=OFF \
-DJPEGXL_ENABLE_PLUGINS=ON \
-DJPEGXL_ENABLE_PLUGIN_GIMP210=OFF \
-DJPEGXL_ENABLE_BENCHMARK=OFF \
-DJPEGXL_ENABLE_COVERAGE=OFF \
-DJPEGXL_ENABLE_EXAMPLES=OFF \
-DJPEGXL_ENABLE_FUZZERS=OFF -DJPEGXL_ENABLE_SJPEG=OFF \
-DJPEGXL_ENABLE_SKCMS=OFF -DJPEGXL_ENABLE_VIEWERS=OFF \
-DJPEGXL_FORCE_SYSTEM_GTEST=OFF -DJPEGXL_FORCE_SYSTEM_BROTLI=ON \
-DJPEGXL_FORCE_SYSTEM_HWY=OFF
# Per Alpine Linux, workaround for https://gitlab.kitware.com/cmake/cmake/-/issues/25526
mkdir build/lib/CMakeFiles/jxl_export.dir
read -p "Compile?" && cmake --build build &&
sudo -S DESTDIR=$BUILD cmake --install build --strip &&
cd $BUILD && sudo -S mkdir -v ${BUILD}/install &&
cat > /tmp/slack-desc << "EOF"
# HOW TO EDIT THIS FILE:
# The "handy ruler" below makes it easier to edit a package description. Line
# up the first '|' above the ':' following the base package name, and the '|'
# on the right side marks the last column you can put a character in. You must
# make exactly 11 lines for the formatting to be correct. It's also
# customary to leave one space after the ':' except on otherwise blank lines.
|-----handy-ruler------------------------------------------------------|
libjxl: libjxl
libjxl:
libjxl: JPEG XL image format reference implementation library
libjxl:
libjxl: https://jpeg.org/jpegxl
libjxl:
EOF
sudo -S mv -v /tmp/slack-desc install/ &&
sudo -S makepkg -l y -c n $PKGS/libjxl-0.9.2-$PSUFFIX &&
sudo -S rm -rf ${BUILD}/*