View | Details | Raw Unified | Return to bug 149397
Collapse All | Expand All

(-)x11-wm/stumpwm/Makefile (-4 / +17 lines)
Lines 17-24 COMMENT= A tiling, keyboard driven Windo Link Here
17
GNU_CONFIGURE=	yes
17
GNU_CONFIGURE=	yes
18
MAKE_JOBS_UNSAFE=yes
18
MAKE_JOBS_UNSAFE=yes
19
19
20
PLIST_FILES=	bin/${PORTNAME}
20
PLIST_FILES=	bin/stumpish \
21
		bin/${PORTNAME}
21
INFO=		${PORTNAME}
22
INFO=		${PORTNAME}
23
PORTDATA=	*
22
24
23
OPTIONS=	SBCL "Build with lang/sbcl (otherwise with lang/clisp)" on
25
OPTIONS=	SBCL "Build with lang/sbcl (otherwise with lang/clisp)" on
24
26
Lines 49-60 post-extract: .SILENT Link Here
49
	${LN} -sf ${WRKDIR}/clx*/*.asd ${WRKSRC}/cl-ppcre/*.asd ${WRKSRC}
51
	${LN} -sf ${WRKDIR}/clx*/*.asd ${WRKSRC}/cl-ppcre/*.asd ${WRKSRC}
50
52
51
post-patch:	.SILENT
53
post-patch:	.SILENT
52
	${REINPLACE_CMD} 's|sbcl_.*OPTS=|&--disable-debugger --no-userinit \
54
	${REINPLACE_CMD} 's|sbcl_.*OPTS=|& \
55
		--disable-debugger \
56
		--no-userinit \
57
		--no-sysinit \
53
		--eval "(require :asdf)" \
58
		--eval "(require :asdf)" \
54
		--eval "(pop asdf:*central-registry*)" |' \
59
		--eval "(pop asdf:*central-registry*)" \
55
		${WRKSRC}/Makefile.in
60
		|' ${WRKSRC}/Makefile.in
56
	${REINPLACE_CMD} 's/\(sb-introspect:function-\)arglist/\1lambda-list/' \
61
	${REINPLACE_CMD} 's/\(sb-introspect:function-\)arglist/\1lambda-list/' \
57
		${WRKSRC}/manual.lisp
62
		${WRKSRC}/manual.lisp
58
.endif
63
.endif
59
64
65
post-install:
66
	${INSTALL_SCRIPT} ${WRKSRC}/contrib/stumpish ${PREFIX}/bin
67
.if !defined(NOPORTDATA)
68
	${MKDIR} ${DATADIR}
69
	${TAR} cf - -C${WRKSRC}/contrib --exclude stumpish\* . \
70
		| ${TAR} xovf - -C${DATADIR}
71
.endif
72
60
.include <bsd.port.mk>
73
.include <bsd.port.mk>
(-)x11-wm/stumpwm/files/patch-contrib-stumpish (+98 lines)
Added Link Here
1
  - spout a warning when command completion cannot be used
2
  - try to guess whether sleep(1) supports fractions
3
  - remove GNUisms from sed(1) lines without breaking GNU sed usage
4
  - use termcap names, they have higher chance to work on FreeBSD
5
6
diff --git contrib/stumpish~ contrib/stumpish
7
index 1d48bb4..59c783e 100755
8
--- contrib/stumpish~
9
+++ contrib/stumpish
10
@@ -21,10 +21,10 @@
11
 
12
 ### STUMPwm Interactive SHell.
13
 
14
-if sleep --version 2>/dev/null | grep -q GNU
15
+DELAY=0.01
16
+
17
+if ! sleep $DELAY 2>/dev/null >&2
18
 then
19
-    DELAY=0.1
20
-else
21
     DELAY=1
22
 fi
23
 
24
@@ -49,8 +49,16 @@ wait_result ()
25
 	return 1
26
     fi
27
 
28
-    echo $RESULT | sed 's/[^"]*"//;s/"$//;s/\\n/\n/g;s/\\"/"/g;s/\n\+$//;
29
-			s/\^[*[:digit:]]\{2\}//g;s/\^[Bbn]//g;'
30
+    echo $RESULT |
31
+    sed -E 's/[^"]*"//
32
+            s/"$//
33
+            s/([^\])\\n/\1\
34
+/g
35
+            s/\\\\n/\\n/g
36
+            s/\\"/"/g
37
+            s/\\n[[:space:]]+$//
38
+            s/\^[*[:digit:]]{2}//g
39
+            s/\^[Bbn]//g'
40
 }
41
 
42
 send_cmd ()
43
@@ -121,24 +129,34 @@ then
44
 else
45
     if [ -t 0 ]
46
     then
47
-	if [ $READLINE = yes ] && type rlwrap >/dev/null 2>&1
48
+	if ! type rlwrap 2>/dev/null >&2
49
+	then
50
+	    tput md
51
+	    tput AF 1
52
+	    echo -n WARN:
53
+	    tput me
54
+	    echo \ rlwrap not found, command completion won\'t work. >&2
55
+	elif [ $READLINE = yes ]
56
 	then
57
 	    # Note: $TEMP is not conventional; it is left here purely
58
 	    # for backwards compatibility.
59
-	    COMMANDS="${TEMP:-${TEMPDIR:-/var/tmp}}/stumpish.commands.$$"
60
-	    echo `send_cmd "commands"` | sed 's/[[:space:]]\+/\n/g' | sort > "$COMMANDS"
61
+	    COMMANDS="${TEMPDIR:-/tmp}/stumpish.commands.$$"
62
+	    echo `send_cmd "commands"` |
63
+	    sed -E 's/[[:space:]]+/\
64
+/g' |
65
+	    sort > "$COMMANDS"
66
 	    rlwrap -f "$COMMANDS" "$0" -r
67
 	    rm -f "$COMMANDS"
68
 	    exit
69
 	fi
70
 
71
-	tput setaf 5
72
+	tput AF 5
73
         echo Welcome to the STUMPwm Interactive SHell.
74
-        tput sgr0
75
+        tput me
76
         echo -n 'Type '
77
-        tput setaf 2
78
+        tput AF 2
79
         echo -n commands
80
-        tput sgr0
81
+        tput me
82
         echo \ for a list of commands.
83
 
84
         IFS='
85
@@ -146,10 +164,10 @@ else
86
 	echo -n "> "
87
 	while read REPLY
88
 	do
89
-	    tput bold
90
-	    tput setaf 2
91
+	    tput md
92
+	    tput AF 2
93
 	    send_cmd "$REPLY"
94
-	    tput sgr0
95
+	    tput me
96
 
97
 	    echo -n "> "
98
 	done

Return to bug 149397