diff options
author | Joe Crayne <joe@jerkface.net> | 2018-07-06 05:25:22 -0400 |
---|---|---|
committer | Joe Crayne <joe@jerkface.net> | 2018-07-06 05:25:36 -0400 |
commit | aa60c13ee0784cc2e8765c55a224b035d57ee64f (patch) | |
tree | 66c13ac08aa0775b1627bd812698d0b41c8d351e | |
parent | ea3f4e6543b6dddd94898c945a8ad2c24a46ae77 (diff) |
Updated gi script to match g script.
-rwxr-xr-x | gi | 37 |
1 files changed, 31 insertions, 6 deletions
@@ -1,24 +1,49 @@ | |||
1 | #!/bin/bash | 1 | #!/bin/bash |
2 | |||
3 | rootname=$(cat /etc/debian_chroot 2>/dev/null) | ||
4 | echo $PATH | grep '\.stack' >/dev/null && rootname="stack" | ||
5 | BUILDB= | ||
6 | for b in build/b/Presence/monitortty.o .stack-work/dist/x86_64-linux/Cabal-*/build/Presence/monitortty.o; do | ||
7 | if [ -f $b ]; then | ||
8 | BUILDB=$(dirname $(dirname $b)) | ||
9 | break | ||
10 | fi | ||
11 | done | ||
12 | [ -z "$BUILDB" ] && { echo "Where is monitortty.o?"; exit 1; } | ||
13 | |||
2 | warn="-freverse-errors -fwarn-unused-imports -Wmissing-signatures -fdefer-typed-holes" | 14 | warn="-freverse-errors -fwarn-unused-imports -Wmissing-signatures -fdefer-typed-holes" |
3 | exts="-XOverloadedStrings -XRecordWildCards" | 15 | exts="-XOverloadedStrings -XRecordWildCards" |
4 | defs="-DXMPP -DBENCODE_AESON -DTHREAD_DEBUG" | 16 | defs="-DBENCODE_AESON -DTHREAD_DEBUG" |
5 | hide="-hide-package crypto-random -hide-package crypto-api -hide-package crypto-numbers -hide-package cryptohash -hide-package prettyclass" | 17 | hidden="crypto-random crypto-api crypto-numbers cryptohash prettyclass" |
18 | [ "$rootname" == "stack" ] && hidden="" | ||
19 | hide="" | ||
20 | for h in $hidden;do | ||
21 | # too slow. | ||
22 | # ghc-pkg latest $h && hide="$hide -hide-package $h" | ||
23 | hide="$hide -hide-package $h" | ||
24 | done | ||
25 | |||
26 | if [ "$rootname" == "stretch" ] | ||
27 | then | ||
28 | echo "Building with cryptonite backport. (chroot = $rootname)" | ||
29 | defs="$defs -DCRYPTONITE_BACKPORT -icryptonite-backport" | ||
30 | warn="$BUILDB/cbits/cryptonite_salsa.o $BUILDB/cbits/cryptonite_xsalsa.o $warn" | ||
31 | fi | ||
6 | 32 | ||
7 | root=${0%/*} | 33 | root=${0%/*} |
8 | cd "$root" | 34 | cd "$root" |
9 | 35 | ||
10 | me=${0##*/} | 36 | me=${0##*/} |
11 | me=${me%.*} | 37 | me=${me%.*} |
38 | set -x | ||
12 | ghci -fobject-code \ | 39 | ghci -fobject-code \ |
13 | $hide \ | 40 | $hide \ |
14 | $exts \ | 41 | $exts \ |
15 | $defs \ | 42 | $defs \ |
16 | -hidir build/$me -odir build/$me \ | 43 | -hidir build/$me$rootname -odir build/$me$rootname \ |
17 | -iPresence \ | 44 | -iPresence \ |
18 | -iArchive \ | 45 | -iArchive \ |
19 | -isrc \ | 46 | -isrc \ |
20 | build/b/Presence/monitortty.o \ | 47 | $BUILDB/Presence/monitortty.o \ |
21 | build/b/cbits/cryptonite_salsa.o \ | ||
22 | build/b/cbits/cryptonite_xsalsa.o\ | ||
23 | $warn \ | 48 | $warn \ |
24 | "$@" | 49 | "$@" |