Linux HOWTOs

About | Home | Search


HOWTO: libsquish
Description: Open source DXT compression library
Click here for ChangeLog
NOTE: I use GNU tar >= 1.13.25 so it's -j for .tar.bz2 files,
it's safe to assume that make, gcc, binutils, fileutils/coreutils, gawk, sed, and grep are prerequisites for almost everything


# libsquish 1.15
# ==============
# OpenMP

# Get it
cd
test -f installed/libsquish-1.15.tgz &&
 mv -f installed/libsquish-1.15.tgz .
test ! -f libsquish-1.15.tgz &&
 wget https://downloads.sf.net/libsquish/libsquish-1.15.tgz

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

# Create a build directory
mkdir build
cd build

# Configure the build
cmake -DBUILD_SHARED_LIBS:BOOL=ON ..

# If 64-bit, nudge it to put it in /usr/local/lib64 instead of lib
# Test with 'diff -u cmake_install.cmake.orig cmake_install.cmake'
test $(uname -m) = 'x86_64' &&
 ( test ! -f cmake_install.cmake.orig &&
    cp -a cmake_install.cmake cmake_install.cmake.orig
   cat cmake_install.cmake.orig |
    sed -e 's%/lib/%/lib64/%g' -e 's%/lib"%/lib64"%g' \
     > cmake_install.cmake )

# Build it
make

# Become root to install it
su

# If you know they're not in use, remove old files to avoid conflicts
rm -f /usr/local/include/squish.h /usr/local/lib*/libsquish.*

# Install it
make install
ldconfig

# Become your non-root user again
exit

# Save the source for later
cd
mkdir -p -m 0700 installed
rm -f installed/libsquish-*.tar.*
mv libsquish-1.15.tgz installed/


# If you ever want to uninstall libsquish, this should do it:
cd
su
test -d src/libsquish-* &&
 ( cd src/libsquish-* ; cat install_manifest.txt | xargs rm )
rm -f /usr/local/include/squish.h /usr/local/lib*/libsquish.*
ldconfig
exit
find ~/src -maxdepth 1 -type d -name "libsquish-*" -exec rm -r {} \;
rm -f ~/installed/libsquish-*.tar.*

Back to the list


Last updated: Wed, 29 Apr 2020 22:04:50 -0400
Jason Englander <jason at englanders dot us>