2017-01-29 09:49:26 +03:00
|
|
|
#!/usr/bin/env sh
|
2014-02-04 01:36:11 +04:00
|
|
|
|
2016-11-29 15:09:17 +03:00
|
|
|
set -euo pipefail
|
2014-02-04 20:07:00 +04:00
|
|
|
|
2016-11-29 15:09:17 +03:00
|
|
|
if [ "$#" -lt 1 ]; then
|
|
|
|
echo "Usage $0 [version number] ?[idris bin location]"
|
|
|
|
echo ""
|
|
|
|
echo "The first argument is the version number"
|
|
|
|
echo ""
|
|
|
|
echo "The second argument is optional, and used to point to a"
|
|
|
|
echo "custom location in which idris was recently built i.e."
|
|
|
|
echo "withing .stack-work or .cabal-sandbox. The location must"
|
|
|
|
echo "be given relative to the project root of a package in the "
|
|
|
|
echo "libs/ directory."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
VERSION=${1:-}
|
|
|
|
|
|
|
|
echo "==> Building version-$VERSION"
|
|
|
|
echo ""
|
|
|
|
echo "Q: Have you: (a) set the release flag & (b) checked the demos and the tutorial?"
|
|
|
|
read ${FOO:-}
|
2014-02-04 01:36:11 +04:00
|
|
|
|
2014-02-04 20:07:00 +04:00
|
|
|
git tag v$VERSION -a
|
2014-02-04 01:36:11 +04:00
|
|
|
|
2016-11-29 15:09:17 +03:00
|
|
|
echo "==> Building Source Distribution"
|
2014-02-04 01:36:11 +04:00
|
|
|
cabal sdist
|
|
|
|
|
2015-03-19 20:58:20 +03:00
|
|
|
# Generate Idris library docs and put them in lib_docs.tar.gz in the root
|
2016-11-29 15:09:17 +03:00
|
|
|
echo "==> Generating API Documentation."
|
|
|
|
echo "==> Determining version of Idris to use."
|
|
|
|
if [ -z ${2+x} ];
|
|
|
|
then
|
|
|
|
echo "==> Using default location.";
|
|
|
|
make lib_doc
|
|
|
|
else
|
|
|
|
echo "==> Using custom location.";
|
|
|
|
make -C libs IDRIS=$2 doc
|
|
|
|
fi
|
|
|
|
|
2015-03-19 20:58:20 +03:00
|
|
|
DOCDIR=`mktemp -d /tmp/docsXXXXX`
|
2016-11-29 15:09:17 +03:00
|
|
|
|
2015-03-19 20:58:20 +03:00
|
|
|
cp -r libs/base/base_doc "$DOCDIR"
|
|
|
|
cp -r libs/prelude/prelude_doc "$DOCDIR"
|
|
|
|
cp -r libs/effects/effects_doc "$DOCDIR"
|
|
|
|
cp -r libs/contrib/contrib_doc "$DOCDIR"
|
2016-11-29 15:09:17 +03:00
|
|
|
|
2015-03-19 20:58:20 +03:00
|
|
|
tar -czvf lib_docs.tar.gz -C "$DOCDIR" prelude_doc base_doc effects_doc contrib_doc
|
|
|
|
|
2016-11-29 15:09:17 +03:00
|
|
|
echo "==> Building Binaries"
|
2014-02-04 01:36:11 +04:00
|
|
|
cabal configure --prefix=/usr/local
|
2016-11-29 15:09:17 +03:00
|
|
|
|
2014-02-04 01:36:11 +04:00
|
|
|
cabal build
|
2016-11-29 15:09:17 +03:00
|
|
|
|
|
|
|
echo "==> Creating Package"
|
|
|
|
mkdir -p /tmp/idris-pkg/
|
|
|
|
|
2014-02-04 01:36:11 +04:00
|
|
|
cabal copy --destdir=/tmp/idris-pkg/
|
|
|
|
|
2016-11-29 15:09:17 +03:00
|
|
|
pkgbuild --identifier org.idris-lang \
|
|
|
|
--version "v$VERSION" \
|
|
|
|
--root /tmp/idris-pkg/ \
|
|
|
|
idris-$VERSION.pkg
|
2017-03-08 13:59:30 +03:00
|
|
|
|
|
|
|
echo "==> Creating SHA256 hash (don't forget to update web site!)"
|
|
|
|
shasum -a 256 idris-$VERSION.pkg > idris-$VERSION.pkg.sha256
|