aboutsummaryrefslogtreecommitdiff
path: root/x11-wm/hs-xmonad/files/example_buildscript
blob: 2e10fbc6f68446559c8a0b1b4b769b7e0bcc7441 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/sh

# must match "executable" line from xmonad-config.cabal
EXE_NAME=xmonad-config

# xmonad tells us how it want resulting executable to be named
output_file=$1; shift

CFG_DIR=$HOME/.xmonad

# build the config
cd $CFG_DIR
cabal new-configure --enable-optimization --enable-executable-stripping
cabal new-build

if [ "$output_file" != "" ]; then
# move resulting binary where it was requested to reside
find $CFG_DIR/dist-newstyle -type f -perm +111 -name $EXE_NAME \
     -exec mv '{}' $output_file ';'
fi