summaryrefslogtreecommitdiff
path: root/g
blob: 3b5778fbc59f53fa56f4cc296d43e6e7708caab9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/bash

rootname=$(cat /etc/debian_chroot 2>/dev/null)

warn="-freverse-errors -fwarn-unused-imports -Wmissing-signatures -fdefer-typed-holes"
exts="-XOverloadedStrings -XRecordWildCards"
defs="-DXMPP -DBENCODE_AESON -DTHREAD_DEBUG"
hide="-hide-package crypto-random -hide-package crypto-api -hide-package crypto-numbers -hide-package cryptohash -hide-package prettyclass"

if [ "$rootname" == "stretch" ]
    then
        echo "Building with cryptonite backport. (chroot = $rootname)"
        defs="$defs -DCRYPTONITE_BACKPORT -icryptonite-backport"
        warn="build/b/cbits/cryptonite_salsa.o build/b/cbits/cryptonite_xsalsa.o $warn"
    fi

root=${0%/*}
cd "$root"

me=${0##*/}
me=${me%.*}
ghc -threaded                        \
    $hide                            \
    $exts                            \
    $defs                            \
    -hidir build/$me$rootname -odir build/$me$rootname \
    -iPresence                       \
    -iArchive                        \
    -isrc                            \
    build/b/Presence/monitortty.o    \
    $warn                            \
    "$@"