diff options
Diffstat (limited to 'patches/sdl/sdl.SlackBuild')
-rwxr-xr-x | patches/sdl/sdl.SlackBuild | 201 |
1 files changed, 201 insertions, 0 deletions
diff --git a/patches/sdl/sdl.SlackBuild b/patches/sdl/sdl.SlackBuild new file mode 100755 index 00000000..ba3fb9c4 --- /dev/null +++ b/patches/sdl/sdl.SlackBuild @@ -0,0 +1,201 @@ +#!/bin/bash +# +# got it from ftp://ftp.slackware.com/pub/slackware/slackware-10.2/source/l/sdl/sdl.SlackBuild +# small changes by rhatto +# + +CWD="`pwd`" + +if [ -f "/etc/slackbuildrc" ]; then + source /etc/slackbuildrc +fi + +if [ -f "~/.slackbuildrc" ]; then + source ~/.slackbuildrc +fi + +PACKAGE="sdl" +VERSION=${VERSION:=1.2.11} +ARCH=${ARCH:=x86_64} +BUILD=${BUILD:=1rha} +SRC_DIR=${SRC:=$CWD} +TMP=${TMP:=/tmp} + +IMAGE=${IMAGE:=1.2.5} +MIXER=${MIXER:=1.2.7} +NET=${NET:=1.2.6} +TTF=${TTF:=2.0.8} + +RTOOL="wget" +PACKAGE_EXT="gz" +SRC="SDL-$VERSION.tar.$PACKAGE_EXT" +SRC_image="SDL_image-$IMAGE.tar.gz" +SRC_mixer="SDL_mixer-$MIXER.tar.gz" +SRC_net="SDL_net-$NET.tar.gz" +SRC_ttf="SDL_ttf-$TTF.tar.gz" +URL="http://www.libsdl.org/release/$SRC" +URL_LIB="http://www.libsdl.org/projects" + +if [ "$PACKAGE_EXT" == "bz2" ]; then + tarflag="j" +else + tarflag="z" +fi + +SRC_DIR="$SRC_DIR/$PACKAGE" +TMP="$TMP/$PACKAGE" +mkdir -p $SRC_DIR $TMP + +if [ "$RTOOL" == "wget" ]; then + if [ ! -f "$SRC_DIR/$SRC" ]; then + wget "$URL/$SRC" -O "$SRC_DIR/$SRC" + fi + if [ ! -f "$SRC_DIR/$SRC_image" ]; then + wget "$URL_LIB/SDL_image/release/$SRC_image" -O "$SRC_DIR/$SRC_image" + fi + if [ ! -f "$SRC_DIR/$SRC_mixer" ]; then + wget "$URL_LIB/SDL_mixer/release/$SRC_mixer" -O "$SRC_DIR/$SRC_mixer" + fi + if [ ! -f "$SRC_DIR/SDL_net-$NET.tar.gz" ]; then + wget "$URL_LIB/SDL_net/release/$SRC_net" -O "$SRC_DIR/$SRC_net" + fi + if [ ! -f "$SRC_DIR/SDL_ttf-$TTF.tar.gz" ]; then + wget "$URL_LIB/SDL_ttf/release/$SRC_ttf" -O "$SRC_DIR/$SRC_ttf" + fi +fi + +PKG="$TMP/package-$PACKAGE" + +LIBDIR=/usr/lib +if [ "$ARCH" = "i386" ]; then + SLKCFLAGS="-O2 -march=i386 -mcpu=i686" +elif [ "$ARCH" = "i486" ]; then + SLKCFLAGS="-O2 -march=i486 -mcpu=i686" +elif [ "$ARCH" = "x86_64" ]; then + SLKCFLAGS="-O2 -fPIC" + LIBDIR=/usr/lib64 +fi +rm -rf $PKG +mkdir -p $PKG +cd $TMP +rm -rf sdl-$VERSION +tar xf$tarflag $SRC_DIR/$SRC +cd SDL-$VERSION +if [ "$ARCH" == "x86_64" ]; then + gzip -dc $CWD/libdir-fix.diff.gz | patch -p1 +fi +chown -R root.root . +find . -perm 777 -exec chmod 755 {} \; +find . -perm 664 -exec chmod 644 {} \; +CFLAGS="$SLKCFLAGS" \ +./configure \ + --prefix=/usr \ + --enable-shared=yes \ + --libdir=$LIBDIR \ + --enable-static=no +make -j3 +# Spam /, for mixer/image later on: +make install +# install to package: +make install DESTDIR=$PKG +mkdir -p $PKG/usr/doc/SDL-$VERSION/html +cp -a docs/index.html $PKG/usr/doc/SDL-$VERSION +cp -a docs/html/*.html $PKG/usr/doc/SDL-$VERSION/html +cp -a BUGS COPYING CREDITS INSTALL README* TODO WhatsNew $PKG/usr/doc/SDL-$VERSION +mkdir -p $PKG/install +cat $CWD/slack-desc > $PKG/install/slack-desc + +# Add SDL_image: +cd $TMP +rm -rf SDL_image-$IMAGE +tar xf$tarflag $SRC_DIR/$SRC_image +cd SDL_image-$IMAGE +chown -R root.root . +find . -perm 777 -exec chmod 755 {} \; +find . -perm 664 -exec chmod 644 {} \; +CFLAGS="$SLKCFLAGS" \ +./configure \ + --prefix=/usr \ + --enable-shared=yes \ + --libdir=$LIBDIR \ + --enable-static=no +make -j3 +make install DESTDIR=$PKG +mkdir -p $PKG/usr/doc/SDL_image-$IMAGE +cp -a \ + CHANGES COPYING README \ + $PKG/usr/doc/SDL_image-$IMAGE + +# Add SDL_mixer: +cd $TMP +rm -rf SDL_mixer-$MIXER +tar xf$tarflag $SRC_DIR/$SRC_mixer +cd SDL_mixer-$MIXER +chown -R root.root . +find . -perm 777 -exec chmod 755 {} \; +find . -perm 664 -exec chmod 644 {} \; +CFLAGS="$SLKCFLAGS" \ +./configure \ + --prefix=/usr \ + --enable-shared=yes \ + --libdir=$LIBDIR \ + --enable-static=no +make -j3 +make install DESTDIR=$PKG +mkdir -p $PKG/usr/doc/SDL_mixer-$MIXER +cp -a \ + CHANGES COPYING README \ + $PKG/usr/doc/SDL_mixer-$MIXER + +# Add SDL_net: +cd $TMP +rm -rf SDL_net-$NET +tar xf$tarflag $SRC_DIR/$SRC_net +cd SDL_net-$NET +chown -R root.root . +find . -perm 777 -exec chmod 755 {} \; +find . -perm 664 -exec chmod 644 {} \; +CFLAGS="$SLKCFLAGS" \ +./configure \ + --prefix=/usr \ + --enable-shared=yes \ + --libdir=$LIBDIR \ + --enable-static=no +make -j3 +make install DESTDIR=$PKG +mkdir -p $PKG/usr/doc/SDL_net-$NET +cp -a \ + CHANGES COPYING README \ + $PKG/usr/doc/SDL_net-$NET + +# Add SDL_ttf: +cd $TMP +rm -rf SDL_ttf-$TTF +tar xf$tarflag $SRC_DIR/$SRC_ttf +cd SDL_ttf-$TTF +chown -R root.root . +find . -perm 777 -exec chmod 755 {} \; +find . -perm 664 -exec chmod 644 {} \; +CFLAGS="$SLKCFLAGS" \ +./configure \ + --prefix=/usr \ + --enable-shared=yes \ + --libdir=$LIBDIR \ + --enable-static=no +make -j3 +make install DESTDIR=$PKG +mkdir -p $PKG/usr/doc/SDL_ttf-$TTF +cp -a \ + CHANGES COPYING README \ + $PKG/usr/doc/SDL_ttf-$TTF + +chown -R root.bin $PKG/usr/bin +( cd $PKG + find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null + find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null +) +gzip -9 $PKG/usr/man/man?/*.? + +cd $PKG +makepkg -l y -c n ../sdl-$VERSION-$ARCH-$BUILD.tgz + |