summaryrefslogtreecommitdiff
path: root/libraries/SFML/SFML.SlackBuild
diff options
context:
space:
mode:
authorPawel Standowicz <standek@gmail.com>2011-03-05 14:41:34 -0300
committerNiels Horn <niels.horn@slackbuilds.org>2011-03-05 14:41:34 -0300
commit549378e50fd40e8d9002d360385f981b9d76870d (patch)
tree4d772d6161a19b8d34e1352a6885ad3cf7e21eb8 /libraries/SFML/SFML.SlackBuild
parentf95563184b7aba07ef0ec3f5a4ad0d79c41e005b (diff)
downloadslackbuilds-549378e50fd40e8d9002d360385f981b9d76870d.tar.gz
libraries/SFML: Added (Simple and Fast Multimedia Library)
Signed-off-by: Niels Horn <niels.horn@slackbuilds.org>
Diffstat (limited to 'libraries/SFML/SFML.SlackBuild')
-rw-r--r--libraries/SFML/SFML.SlackBuild77
1 files changed, 77 insertions, 0 deletions
diff --git a/libraries/SFML/SFML.SlackBuild b/libraries/SFML/SFML.SlackBuild
new file mode 100644
index 0000000000..29db2f7fd4
--- /dev/null
+++ b/libraries/SFML/SFML.SlackBuild
@@ -0,0 +1,77 @@
+#!/bin/sh
+
+# Slackware build script for SFML (Simple and Fast Multimedia Library)
+
+# Written by Pawel Standowicz (standek@gmail.com)
+
+PRGNAM=SFML
+VERSION=${VERSION:-1.6}
+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=$TMP/package-$PRGNAM
+OUTPUT=${OUTPUT:-/tmp}
+
+# Archive package name suffixes are different depending on system architecture.
+ARCHIVESUFFIX=${ARCHIVESUFFIX:-32} # Default for 32bit systems
+
+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"
+ LIBDIRSUFFIX="64"
+ ARCHIVESUFFIX="64" # For 64bit systems
+else
+ SLKCFLAGS="-O2"
+ LIBDIRSUFFIX=""
+fi
+
+set -e
+
+rm -rf $PKG
+mkdir -p $TMP $PKG $OUTPUT
+cd $TMP
+rm -rf $PRGNAM-$VERSION
+tar xvf $CWD/$PRGNAM-$VERSION-sdk-linux-$ARCHIVESUFFIX.tar.gz
+cd $PRGNAM-$VERSION
+chown -R root:root .
+find . \
+ \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
+ -exec chmod 755 {} \; -o \
+ \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
+ -exec chmod 644 {} \;
+
+# Patch Makefile so that it respects CFLAGS
+sed -i "s/CFLAGS\ .*=/CFLAGS +=/" src/SFML/Makefile
+
+# Patch Makefile to put libs in correct place
+sed -i "s|(DESTDIR)/lib|(DESTDIR)/lib$LIBDIRSUFFIX|" src/SFML/Makefile
+
+CFLAGS="$SLKCFLAGS" \
+ make
+make install DESTDIR=$PKG/usr
+
+mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
+cp -ar \
+ doc/* \
+ $PKG/usr/doc/$PRGNAM-$VERSION
+
+mkdir -p $PKG/install
+cat $CWD/slack-desc > $PKG/install/slack-desc
+
+cd $PKG
+/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}