graphics/pngquant: Strip binary and shared lib.

Signed-off-by: B. Watson <urchlay@slackware.uk>

Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
This commit is contained in:
B. Watson 2023-07-01 20:54:54 -04:00 committed by Willy Sudiarto Raharjo
parent 0bfbf7e6c1
commit 252722ac4f
No known key found for this signature in database
GPG Key ID: 3F617144D7238786
2 changed files with 30 additions and 10 deletions

View File

@ -6,3 +6,6 @@ browsers, and have better fallback in IE6 than 24-bit PNGs.
Optional features:
OPENMP=yes|no (default: no) Enables parallelized batch jobs.
Note: OPENMP=yes builds are currently broken. If this bothers
you, please send a patch to fix it.

View File

@ -25,11 +25,26 @@
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# 20230701 bkw: Modified by SlackBuilds.org, BUILD=2:
# - strip binary and shared lib.
# - remove INSTALL from doc dir (compile instructions only).
# - add README note saying OPENMP=yes is broken.
#
# Note: upstream switched from C to Rust. The last C release was
# 2.18.0 (Feb 3, 2023), which this build should probably be updated
# for (assuming it doesn't break imgmin or tuxpaint, which depend on
# this).
#
# The 3.0.x releases don't look like they're API compatible. I would
# rather stab myself in the eye with a rusty fork than deal with Rust,
# but someone might want to look into 3.0.x (possibly as a separate
# SlackBuild, leaving this one at 2.18.0).
cd $(dirname $0) ; CWD=$(pwd)
PRGNAM=pngquant
VERSION=${VERSION:-2.9.0}
BUILD=${BUILD:-1}
BUILD=${BUILD:-2}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}
@ -41,9 +56,6 @@ if [ -z "$ARCH" ]; then
esac
fi
# If the variable PRINT_PACKAGE_NAME is set, then this script will report what
# the name of the created package would be, and then exit. This information
# could be useful to other scripts.
if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
exit 0
@ -53,7 +65,7 @@ TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}
DOCS="CHANGELOG COPYRIGHT INSTALL README.md"
DOCS="CHANGELOG COPYRIGHT README.md"
if [ "$ARCH" = "i586" ]; then
SLKCFLAGS="-O2 -march=i586 -mtune=i686"
@ -80,6 +92,9 @@ cd $PRGNAM-$VERSION
chown -R root:root .
chmod -R u+w,go-w,a+rX-st .
# 20230701 bkw: building with OPENMP=yes is broken on Slackware 15.0,
# which I suppose is why this was disabled by default. I thought using
# CC=clang might help, but it doesn't.
if [ "${OPENMP:-no}" != "no" ]; then
openmp="--with-openmp"
fi
@ -93,13 +108,15 @@ sed -i -e 's#share/man#man#' Makefile
make
make -C lib shared
strip $PRGNAM
make PREFIX=$PKG/usr install
# manual installation of libraries:
install -D -m0755 lib/libimagequant.so.0 $PKG/usr/lib${LIBDIRSUFFIX}/libimagequant.so.0
install -D -m0644 lib/libimagequant.a $PKG/usr/lib${LIBDIRSUFFIX}/libimagequant.a
install -D -m0644 lib/libimagequant.h $PKG/usr/include/libimagequant.h
find $PKG/usr/man -type f -exec gzip -9 {} +
# manual installation of libraries:
install -s -D -m0755 lib/libimagequant.so.0 $PKG/usr/lib${LIBDIRSUFFIX}/libimagequant.so.0
install -D -m0644 lib/libimagequant.a $PKG/usr/lib${LIBDIRSUFFIX}/libimagequant.a
install -D -m0644 lib/libimagequant.h $PKG/usr/include/libimagequant.h
gzip -9 $PKG/usr/man/man*/*
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cp -a $DOCS $PKG/usr/doc/$PRGNAM-$VERSION