svn commit: r565321 - in head/x11-wm/hs-xmonad: . files
Gleb Popov
arrowd at FreeBSD.org
Mon Feb 15 18:25:26 UTC 2021
Author: arrowd
Date: Mon Feb 15 18:25:25 2021
New Revision: 565321
URL: https://svnweb.freebsd.org/changeset/ports/565321
Log:
x11-wm/hs-xmonad: Improve the sample build script.
PR: 253167
Modified:
head/x11-wm/hs-xmonad/Makefile
head/x11-wm/hs-xmonad/files/example_buildscript
Modified: head/x11-wm/hs-xmonad/Makefile
==============================================================================
--- head/x11-wm/hs-xmonad/Makefile Mon Feb 15 17:23:14 2021 (r565320)
+++ head/x11-wm/hs-xmonad/Makefile Mon Feb 15 18:25:25 2021 (r565321)
@@ -3,7 +3,7 @@
PORTNAME= xmonad
PORTVERSION= 0.15
-PORTREVISION= 7
+PORTREVISION= 8
CATEGORIES= x11-wm haskell
MAINTAINER= haskell at FreeBSD.org
Modified: head/x11-wm/hs-xmonad/files/example_buildscript
==============================================================================
--- head/x11-wm/hs-xmonad/files/example_buildscript Mon Feb 15 17:23:14 2021 (r565320)
+++ head/x11-wm/hs-xmonad/files/example_buildscript Mon Feb 15 18:25:25 2021 (r565321)
@@ -6,16 +6,24 @@ EXE_NAME=xmonad-config
# xmonad tells us how it want resulting executable to be named
output_file=$1; shift
-CFG_DIR=$HOME/.xmonad
+CFG_DIR="$HOME/.xmonad"
+if [ ! -f "$HOME/.cabal/config" ]; then
+cabal new-update
+fi
+
# build the config
cd $CFG_DIR
-cabal new-clean || true
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 ';'
+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
More information about the svn-ports-all
mailing list