summaryrefslogtreecommitdiffstats
path: root/source/l/sdl/sdl.SlackBuild
diff options
context:
space:
mode:
Diffstat (limited to 'source/l/sdl/sdl.SlackBuild')
-rwxr-xr-xsource/l/sdl/sdl.SlackBuild58
1 files changed, 39 insertions, 19 deletions
diff --git a/source/l/sdl/sdl.SlackBuild b/source/l/sdl/sdl.SlackBuild
index 80466266f..9f886303f 100755
--- a/source/l/sdl/sdl.SlackBuild
+++ b/source/l/sdl/sdl.SlackBuild
@@ -1,6 +1,6 @@
-#!/bin/sh
+#!/bin/bash
-# Copyright 2008, 2009, 2010, 2011, 2013, 2016 Patrick J. Volkerding, Sebeka, Minnesota, USA
+# Copyright 2008, 2009, 2010, 2011, 2013, 2016, 2018 Patrick J. Volkerding, Sebeka, Minnesota, USA
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -20,13 +20,16 @@
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+cd $(dirname $0) ; CWD=$(pwd)
+
+PKGNAM=sdl
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)}
-BUILD=${BUILD:-4}
+BUILD=${BUILD:-7}
# Automatically determine the architecture we're building on:
if [ -z "$ARCH" ]; then
@@ -38,6 +41,14 @@ if [ -z "$ARCH" ]; then
esac
fi
+# If the variable PRINT_PACKAGE_NAME is set, then this script will report what
+# the name of the created package would be, and then exit. This information
+# could be useful to other scripts.
+if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
+ echo "$PKGNAM-$VERSION-$ARCH-$BUILD.txz"
+ exit 0
+fi
+
NUMJOBS=${NUMJOBS:-" -j7 "}
if [ "$ARCH" = "i586" ]; then
@@ -54,7 +65,6 @@ else
LIBDIRSUFFIX=""
fi
-CWD=$(pwd)
TMP=${TMP:-/tmp}
PKG=$TMP/package-sdl
@@ -86,12 +96,14 @@ CFLAGS="$SLKCFLAGS" \
--disable-esd \
--enable-shared=yes \
--enable-static=no \
- --disable-x11-shared
+ --disable-x11-shared || exit 1
make $NUMJOBS || make || exit 1
# Spam /, for mixer/image later on:
-make install
+make install || exit 1
+# Later we will need to remove .la files installed to the system by the above.
+
# install to package:
make install DESTDIR=$PKG || exit 1
mkdir -p $PKG/usr/doc/SDL-$VERSION/html
@@ -108,7 +120,7 @@ cat $CWD/slack-desc > $PKG/install/slack-desc
cd $TMP
rm -rf SDL_image-$IMAGE
tar xf $CWD/SDL_image-$IMAGE.tar.?z* || exit 1
-cd SDL_image-$IMAGE
+cd SDL_image-$IMAGE || exit 1
chown -R root:root .
find . \
\( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
@@ -126,7 +138,7 @@ CFLAGS="$SLKCFLAGS" \
--enable-static=no \
--enable-jpg-shared=no \
--enable-png-shared=no \
- --enable-tif-shared=no
+ --enable-tif-shared=no || exit 1
make $NUMJOBS || make || exit 1
make install DESTDIR=$PKG || exit 1
@@ -139,23 +151,24 @@ cp -a \
cd $TMP
rm -rf SDL_mixer-$MIXER
tar xf $CWD/SDL_mixer-$MIXER.tar.?z* || exit 1
-cd SDL_mixer-$MIXER
+cd SDL_mixer-$MIXER || exit 1
# 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
+tar xf $CWD/libmikmod-3.1.20.tar.xz
+( cd libmikmod-3.1.20
+ CFLAGS="$SLKCFLAGS" \
./configure \
--prefix=/usr/local \
--libdir=/usr/local/lib${LIBDIRSUFFIX} \
--with-pic \
--enable-shared=no \
- --enable-static=yes
+ --enable-static=yes || exit 1
make $NUMJOBS || make || exit 1
- make install
-)
+ make install || exit 1
+) || exit 1
chown -R root:root .
find . \
@@ -171,7 +184,7 @@ CFLAGS="$SLKCFLAGS" \
--mandir=/usr/man \
--enable-music-mod \
--enable-shared=yes \
- --enable-static=no
+ --enable-static=no || exit 1
make $NUMJOBS || make || exit 1
make install DESTDIR=$PKG || exit 1
@@ -188,7 +201,7 @@ sed -i -e "s/ -lmikmod//g" $PKG/usr/lib${LIBDIRSUFFIX}/libSDL_mixer.la
cd $TMP
rm -rf SDL_net-$NET
tar xf $CWD/SDL_net-$NET.tar.?z* || exit 1
-cd SDL_net-$NET
+cd SDL_net-$NET || exit 1
chown -R root:root .
find . \
\( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
@@ -202,7 +215,7 @@ CFLAGS="$SLKCFLAGS" \
--libdir=/usr/lib${LIBDIRSUFFIX} \
--mandir=/usr/man \
--enable-shared=yes \
- --enable-static=no
+ --enable-static=no || exit 1
make $NUMJOBS || make || exit 1
make install DESTDIR=$PKG || exit 1
@@ -216,7 +229,7 @@ cp -a \
cd $TMP
rm -rf SDL_ttf-$TTF
tar xf $CWD/SDL_ttf-$TTF.tar.?z* || exit 1
-cd SDL_ttf-$TTF
+cd SDL_ttf-$TTF || exit 1
#zcat $CWD/SDL_ttf-2.0.8-noftinternals.diff.gz | patch -p1 --verbose || exit 1
zcat $CWD/SDL_ttf.shaded.text.diff.gz | patch -p1 --verbose || exit 1
@@ -234,7 +247,7 @@ CFLAGS="$SLKCFLAGS" \
--libdir=/usr/lib${LIBDIRSUFFIX} \
--mandir=/usr/man \
--enable-shared=yes \
- --enable-static=no
+ --enable-static=no || exit 1
make $NUMJOBS || make || exit 1
make install DESTDIR=$PKG || exit 1
@@ -244,6 +257,13 @@ cp -a \
CHANGES COPYING README \
$PKG/usr/doc/SDL_ttf-$TTF
+# Remove .la files from the package and the system (due to make install):
+pushd $PKG
+ for lafile in usr/lib${LIBDIRSUFFIX}/*.la ; do
+ rm -f ${lafile} /${lafile}
+ done
+popd
+
find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null