summaryrefslogtreecommitdiff
path: root/gi
diff options
context:
space:
mode:
Diffstat (limited to 'gi')
-rwxr-xr-xgi37
1 files changed, 31 insertions, 6 deletions
diff --git a/gi b/gi
index 907baf11..833cac1b 100755
--- a/gi
+++ b/gi
@@ -1,24 +1,49 @@
1#!/bin/bash 1#!/bin/bash
2
3rootname=$(cat /etc/debian_chroot 2>/dev/null)
4echo $PATH | grep '\.stack' >/dev/null && rootname="stack"
5BUILDB=
6for 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
11done
12[ -z "$BUILDB" ] && { echo "Where is monitortty.o?"; exit 1; }
13
2warn="-freverse-errors -fwarn-unused-imports -Wmissing-signatures -fdefer-typed-holes" 14warn="-freverse-errors -fwarn-unused-imports -Wmissing-signatures -fdefer-typed-holes"
3exts="-XOverloadedStrings -XRecordWildCards" 15exts="-XOverloadedStrings -XRecordWildCards"
4defs="-DXMPP -DBENCODE_AESON -DTHREAD_DEBUG" 16defs="-DBENCODE_AESON -DTHREAD_DEBUG"
5hide="-hide-package crypto-random -hide-package crypto-api -hide-package crypto-numbers -hide-package cryptohash -hide-package prettyclass" 17hidden="crypto-random crypto-api crypto-numbers cryptohash prettyclass"
18[ "$rootname" == "stack" ] && hidden=""
19hide=""
20for h in $hidden;do
21 # too slow.
22 # ghc-pkg latest $h && hide="$hide -hide-package $h"
23 hide="$hide -hide-package $h"
24done
25
26if [ "$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
7root=${0%/*} 33root=${0%/*}
8cd "$root" 34cd "$root"
9 35
10me=${0##*/} 36me=${0##*/}
11me=${me%.*} 37me=${me%.*}
38set -x
12ghci -fobject-code \ 39ghci -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 "$@"