summaryrefslogtreecommitdiff
path: root/libraries/allegro/allegro.SlackBuild
diff options
context:
space:
mode:
Diffstat (limited to 'libraries/allegro/allegro.SlackBuild')
-rw-r--r--libraries/allegro/allegro.SlackBuild61
1 files changed, 34 insertions, 27 deletions
diff --git a/libraries/allegro/allegro.SlackBuild b/libraries/allegro/allegro.SlackBuild
index af24bfec4d..f1e1903c3d 100644
--- a/libraries/allegro/allegro.SlackBuild
+++ b/libraries/allegro/allegro.SlackBuild
@@ -2,7 +2,7 @@
#
# Slackware build script for allegro
#
-# Copyright 2009 Erik W. Hanson, Minneapolis, MN, USA
+# Copyright 2009-2011 Erik W. Hanson, Minneapolis, MN, USA
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -22,15 +22,19 @@
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-# This selects it's own flags for compilation, resulting in -mtune=pentium
-# on modern (>=i586) machines. Hence no CFLAGS and the i586 ARCH.
-
PRGNAM=allegro
-VERSION=4.2.2
-ARCH=${ARCH:-i586}
+VERSION=${VERSION:-4.4.2}
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
@@ -45,47 +49,50 @@ elif [ "$ARCH" = "i686" ]; then
elif [ "$ARCH" = "x86_64" ]; then
SLKCFLAGS="-O2 -fPIC"
LIBDIRSUFFIX="64"
+else
+ SLKCFLAGS="-O2"
+ LIBDIRSUFFIX=""
fi
+set -ue
+
rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf $PRGNAM-$VERSION
-tar xvf $CWD/$PRGNAM-$VERSION.tar.gz || exit 1
+tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
cd $PRGNAM-$VERSION
chown -R root:root .
chmod -R u+w,go+r-w,a-s .
-# Patch makefile.in for make-3.82
-patch -p1 < $CWD/allegro_make382.patch
-
-./configure \
- --prefix=/usr \
- --libdir=/usr/lib${LIBDIRSUFFIX} \
- --sysconfdir=/etc \
- --localstatedir=/var \
- --mandir=/usr/man \
- --infodir=/usr/info \
- --enable-shared=yes \
- --enable-static=no \
- || exit 1
-
-sed -i "s/fnstsw %eax/fnstsw %ax/" src/i386/icpus.s
-
-make || exit 1
-make install DESTDIR=$PKG || exit 1
-make install-gzipped-man DESTDIR=$PKG || exit 1
-make install-gzipped-info DESTDIR=$PKG || exit 1
+mkdir -p build
+cd build
+ cmake \
+ -DCMAKE_C_FLAGS:STRING="$SLKCFLAGS" \
+ -DCMAKE_CXX_FLAGS:STRING="$SLKCFLAGS" \
+ -DCMAKE_INSTALL_PREFIX=/usr \
+ -DLIB_SUFFIX=${LIBDIRSUFFIX} \
+ -DCMAKE_BUILD_TYPE=Release ..
+ make VERBOSE=1
+ make install DESTDIR=$PKG
+cd ..
find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
+mkdir -p $PKG/usr/share/allegro
+cp language.dat keyboard.dat $PKG/usr/share/allegro
+mkdir -p $PKG/etc
+cp allegro.cfg $PKG/etc/allegro.cfg.new
+gzip -9 $PKG/usr/info/*.info*
+
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cp -a readme.txt todo.txt AUTHORS CHANGES THANKS $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
+cat $CWD/doinst.sh > $PKG/install/doinst.sh
cd $PKG
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}