libimagequant - Image quantization library ChangeLog

HOWTO


# libimagequant 2.12.2
# ====================
# If you want a command-line utility for this library, see pngquant

# Get it
cd
test -f installed/libimagequant-2.12.2.tar.gz &&
mv -f installed/libimagequant-2.12.2.tar.gz .
test ! -f libimagequant-2.12.2.tar.gz &&
wget -O libimagequant-2.12.2.tar.gz \
  https://github.com/ImageOptim/libimagequant/archive/2.12.2.tar.gz

# Extract it
mkdir -p -m 0700 ~/src
cd ~/src
find -maxdepth 1 -type d -name "libimagequant-*" -exec rm -r {} \;
tar xzvf ~/libimagequant-2.12.2.tar.gz
cd libimagequant-2.12.2
test $UID = 0 && chown -R root:root .

# Read ./README.md

# Configure the build for 64-bit
test $(uname -m) = 'x86_64' &&
./configure --libdir=/usr/local/lib64 \
  --pkgconfigdir=/usr/local/lib64/pkgconfig

# Configure the build for anything else
test $(uname -m) != 'x86_64' && ./configure

# 'make imagequant.pc' does not use libdir passed to configure, so
# update the .in file if 64-bit.  If you're not sure what it should be,
# it is whatever LIBDIR in config.mk is set to.
# Verify changes with 'diff -u imagequant.pc.in imagequant.pc'
test $(uname -m) = 'x86_64' &&
cat imagequant.pc.in | \
  sed -e 's|\${prefix}/lib$|\${prefix}/lib64|' \
      -e 's|PREFIX|/usr/local|' \
      -e 's|VERSION|2.12.2|' > imagequant.pc

# Not 64-bit, generate imagequant.pc the usual way
test $(uname -m) != 'x86_64' && make imagequant.pc

# Build it (only) as a shared library
make libimagequant.so

# Become root to install it
su

# Install it
install -m 644 libimagequant.h /usr/local/include/libimagequant.h
install -m 644 libimagequant.so.0 /usr/local/lib64/libimagequant.so.0
( cd /usr/local/lib64 ; ln -sf libimagequant.so.0 libimagequant.so )
install -m 644 imagequant.pc /usr/local/lib64/pkgconfig/imagequant.pc
ldconfig

# Make sure your non-root user can remove the source later
chown -R $(logname) .
chmod -R u+w .

# Become yourself again
exit

# Save the source for later
cd
mkdir -p -m 0700 installed
rm -f installed/libimagequant-*.tar.*
mv -f libimagequant-2.12.2.tar.gz installed/


# If you ever want to uninstall libimagequant, this should do it:
cd
su
test -d src/libimagequant-* && ( cd src/libimagequant-* ; make uninstall )
rm -f /usr/local/include/libimagequant.h \
/usr/local/lib64/libimagequant.* \
/usr/local/lib64/pkgconfig/imagequant.pc
ldconfig
exit
find ~/src -maxdepth 1 -type d -name "libimagequant-*" -exec rm -r {} \;
rm -f ~/installed/libimagequant-*.tar.*

List of HOWTOs

Web page itself last updated: 2023-12-20 8:06pm (EST -0500)
HOWTO last updated: 2018-11-26 1:22pm
Copyright © 2001-2024 Jason Englander. All Rights reserved.
[HTML5]