diff options
author | joe <joe@jerkface.net> | 2018-06-22 21:17:22 -0400 |
---|---|---|
committer | joe <joe@jerkface.net> | 2018-06-22 21:17:22 -0400 |
commit | f5f854c8144dc29086928a94b2ea86cfae0d0557 (patch) | |
tree | 5a7daccc1be66375edd35b238f348129f540b146 /p | |
parent | 6f040764654640730d3f832cf4e41174562718fb (diff) |
Removed redundant imports and other clean up.
Diffstat (limited to 'p')
-rwxr-xr-x | p | 36 |
1 files changed, 31 insertions, 5 deletions
@@ -1,9 +1,35 @@ | |||
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 | |||
14 | opts="-rtsopts -hisuf p_hi -osuf p_o -prof -fprof-auto -fprof-auto-exported" | ||
2 | warn="-freverse-errors -fwarn-unused-imports -Wmissing-signatures -fdefer-typed-holes" | 15 | warn="-freverse-errors -fwarn-unused-imports -Wmissing-signatures -fdefer-typed-holes" |
3 | exts="-XOverloadedStrings -XRecordWildCards" | 16 | exts="-XOverloadedStrings -XRecordWildCards" |
4 | defs="-DBENCODE_AESON -DTHREAD_DEBUG" | 17 | 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" | 18 | hidden="crypto-random crypto-api crypto-numbers cryptohash prettyclass" |
6 | opts="-rtsopts -hisuf p_hi -osuf p_o -prof -fprof-auto -fprof-auto-exported" | 19 | [ "$rootname" == "stack" ] && hidden="" |
20 | hide="" | ||
21 | for h in $hidden;do | ||
22 | # too slow. | ||
23 | # ghc-pkg latest $h && hide="$hide -hide-package $h" | ||
24 | hide="$hide -hide-package $h" | ||
25 | done | ||
26 | |||
27 | if [ "$rootname" == "stretch" ] | ||
28 | then | ||
29 | echo "Building with cryptonite backport. (chroot = $rootname)" | ||
30 | defs="$defs -DCRYPTONITE_BACKPORT -icryptonite-backport" | ||
31 | warn="$BUILDB/cbits/cryptonite_salsa.o $BUILDB/cbits/cryptonite_xsalsa.o $warn" | ||
32 | fi | ||
7 | 33 | ||
8 | root=${0%/*} | 34 | root=${0%/*} |
9 | cd "$root" | 35 | cd "$root" |
@@ -11,15 +37,15 @@ cd "$root" | |||
11 | me=${0##*/} | 37 | me=${0##*/} |
12 | me=${me%.*} | 38 | me=${me%.*} |
13 | set -x | 39 | set -x |
14 | ghc \ | 40 | ghc -threaded \ |
15 | $opts \ | 41 | $opts \ |
16 | $hide \ | 42 | $hide \ |
17 | $exts \ | 43 | $exts \ |
18 | $defs \ | 44 | $defs \ |
19 | -hidir build/$me -odir build/$me \ | 45 | -hidir build/$me$rootname -odir build/$me$rootname \ |
20 | -iPresence \ | 46 | -iPresence \ |
21 | -iArchive \ | 47 | -iArchive \ |
22 | -isrc \ | 48 | -isrc \ |
23 | build/b/Presence/monitortty.o \ | 49 | $BUILDB/Presence/monitortty.o \ |
24 | $warn \ | 50 | $warn \ |
25 | "$@" | 51 | "$@" |