summaryrefslogtreecommitdiff
path: root/development/mlton/mlton.SlackBuild
diff options
context:
space:
mode:
authorDavid Spencer <idlemoor@slackbuilds.org>2018-06-03 12:07:38 +0100
committerDavid Spencer <idlemoor@slackbuilds.org>2018-06-03 18:11:01 +0100
commitbab39a97c3cd0a88fb6a8bcfce6e898f2f02fc53 (patch)
treecc8169dd469cc447f6603f4565439ee7a4cf6d3a /development/mlton/mlton.SlackBuild
parentcce3444ba5b40c1d65377f5c68e4f4f009c2e55f (diff)
downloadslackbuilds-bab39a97c3cd0a88fb6a8bcfce6e898f2f02fc53.tar.gz
development/mlton: Fix ownership + cleanups.
Bad file ownership caused by 'make install' exploding tarballs in the upstream sources. Limit memory usage (build fail with large memory). ARCH wasn't checked when explicitly set. The build fails with multiple make jobs. BUILD is for the output package name, don't conflate it with the last bit of PREBUILT. Signed-off-by: David Spencer <idlemoor@slackbuilds.org>
Diffstat (limited to 'development/mlton/mlton.SlackBuild')
-rw-r--r--development/mlton/mlton.SlackBuild28
1 files changed, 17 insertions, 11 deletions
diff --git a/development/mlton/mlton.SlackBuild b/development/mlton/mlton.SlackBuild
index c399bb907b..823ca65d83 100644
--- a/development/mlton/mlton.SlackBuild
+++ b/development/mlton/mlton.SlackBuild
@@ -28,14 +28,13 @@ PRGNAM=mlton
VERSION=${VERSION:-20180207}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
-PREBUILT=$PRGNAM-$VERSION-$BUILD.amd64-linux
+PREBUILT=${PREBUILT:-$PRGNAM-$VERSION-1.amd64-linux}
-if [ -z "$ARCH" ]; then
- case "$( uname -m )" in
- x86_64) ARCH=x86_64 ;;
+ARCH=${ARCH:-$(uname -m)}
+case "$ARCH" in
+ x86_64) : ;;
*) printf "This script only supports x86_64.\n" 1>&2; exit 1 ;;
- esac
-fi
+esac
CWD=$(pwd)
TMP=${TMP:-/tmp/SBo}
@@ -51,22 +50,29 @@ rm -rf $PREBUILT $PRGNAM-$VERSION
tar xvf $CWD/$PREBUILT.tgz
tar xvf $CWD/$PRGNAM-$VERSION.src.tgz
-cd $PRGNAM-$VERSION
-
# Permissions are already set
-chown -R root:root .
+chown -R root:root $PREBUILT $PRGNAM-$VERSION
+
+cd $PRGNAM-$VERSION
# Prefer the pre-built compiler
PATH=$TMP/$PREBUILT/bin:$PATH
-make all
+
+# Without any ulimit, "amd64 code gen" uses all available memory.
+ulimit -v 4000000
+
+make -j1 all
make PREFIX="$PKG" install
+# Fix ownership of stuff from 'make install'
+chown -R root:root $PKG
+
# Binaries are already stripped
cd $PKG
mkdir -p usr
mv share/man usr
-if [ "$1" == "-docs" ]; then
+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