Files
BMLFS/build-scripts/libwebp.build
2024-08-18 15:01:42 -05:00

76 lines
2.8 KiB
Bash

#! /bin/bash
# libwebp
# Source: https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-1.4.0.tar.gz
#
# $BUILD = Directory to temporarily install
# $PKGS = Directory to store built packages
#
# DEPS
# Required: NONE
# Recommended: libjpeg-turbo, libpng, LibTIFF, and SDL
# Optional: Freeglut and giflib
# If optimizing, use these flags with GCC
export CFLAGS="-march=native -pipe "
export CFLAGS+="-O3 -Ofast -falign-functions=32 "
export CFLAGS+="-ffat-lto-objects -flto=auto "
export CFLAGS+="-fno-semantic-interposition -fstack-protector-strong "
export CFLAGS+="-fzero-call-used-regs=used -mprefer-vector-width=256 "
export CXXFLAGS=$CFLAGS
export LDFLAGS="-flto=auto -Wl,-O2 -Wl,--as-needed "
#./autogen.sh &&
./configure --prefix=/usr \
--enable-libwebpmux \
--enable-libwebpdemux \
--enable-libwebpdecoder \
--enable-libwebpextras \
--enable-swap-16bit-csp \
--disable-static $BUILDTRUPLE &&
read -p "Compile?" && make -j2 &&
sudo -S make DESTDIR=$BUILD install &&
sudo -S mkdir /BMAN/install && \
sudo -S mkdir /BMAN/usr && \
sudo -S mv $BUILD/usr/share /BMAN/usr/ && \
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------------------------------------------------------|
libwebp: libwebp (WebP photo compression library)
libwebp:
libwebp: WebP is a method of lossy compression that can be used on
libwebp: photographic images. The degree of compression is adjustable so a
libwebp: user can choose the trade-off between file size and image quality.
libwebp: WebP typically achieves an average of 39% more compression than
libwebp: JPEG and JPEG 2000, without loss of image quality.
libwebp:
libwebp: Homepage: https://developers.google.com/speed/webp/
libwebp:
libwebp:
EOF
sudo -S mv -v /tmp/slack-desc install/ &&
sudo -S makepkg -l y -c n $PKGS/libwebp-1.4.0-$PSUFFIX &&
cd /BMAN
cat > /tmp/slack-desc << "EOF"
libwebp-doc: Manuals for libwebp (WebP photo compression library)
libwebp-doc:
libwebp-doc: WebP is a method of lossy compression that can be used on
libwebp-doc: photographic images.
libwebp-doc:
libwebp-doc: https://developers.google.com/speed/webp/
libwebp-doc:
EOF
sudo -S mv -v /tmp/slack-desc install/ &&
sudo -S makepkg -l y -c n $PKGS/libwebp-doc-1.4.0-$NOPSUFFIX
sudo -S rm -rf /BMAN/*
sudo -S rm -rf ${BUILD}/*