on appveyor-fix help sign in
Idris-dev/mkpkg.sh
67 lines 1.8 kB history raw
1#!/usr/bin/env sh
3set -euo pipefail
5if [ "$#" -lt 1 ]; then
6 echo "Usage $0 [version number] ?[idris bin location]"
7 echo ""
8 echo "The first argument is the version number"
9 echo ""
10 echo "The second argument is optional, and used to point to a"
11 echo "custom location in which idris was recently built i.e."
12 echo "withing .stack-work or .cabal-sandbox. The location must"
13 echo "be given relative to the project root of a package in the "
14 echo "libs/ directory."
15 exit 1
16fi
18VERSION=${1:-}
20echo "==> Building version-$VERSION"
21echo ""
22echo "Q: Have you: (a) set the release flag & (b) checked the demos and the tutorial?"
23read ${FOO:-}
25git tag v$VERSION -a
27echo "==> Building Source Distribution"
28cabal sdist
30# Generate Idris library docs and put them in lib_docs.tar.gz in the root
31echo "==> Generating API Documentation."
32echo "==> Determining version of Idris to use."
33if [ -z ${2+x} ];
34then
35 echo "==> Using default location.";
36 make lib_doc
37else
38 echo "==> Using custom location.";
39 make -C libs IDRIS=$2 doc
40fi
42DOCDIR=`mktemp -d /tmp/docsXXXXX`
44cp -r libs/base/base_doc "$DOCDIR"
45cp -r libs/prelude/prelude_doc "$DOCDIR"
46cp -r libs/effects/effects_doc "$DOCDIR"
47cp -r libs/contrib/contrib_doc "$DOCDIR"
49tar -czvf lib_docs.tar.gz -C "$DOCDIR" prelude_doc base_doc effects_doc contrib_doc
51echo "==> Building Binaries"
52cabal configure --prefix=/usr/local
54cabal build
56echo "==> Creating Package"
57mkdir -p /tmp/idris-pkg/
59cabal copy --destdir=/tmp/idris-pkg/
61pkgbuild --identifier org.idris-lang \
62 --version "v$VERSION" \
63 --root /tmp/idris-pkg/ \
64 idris-$VERSION.pkg
66echo "==> Creating SHA256 hash (don't forget to update web site!)"
67shasum -a 256 idris-$VERSION.pkg > idris-$VERSION.pkg.sha256