aboutsummaryrefslogtreecommitdiff
path: root/x11-wm/stumpwm
diff options
context:
space:
mode:
authorAshish SHUKLA <ashish@FreeBSD.org>2010-09-15 11:56:58 +0000
committerAshish SHUKLA <ashish@FreeBSD.org>2010-09-15 11:56:58 +0000
commitc3240587788f9b0e086c557d4d9a257ac80bd451 (patch)
tree905ee8dd558a8391facc35f78cb753be26770343 /x11-wm/stumpwm
parentdd8b92a932dc5ef0e992bc4dc9a312fdfd247f6c (diff)
downloadports-c3240587788f9b0e086c557d4d9a257ac80bd451.tar.gz
ports-c3240587788f9b0e086c557d4d9a257ac80bd451.zip
Notes
Diffstat (limited to 'x11-wm/stumpwm')
-rw-r--r--x11-wm/stumpwm/Makefile37
-rw-r--r--x11-wm/stumpwm/files/patch-contrib-stumpish178
2 files changed, 208 insertions, 7 deletions
diff --git a/x11-wm/stumpwm/Makefile b/x11-wm/stumpwm/Makefile
index b2216ed66feb..bd72f61cb103 100644
--- a/x11-wm/stumpwm/Makefile
+++ b/x11-wm/stumpwm/Makefile
@@ -7,7 +7,8 @@
PORTNAME= stumpwm
PORTVERSION= 0.9.7
-CATEGORIES= x11-wm
+PORTREVISION= 1
+CATEGORIES= x11-wm lisp
MASTER_SITES= SAVANNAH
DISTFILES= ${DISTNAME}.tgz
@@ -15,10 +16,17 @@ MAINTAINER= ports@FreeBSD.org
COMMENT= A tiling, keyboard driven Window Manager written in Common Lisp
GNU_CONFIGURE= yes
+CONFIGURE_ARGS= --with-contrib-dir=${DATADIR}
MAKE_JOBS_UNSAFE=yes
-PLIST_FILES= bin/${PORTNAME}
+LICENSE= GPLv2
+LICENSE_FILE= ${WRKSRC}/COPYING
+
+PLIST_FILES= bin/stumpish \
+ bin/${PORTNAME}
INFO= ${PORTNAME}
+PORTEXAMPLES= sample-stumpwmrc.lisp
+PORTDATA= *
OPTIONS= SBCL "Build with lang/sbcl (otherwise with lang/clisp)" on
@@ -30,10 +38,10 @@ DISTFILES+= clx-0.7.4.tgz:clx
.endif
.if defined(WITH_SBCL)
-CONFIGURE_ARGS= --with-lisp=sbcl
+CONFIGURE_ARGS+= --with-lisp=sbcl
BUILD_DEPENDS+= sbcl:${PORTSDIR}/lang/sbcl
.else
-CONFIGURE_ARGS= --with-lisp=clisp
+CONFIGURE_ARGS+= --with-lisp=clisp
BUILD_DEPENDS+= clisp:${PORTSDIR}/lang/clisp
.endif
@@ -49,12 +57,27 @@ post-extract: .SILENT
${LN} -sf ${WRKDIR}/clx*/*.asd ${WRKSRC}/cl-ppcre/*.asd ${WRKSRC}
post-patch: .SILENT
- ${REINPLACE_CMD} 's|sbcl_.*OPTS=|&--disable-debugger --no-userinit \
+ ${REINPLACE_CMD} 's|sbcl_.*OPTS=|& \
+ --disable-debugger \
+ --no-userinit \
+ --no-sysinit \
--eval "(require :asdf)" \
- --eval "(pop asdf:*central-registry*)" |' \
- ${WRKSRC}/Makefile.in
+ --eval "(pop asdf:*central-registry*)" \
+ |' ${WRKSRC}/Makefile.in
${REINPLACE_CMD} 's/\(sb-introspect:function-\)arglist/\1lambda-list/' \
${WRKSRC}/manual.lisp
.endif
+post-install:
+ ${INSTALL_SCRIPT} ${WRKSRC}/contrib/stumpish ${PREFIX}/bin
+.if !defined(NOPORTEXAMPLES)
+ ${MKDIR} ${EXAMPLESDIR}
+ ${INSTALL_DATA} ${WRKSRC}/${PORTEXAMPLES} ${EXAMPLESDIR}
+.endif
+.if !defined(NOPORTDATA)
+ ${MKDIR} ${DATADIR}
+ ${TAR} cf - -C${WRKSRC}/contrib --exclude stumpish\* . \
+ | ${TAR} xovf - -C${DATADIR}
+.endif
+
.include <bsd.port.mk>
diff --git a/x11-wm/stumpwm/files/patch-contrib-stumpish b/x11-wm/stumpwm/files/patch-contrib-stumpish
new file mode 100644
index 000000000000..ad545e8ffea2
--- /dev/null
+++ b/x11-wm/stumpwm/files/patch-contrib-stumpish
@@ -0,0 +1,178 @@
+ - use `echo' wrapper and work around \0XXX vs. \XXX in dash
+ - use tput(1) wrapper and try termcap(5) capabilities first
+ - remove GNUisms from sed(1) lines without breaking GNU sed usage
+ - try to guess whether sleep(1) supports fractions
+ - prevent word splitting when reading command list
+ - remove command list not only when exiting but on SIGINT and SIGTERM, too
+ - don't use backquotes, they have side effect of removing one layer of quoting
+ - prevent glob expansion when stripping output
+ - no need for persistence across reboots, use /tmp and TMPDIR from environ(7)
+ - remove workaround for `read -p', it's supported by every ash descendant
+ - correct example line in usage
+
+---
+ contrib/stumpish | 93 ++++++++++++++++++++++++++++++++++++-----------------
+ 1 files changed, 63 insertions(+), 30 deletions(-)
+
+diff --git contrib/stumpish~ contrib/stumpish
+index 1d48bb4..2b0fca1 100755
+--- contrib/stumpish~
++++ contrib/stumpish
+@@ -21,19 +21,25 @@
+
+ ### STUMPwm Interactive SHell.
+
+-if sleep --version 2>/dev/null | grep -q GNU
++DELAY=0.01
++
++if ! sleep $DELAY 2>/dev/null >&2
+ then
+- DELAY=0.1
+-else
+ DELAY=1
+ fi
+
++# parse C-style backslash sequences by default
++if [ "$(echo -e foo)" = foo ]; then
++ echo() { builtin echo -e "$@"; }
++fi
++
+ wait_result ()
+ {
+ while true
+ do
+- RESULT=`xprop -root -f STUMPWM_COMMAND_RESULT 8s STUMPWM_COMMAND_RESULT 2>/dev/null`
+-
++ RESULT=$(xprop -root -f STUMPWM_COMMAND_RESULT 8s \
++ STUMPWM_COMMAND_RESULT 2>/dev/null |
++ sed -E 's/\\([[:digit:]]+)/\\0\1/g')
+ if echo "$RESULT" | grep -v -q 'not found.$'
+ then
+ break
+@@ -49,8 +55,14 @@ wait_result ()
+ return 1
+ fi
+
+- echo $RESULT | sed 's/[^"]*"//;s/"$//;s/\\n/\n/g;s/\\"/"/g;s/\n\+$//;
+- s/\^[*[:digit:]]\{2\}//g;s/\^[Bbn]//g;'
++ echo "$RESULT" |
++ sed -E 's/[^"\\n]+"//
++ s/"[[:space:]]*$//
++ s/([^\\])\\n/\1\
++/g
++ s/\\(["\\n])/\1/g
++ s/\^([*[:digit:]]+|[Bbn])//g' |
++ sed '/^[[:space:]]*$/d'
+ }
+
+ send_cmd ()
+@@ -73,7 +85,7 @@ send_cmd ()
+ usage ()
+ {
+ cat <<EOF
+-Usage: "$0" [[-e] command [args...]]
++Usage: ${0##*/} [[-e|-r] command [args...]]
+
+ StumpIsh is the StumpWM shell. Use it to interact a running StumpWM
+ instance. When run from a terminal with no arguments, stumpish
+@@ -87,11 +99,31 @@ the first is considered the name of the command to execute and the
+ remainder is concatenated to form the argument.
+
+ Example:
+- echo '(group-windows (current-group))' | "$0" eval
++ echo '(group-windows (current-group))' | ${0##*/} -e eval
+ EOF
+ exit 0;
+ }
+
++warn ()
++{
++ {
++ tput md bold
++ tput AF setaf 1
++ echo 'WARN:\c'
++ tput me sgr0
++ echo " $*"
++ } >&2
++}
++
++tput ()
++{
++ local cap1=$1 cap2=$2
++ shift 2
++
++ command tput $cap1 $@ 2>/dev/null ||
++ command tput $cap2 $@ 2>/dev/null
++}
++
+ READLINE=yes
+
+ if [ "x$1" = "x-r" ]
+@@ -112,7 +144,7 @@ then
+ fi
+ shift 1
+ IFS=''
+- ARGS=`cat /dev/stdin`
++ ARGS=$(cat /dev/stdin)
+ send_cmd "$1 $ARGS"
+ else
+ IFS=' '
+@@ -121,37 +153,36 @@ then
+ else
+ if [ -t 0 ]
+ then
+- if [ $READLINE = yes ] && type rlwrap >/dev/null 2>&1
++ if ! type rlwrap 2>/dev/null >&2
+ then
+- # Note: $TEMP is not conventional; it is left here purely
+- # for backwards compatibility.
+- COMMANDS="${TEMP:-${TEMPDIR:-/var/tmp}}/stumpish.commands.$$"
+- echo `send_cmd "commands"` | sed 's/[[:space:]]\+/\n/g' | sort > "$COMMANDS"
+- rlwrap -f "$COMMANDS" "$0" -r
+- rm -f "$COMMANDS"
++ warn rlwrap not found, command completion won\'t work
++ elif [ $READLINE = yes ]
++ then
++ COMMANDS="${TMPDIR:-/tmp}/stumpish.commands.$$"
++ echo $(send_cmd "commands") |
++ sed -E 's/[[:space:]]+/\
++/g' |
++ sort > "$COMMANDS"
++ trap 'rm -f "$COMMANDS"' exit int term
++ rlwrap -b '' -f "$COMMANDS" "$0" -r
+ exit
+ fi
+
+- tput setaf 5
++ tput AF setaf 5
+ echo Welcome to the STUMPwm Interactive SHell.
+- tput sgr0
+- echo -n 'Type '
+- tput setaf 2
+- echo -n commands
+- tput sgr0
++ tput me sgr0
++ echo 'Type \c'
++ tput AF setaf 2
++ echo 'commands\c'
++ tput me sgr0
+ echo \ for a list of commands.
+
+- IFS='
+-'
+- echo -n "> "
+- while read REPLY
++ while read -p '> ' REPLY
+ do
+- tput bold
+- tput setaf 2
++ tput md bold
++ tput AF setaf 2
+ send_cmd "$REPLY"
+- tput sgr0
+-
+- echo -n "> "
++ tput me sgr0
+ done
+ else
+ while read REPLY