about summary refs log tree commit diff
path: root/build-scripts/build-cabal-sandbox
blob: 435fa434df88ab16070f1e4353c41acfdbfcc999 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/sh -eu

SRC_DIR="$HOME/.xmonad"
EXE_NAME="xmonad-ng"
OUT="$1"

shift

cd "$SRC_DIR" || exit 1

cabal sandbox init

cabal configure \
	--enable-optimization \
	--enable-executable-stripping

cabal install --only-dependencies

cabal build

find "$SRC_DIR"/dist -type f -executable -name "$EXE_NAME" \
    -exec mv -u '{}' "$OUT" ';'

Consider giving Nix/NixOS a try! <3