summaryrefslogtreecommitdiff
path: root/p
diff options
context:
space:
mode:
authorjoe <joe@jerkface.net>2018-06-22 21:17:22 -0400
committerjoe <joe@jerkface.net>2018-06-22 21:17:22 -0400
commitf5f854c8144dc29086928a94b2ea86cfae0d0557 (patch)
tree5a7daccc1be66375edd35b238f348129f540b146 /p
parent6f040764654640730d3f832cf4e41174562718fb (diff)
Removed redundant imports and other clean up.
Diffstat (limited to 'p')
-rwxr-xr-xp36
1 files changed, 31 insertions, 5 deletions
diff --git a/p b/p
index ff1eb41b..357606ad 100755
--- a/p
+++ b/p
@@ -1,9 +1,35 @@
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
14opts="-rtsopts -hisuf p_hi -osuf p_o -prof -fprof-auto -fprof-auto-exported"
2warn="-freverse-errors -fwarn-unused-imports -Wmissing-signatures -fdefer-typed-holes" 15warn="-freverse-errors -fwarn-unused-imports -Wmissing-signatures -fdefer-typed-holes"
3exts="-XOverloadedStrings -XRecordWildCards" 16exts="-XOverloadedStrings -XRecordWildCards"
4defs="-DBENCODE_AESON -DTHREAD_DEBUG" 17defs="-DBENCODE_AESON -DTHREAD_DEBUG"
5hide="-hide-package crypto-random -hide-package crypto-api -hide-package crypto-numbers -hide-package cryptohash -hide-package prettyclass" 18hidden="crypto-random crypto-api crypto-numbers cryptohash prettyclass"
6opts="-rtsopts -hisuf p_hi -osuf p_o -prof -fprof-auto -fprof-auto-exported" 19[ "$rootname" == "stack" ] && hidden=""
20hide=""
21for h in $hidden;do
22 # too slow.
23 # ghc-pkg latest $h && hide="$hide -hide-package $h"
24 hide="$hide -hide-package $h"
25done
26
27if [ "$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
8root=${0%/*} 34root=${0%/*}
9cd "$root" 35cd "$root"
@@ -11,15 +37,15 @@ cd "$root"
11me=${0##*/} 37me=${0##*/}
12me=${me%.*} 38me=${me%.*}
13set -x 39set -x
14ghc \ 40ghc -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 "$@"