aboutsummaryrefslogtreecommitdiff
path: root/development/mlton/mlton.SlackBuild
diff options
context:
space:
mode:
authorScot Doyle <mlton837@scotdoyle.com>2018-05-17 07:06:46 +0700
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2018-05-17 07:09:26 +0700
commit93b9db3396c30f650377cd2cf799a43f18d23238 (patch)
tree287bc65b6c45e2ab0f0aa09afc1c267c81f911d4 /development/mlton/mlton.SlackBuild
parent954fc74b8a01504fad68a8e97f118bb94b99c036 (diff)
development/mlton: Updated for version 20180207 + new maintainer.
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'development/mlton/mlton.SlackBuild')
-rw-r--r--development/mlton/mlton.SlackBuild72
1 files changed, 36 insertions, 36 deletions
diff --git a/development/mlton/mlton.SlackBuild b/development/mlton/mlton.SlackBuild
index 3fdbef1baef39..c399bb907b9a2 100644
--- a/development/mlton/mlton.SlackBuild
+++ b/development/mlton/mlton.SlackBuild
@@ -1,9 +1,10 @@
#!/bin/sh
+# Slackware build script for MLton
# Slackware build script for mlton
# Originally by Jockey S. Kyd (jockey dot kyd at gmail dot com)
-
# Modified by Ryan P.C. McQuen, WA, ryanpcmcquen@member.fsf.org
+# Copyright 2018, Scot Doyle
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -23,17 +24,16 @@
# along with this program (most likely, a file named COPYING). If
# not, see <http://www.gnu.org/licenses/>.
-
PRGNAM=mlton
-VERSION=${VERSION:-20130715}
+VERSION=${VERSION:-20180207}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
+PREBUILT=$PRGNAM-$VERSION-$BUILD.amd64-linux
if [ -z "$ARCH" ]; then
- case "$(uname -m)" in
- i?86) ARCH=i486 ;;
- arm*) ARCH=arm ;;
- *) ARCH=$(uname -m) ;;
+ case "$( uname -m )" in
+ x86_64) ARCH=x86_64 ;;
+ *) printf "This script only supports x86_64.\n" 1>&2; exit 1 ;;
esac
fi
@@ -42,42 +42,42 @@ TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}
-case "$ARCH" in
- i?86) LIBDIRSUFFIX=""
- TARARCH="x86" ;;
- x86_64) LIBDIRSUFFIX="64"
- TARARCH="amd64" ;;
- *) printf "$ARCH is not supported.\n" 1>&2
- exit 1 ;;
-esac
-
-DIST=$PRGNAM-$VERSION-1.$TARARCH-linux
-
set -e
rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
-cd $PKG
-tar xvf $CWD/$DIST.tgz
-chown -R root:root .
-find -L . \
- \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
- -o -perm 511 \) -exec chmod 755 {} \; -o \
- \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
- -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
+cd $TMP
+rm -rf $PREBUILT $PRGNAM-$VERSION
-[ "$LIBDIRSUFFIX" = "64" ] && mv $PKG/usr/lib{,64}
-sed -i "s|^lib=.*$|lib='/usr/lib$LIBDIRSUFFIX/mlton'|" $PKG/usr/bin/mlton
+tar xvf $CWD/$PREBUILT.tgz
+tar xvf $CWD/$PRGNAM-$VERSION.src.tgz
-find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
- | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
+cd $PRGNAM-$VERSION
-mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
-cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
-mv $PKG/usr/share/doc/mlton/* $PKG/usr/doc/$PRGNAM-$VERSION/
-rm -rf $PKG/usr/share
+# Permissions are already set
+chown -R root:root .
+
+# Prefer the pre-built compiler
+PATH=$TMP/$PREBUILT/bin:$PATH
+make all
+make PREFIX="$PKG" install
-mkdir -p $PKG/install
-cat $CWD/slack-desc > $PKG/install/slack-desc
+# Binaries are already stripped
cd $PKG
+mkdir -p usr
+mv share/man usr
+if [ "$1" == "-docs" ]; then
+ mkdir -p usr/share/doc
+ mv share/doc/$PRGNAM usr/share/doc/$PRGNAM-$VERSION
+ cat $CWD/$PRGNAM.SlackBuild > usr/share/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
+fi
+rm -rf share
+
+mv lib usr/lib64
+mv bin usr
+sed -i "s:^lib=.*:lib=/usr/lib64/mlton:" usr/bin/mlton
+
+mkdir install
+cat $CWD/slack-desc > install/slack-desc
+
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}