[Haskell-cafe] Cabal or stack in 2021 ?
Alexis Praga
alexis.praga at gmail.com
Thu Sep 30 20:53:31 UTC 2021
Speaking about a build script, FreeBSD has one for xmonad (see below,
located in /usr/local/share/examples/xmonad/build).
8<------------------------------------------------------------------------------
#!/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"
if [ ! -f "$HOME/.cabal/config" ]; then
cabal new-update
fi
# 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
res=`find $CFG_DIR/dist-newstyle -type f -perm +111 -name $EXE_NAME`
if [ "$res" == "" ]; then
return 1
fi
# use "mv" to be able to replace a running executable
mv -f "$res" "$output_file"
cp "$output_file" "$res"
fi
8<------------------------------------------------------------------------------
> On 30-09-21 12:22, Brandon Allbery wrote:
>> If you use a build script (see the xmonad-testing repo for one that works
>> with cabal projects; it's tested because I use it myself) you can get mod-q
>> back.
>
> Good reference! Thanks!
>
> --
> Rubén. (pgp: 4EE9 28F7 932E F4AD)
> _______________________________________________
> Haskell-Cafe mailing list
> To (un)subscribe, modify options or view archives go to:
> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
> Only members subscribed via the mailman list are allowed to post.
--
Alexis Praga
More information about the Haskell-Cafe
mailing list