Files
BMLFS/build-scripts/libpng.build
2025-07-26 11:56:21 -05:00

78 lines
3.0 KiB
Bash

#! /bin/bash
# Libpng (PNG Library)
# Source: https://downloads.sourceforge.net/libpng/libpng-1.6.50.tar.xz
#
# $BUILD = Directory to temporarily install
# $PKGS = Directory to store built packages
#
# DEPS
# Required: NONE
# Recommended: NONE
# Optional: NONE
# If optimizing, use these flags
export CFLAGS="-march=native -mtune=native -pipe "
export CFLAGS+="-O3 -falign-functions=32 -ffat-lto-objects -flto=4 "
export CFLAGS+="-fno-math-errno -fno-semantic-interposition "
export CFLAGS+="-fno-trapping-math -fstack-protector-strong "
export CFLAGS+="-fzero-call-used-regs=used "
export LDFLAGS="-flto=4 -Wl,-O2 -Wl,--as-needed "
export PVER="1.6.50"
# Per BLFS, patch libpng to support apng files:
gzip -cd ../patches/libpng-lfs/libpng-1.6.47-apng.patch.gz | patch -p1
LIBS=-lpthread ./configure --prefix=/usr --disable-static $BUILDTRUMPLE &&
read -p "Compile?" && make -j2 &&
sudo -S make DESTDIR=$BUILD install &&
sudo -S mkdir -pv /BMAN/install
sudo -S mkdir -pv /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------------------------------------------------------|
libpng: libpng (Portable Network Graphics library)
libpng:
libpng: PNG (Portable Network Graphics) is an extensible file format for the
libpng: lossless, portable, well-compressed storage of raster images. PNG
libpng: provides a patent-free replacement for GIF and can also replace many
libpng: common uses of TIFF. Indexed-color, grayscale, and truecolor images
libpng: are supported, plus an optional alpha channel. Sample depths range
libpng: from 1 to 16 bits.
libpng:
libpng:
EOF
sudo -S mv -v /tmp/slack-desc install/ &&
sudo -S makepkg -l y -c n $PKGS/libpng-$PVER-$PSUFFIX && \
cd /BMAN
cat > /tmp/slack-desc << "EOF"
libpng-doc: Manuals for libpng (Portable Network Graphics library)
libpng-doc:
libpng-doc: PNG (Portable Network Graphics) is an extensible file format for the
libpng-doc: lossless, portable, well-compressed storage of raster images. PNG
libpng-doc: provides a patent-free replacement for GIF and can also replace many
libpng-doc: common uses of TIFF. Indexed-color, grayscale, and truecolor images
libpng-doc: are supported, plus an optional alpha channel. Sample depths range
libpng-doc: from 1 to 16 bits.
libpng-doc:
libpng-doc:
EOF
sudo -S mv -v /tmp/slack-desc install/ &&
sudo -S makepkg -l y -c n $PKGS/libpng-doc-$PVER-$NOPSUFFIX
sudo -S rm -rf /BMAN/*
sudo -S rm -rf ${BUILD}/*