From c1356043e28dadd54b23af3b77cf167b2ac6ac4a Mon Sep 17 00:00:00 2001 From: Reinier de Blois Date: Wed, 11 Dec 2013 15:01:44 +0100 Subject: libraries/squish: Added (open-source DXT compression library). Signed-off-by: Matteo Bernardini --- libraries/squish/README | 6 +++ libraries/squish/slack-desc | 19 ++++++++ libraries/squish/squish.SlackBuild | 99 ++++++++++++++++++++++++++++++++++++++ libraries/squish/squish.info | 10 ++++ 4 files changed, 134 insertions(+) create mode 100644 libraries/squish/README create mode 100644 libraries/squish/slack-desc create mode 100644 libraries/squish/squish.SlackBuild create mode 100644 libraries/squish/squish.info (limited to 'libraries/squish') diff --git a/libraries/squish/README b/libraries/squish/README new file mode 100644 index 0000000000..0651686ba8 --- /dev/null +++ b/libraries/squish/README @@ -0,0 +1,6 @@ +The squish library (abbreviated to libsquish) is an open source DXT +compression library written in C++ with the following features: +* Supports the DXT1, DXT3 and DXT5 formats. +* Optimised for both SSE and Altivec SIMD instruction sets. +* Builds on multiple platforms (x86 and PPC tested). +* Very simple interface. diff --git a/libraries/squish/slack-desc b/libraries/squish/slack-desc new file mode 100644 index 0000000000..68ed69152c --- /dev/null +++ b/libraries/squish/slack-desc @@ -0,0 +1,19 @@ +# 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------------------------------------------------------| +squish: squish (open-source DXT compression library) +squish: +squish: The squish library (abbreviated to libsquish) is an open source DXT +squish: compression library written in C++ with the following features: +squish: * Supports the DXT1, DXT3 and DXT5 formats. +squish: * Optimised for both SSE and Altivec SIMD instruction sets. +squish: * Builds on multiple platforms (x86 and PPC tested). +squish: * Very simple interface. +squish: +squish: homepage: https://code.google.com/p/libsquish/ +squish: diff --git a/libraries/squish/squish.SlackBuild b/libraries/squish/squish.SlackBuild new file mode 100644 index 0000000000..b2bb675b13 --- /dev/null +++ b/libraries/squish/squish.SlackBuild @@ -0,0 +1,99 @@ +#!/bin/sh + +# Slackware build script for squish + +# Copyright 2013 Reinier de Blois +# All rights reserved. +# +# Redistribution and use of this script, with or without modification, is +# permitted provided that the following conditions are met: +# +# 1. Redistributions of this script must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED +# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO +# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +PRGNAM=squish +VERSION=${VERSION:-r52} +BUILD=${BUILD:-1} +TAG=${TAG:-_SBo} + +if [ -z "$ARCH" ]; then + case "$( uname -m )" in + i?86) ARCH=i486 ;; + arm*) ARCH=arm ;; + *) ARCH=$( uname -m ) ;; + esac +fi + +CWD=$(pwd) +TMP=${TMP:-/tmp/SBo} +PKG=${PKG:-$TMP/package-$PRGNAM} +OUTPUT=${OUTPUT:-/tmp} + +if [ "$ARCH" = "i486" ]; then + SLKCFLAGS="-O2 -march=i486 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "i686" ]; then + SLKCFLAGS="-O2 -march=i686 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "x86_64" ]; then + SLKCFLAGS="-O2 -fPIC -msse" + LIBDIRSUFFIX="64" +else + SLKCFLAGS="-O2" + LIBDIRSUFFIX="" +fi + +set -e + +rm -rf $PKG $TMP/$PRGNAM-$VERSION +mkdir -p $TMP $PKG $OUTPUT +cd $TMP +tar xvf $CWD/$PRGNAM-$VERSION.tar.?z* +cd $PRGNAM-$VERSION +chown -R root:root . +find -L . \ + \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \ + -o -perm 511 \) -exec chmod 755 {} \; -o \ + \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \ + -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \; + +# use sse2 only for x86_64 +[ ! "$ARCH" = "x86_64" ] && sed -i "s|BUILD_SQUISH_WITH_SSE2||" CMakeLists.txt + +# respect $LIBDIRSUFFIX +sed -i "s|\ lib$| lib$LIBDIRSUFFIX|" CMakeLists.txt + +# we build squish statically, as it's the most common use +mkdir -p build +cd build + cmake \ + -DCMAKE_C_FLAGS:STRING="$SLKCFLAGS" \ + -DCMAKE_CXX_FLAGS:STRING="$SLKCFLAGS" \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DBUILD_SHARED_LIBS=OFF \ + -DBUILD_SQUISH_EXTRA=ON \ + -DCMAKE_BUILD_TYPE=Release .. + make + make install DESTDIR=$PKG +cd .. + +mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION +cp -a ChangeLog README $PKG/usr/doc/$PRGNAM-$VERSION +cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild + +mkdir -p $PKG/install +cat $CWD/slack-desc > $PKG/install/slack-desc + +cd $PKG +/sbin/makepkg -l y -c n -p $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz} diff --git a/libraries/squish/squish.info b/libraries/squish/squish.info new file mode 100644 index 0000000000..4c78690b38 --- /dev/null +++ b/libraries/squish/squish.info @@ -0,0 +1,10 @@ +PRGNAM="squish" +VERSION="r52" +HOMEPAGE="https://code.google.com/p/libsquish/" +DOWNLOAD="http://ponce.cc/slackware/sources/repo/squish-r52.tar.xz" +MD5SUM="393dcd6a2c7268ff0f860f8054d03b96" +DOWNLOAD_x86_64="" +MD5SUM_x86_64="" +REQUIRES="" +MAINTAINER="Reinier de Blois" +EMAIL="rddeblois@gmail.com" -- cgit v1.2.3