slackbuilds/d/crystal/crystal.SlackBuild

51 lines
1.5 KiB
Text
Raw Normal View History

2015-07-26 11:01:15 +02:00
#!/bin/sh
set -x -e
CWD=$(pwd)
PRGNAM=$(basename $CWD)
ARCH=$(uname -m)
2015-08-06 09:09:26 +02:00
VERSION=${VERSION:-0.7.5}
BUILD=2
2015-07-26 11:01:15 +02:00
TAG=cyco
OUTPUT=/tmp
TMP=/tmp/$TAG
PKG=$TMP/pkg-$PRGNAM
PREFIX=/usr
# cleaning
rm -fr $PKG
[ ! -e $CWD/crystal-${VERSION}-1-linux-${ARCH}.tar.gz ] && wget -c https://github.com/manastech/crystal/releases/download/${VERSION}/crystal-${VERSION}-1-linux-${ARCH}.tar.gz -O $CWD/crystal-${VERSION}-1-linux-${ARCH}.tar.gz
# installation
mkdir -p $PKG$PREFIX/{doc,libexec/${PRGNAM}}/
cd $PKG$PREFIX/doc/
tar xvf $CWD/crystal-${VERSION}-1-linux-${ARCH}.tar.gz
mv crystal-${VERSION}-1 crystal-${VERSION}
2015-08-06 09:09:26 +02:00
mv crystal-${VERSION}/{embedded,src} $PKG$PREFIX/libexec/${PRGNAM}
2015-07-26 11:01:15 +02:00
mv crystal-${VERSION}/bin $PKG$PREFIX
sed -i "s|INSTALL_DIR=.*|INSTALL_DIR=$PREFIX/libexec/$PRGNAM|g" $PKG$PREFIX/bin/crystal
# packaging
cd $PKG
mkdir install
cat <<EOF > install/slack-desc
$PRGNAM: $PRGNAM (The Crystal Programming Language)
$PRGNAM:
$PRGNAM: Crystal is a programming language with the following goals:
$PRGNAM: .Have the same syntax as Ruby, or at least as similar as possible.
$PRGNAM: .Statically type-checked but without having to specify the type of variables or
$PRGNAM: method arguments.
$PRGNAM: .Be able to call C code by writing bindings to it in Crystal.
$PRGNAM: .Have compile-time evaluation and generation of code, to avoid boilerplate code.
$PRGNAM: .Compile to efficient native code.
$PRGNAM:
$PRGNAM: http://crystal-lang.org/
EOF
makepkg -l y -c n $OUTPUT/$PRGNAM-$(echo $VERSION | tr -d '-')-$ARCH-$BUILD$TAG.txz