#!/bin/bash # sdl.SlackBuild # Heavily based on the original Slackware build scripts, # Modified by Stuart Winter # 18-Aug-2004 # Record toolchain & other info for the build log: slackbuildinfo # Paths to skeleton port's source & real Slackware source tree: export CWD=$SLACKSOURCE/$PKGSERIES/$PKGNAM export PORTCWD=$PWD # Versions of additional stuff: pushd $CWD VERSION=${VERSION:-$(echo SDL-*.tar.?z* | rev | cut -f 3- -d . | cut -f 1 -d - | rev)} IMAGE=${IMAGE:-$(echo SDL_image-*.tar.?z* | rev | cut -f 3- -d . | cut -f 1 -d - | rev)} MIXER=${MIXER:-$(echo SDL_mixer-*.tar.?z* | rev | cut -f 3- -d . | cut -f 1 -d - | rev)} NET=${NET:-$(echo SDL_net-*.tar.?z* | rev | cut -f 3- -d . | cut -f 1 -d - | rev)} TTF=${TTF:-$(echo SDL_ttf-*.tar.?z* | rev | cut -f 3- -d . | cut -f 1 -d - | rev)} popd # Temporary build locations: export TMPBUILD=$TMP/build-$PKGNAM export PKG=$TMP/package-$PKGNAM mkpkgdirs # Delete & re-create temporary directories then cd into $TMPBUILD ################################## sdl ############################################ # Extract source: tar xvvf $CWD/SDL-$VERSION.tar.?z* cd SDL-$VERSION || exit 1 slackhousekeeping # Apply patches: zcat $CWD/libsdl-1.2.15-resizing.patch.gz | patch -p1 --verbose || exit 1 zcat $CWD/sdl-1.2.14-fix-mouse-clicking.patch.gz | patch -p1 --verbose || exit 1 # Configure: # We must use --disable-x11-shared or programs linked with SDL will # crash on machines that use the closed source nVidia drivers. CFLAGS="$SLKCFLAGS" \ ./configure \ --prefix=/usr \ --mandir=/usr/man \ --libdir=/usr/lib${LIBDIRSUFFIX} \ --disable-arts \ --disable-esd \ --enable-shared=yes \ --enable-static=no \ --disable-x11-shared || failconfig # Build: make $NUMJOBS || make || failmake # Install onto filesystem so that mixer/image can compile: make install || failinstall # 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 ################################## sdl_image ######################################## # Extract source: cd $TMPBUILD tar xvvf $CWD/SDL_image-$IMAGE.tar.?z* cd SDL_image-$IMAGE || exit 1 slackhousekeeping # Configure: # we don't want sdl to load the libs with dlopen(), gcc is smarter... CFLAGS="$SLKCFLAGS" \ ./configure \ --prefix=/usr \ --libdir=/usr/lib${LIBDIRSUFFIX} \ --mandir=/usr/man \ --enable-shared=yes \ --enable-static=no \ --enable-jpg-shared=no \ --enable-png-shared=no \ --enable-tif-shared=no || failconfig # Build: make $NUMJOBS || failmake # Install into package: make install DESTDIR=$PKG # Copy docs: mkdir -p $PKG/usr/doc/SDL_image-$IMAGE cp -a CHANGES COPYING README \ $PKG/usr/doc/SDL_image-$IMAGE # We do not want to try to pull in -lmikmod, since that was linked static: sed -i -e "s/ -lmikmod//g" $PKG/usr/lib${LIBDIRSUFFIX}/libSDL_mixer.la ################################## sdl_mixer ######################################## # Extract source: cd $TMPBUILD tar xvvf $CWD/SDL_mixer-$MIXER.tar.?z* cd SDL_mixer-$MIXER || exit 1 slackhousekeeping # Fix default library path. Don't use /usr/local, and use lib64 where needed: sed -i "s,usr/local/lib,usr/lib${LIBDIRSUFFIX},g" timidity/config.h # Install patched static libmikmod: unzip libmikmod-3.1.12.zip ( cd libmikmod-3.1.12.patched ./configure \ --prefix=/usr/local \ --libdir=/usr/local/lib${LIBDIRSUFFIX} \ --with-pic \ --enable-shared=no \ --enable-static=yes make $NUMJOBS || make || exit 1 make install ) # Configure: CFLAGS="$SLKCFLAGS" \ ./configure \ --prefix=/usr \ --mandir=/usr/man \ --libdir=/usr/lib${LIBDIRSUFFIX} \ --enable-shared=yes \ --enable-music-mod \ --enable-static=no || failconfig # Build: make $NUMJOBS || failmake # Install into package: make install DESTDIR=$PKG # Copy docs: mkdir -p $PKG/usr/doc/SDL_mixer-$MIXER cp -a CHANGES COPYING README \ $PKG/usr/doc/SDL_mixer-$MIXER ################################## sdl_net ########################################## # Extract source: cd $TMPBUILD rm -rf SDL_net-$NET tar xvvf $CWD/SDL_net-$NET.tar.?z* cd SDL_net-$NET || exit 1 slackhousekeeping # Configure: CFLAGS="$SLKCFLAGS" \ ./configure \ --prefix=/usr \ --libdir=/usr/lib${LIBDIRSUFFIX} \ --mandir=/usr/man \ --enable-shared=yes \ --enable-static=no || failconfig # Build: make $NUMJOBS || failmake # Install into package: make install DESTDIR=$PKG # Copy docs: mkdir -p $PKG/usr/doc/SDL_net-$NET cp -a CHANGES COPYING README \ $PKG/usr/doc/SDL_net-$NET ################################## sdl_ttf ############################################# # Extract source: cd $TMPBUILD rm -rf SDL_ttf-$TTF tar xvvf $CWD/SDL_ttf-$TTF.tar.?z* cd SDL_ttf-$TTF || exit 1 slackhousekeeping # Apply patches: zcat $CWD/SDL_ttf.shaded.text.diff.gz | patch -p1 --verbose || exit 1 # Configure: CFLAGS="$SLKCFLAGS" \ ./configure \ --prefix=/usr \ --mandir=/usr/man \ --libdir=/usr/lib${LIBDIRSUFFIX} \ --enable-shared=yes \ --enable-static=no || failconfig # Build: make $NUMJOBS || failmake # Install into package: make install DESTDIR=$PKG # Copy docs: mkdir -p $PKG/usr/doc/SDL_ttf-$TTF cp -a CHANGES COPYING README \ $PKG/usr/doc/SDL_ttf-$TTF ########################################################################################## # If necessary, start the fakeroot server so we can set file/dir ownerships: start_fakeroot # Apply generic Slackware packaging policies: cd $PKG slackstripall # strip all .a archives and all ELFs slackgzpages -i # compress man & info pages and delete usr/info/dir slackslack # chown -R root:root, chmod -R og-w, slackchown, slack644docs slackdesc # install slack-desc and doinst.sh slackmp # run makepkg -l y -c n # Perform any final checks on the package: cd $PKG slackhlinks # search for any hard links