Files
BMLFS/build-scripts/openjpeg.build
2024-08-18 15:04:19 -05:00

54 lines
1.7 KiB
Bash

#! /bin/bash
# OpenJPEG
# Source: https://github.com/uclouvain/openjpeg/archive/v2.5.2/openjpeg-2.5.2.tar.gz
#
# $BUILD = Directory to temporarily install
# $PKGS = Directory to store built packages
#
# DEPS
# Required: CMake
# Recommended: NONE
# Optional: LCMS, libpng, libTiff, Doxygen
# If coptimizing with GCC:
export CFLAGS="-march=native -pipe "
export CFLAGS+="-O3 -ffat-lto-objects -flto=4 -fstack-protector-strong "
export CFLAGS+="-fzero-call-used-regs=used "
export CXXFLAGS=$CFLAGS
export LDFLAGS="-flto=4 -Wl,-O2 -Wl,--as-needed "
cmake -B OUT \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr \
-DBUILD_STATIC_LIBS=OFF &&
read -p "Compile?" && make -C OUT -j2 &&
sudo -S make DESTDIR=$BUILD -C OUT install &&
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------------------------------------------------------|
openjpeg: openjpeg (JPEG2000 Codec)
openjpeg:
openjpeg: The OpenJPEG library is an open-source JPEG 2000 codec.
openjpeg:
openjpeg: Homepage: http://www.openjpeg.org
openjpeg:
openjpeg:
openjpeg:
openjpeg:
openjpeg:
openjpeg:
EOF
sudo -S mv -v /tmp/slack-desc install/ &&
sudo -S makepkg -l y -c n $PKGS/openjpeg-2.5.2-$PSUFFIX &&
sudo -S rm -rf ${BUILD}/*