aboutsummaryrefslogtreecommitdiff
path: root/x11-wm/wmii
diff options
context:
space:
mode:
authorAlexey Dokuchaev <danfe@FreeBSD.org>2009-09-11 12:03:26 +0000
committerAlexey Dokuchaev <danfe@FreeBSD.org>2009-09-11 12:03:26 +0000
commit69f48bfa89cacbb1f177d8307e8fcdc05e273534 (patch)
tree4759574b26b4d03291218b7c592b5f74810d368b /x11-wm/wmii
parent356fc32d9c4adccf615a8068d859702b7ac811a7 (diff)
downloadports-69f48bfa89cacbb1f177d8307e8fcdc05e273534.tar.gz
ports-69f48bfa89cacbb1f177d8307e8fcdc05e273534.zip
Try to further improve user experience with WMII:
- Since default layout boxes actually just look ugly, but are still useful, rework previous solution: instead of omitting them completely, draw them in a slim fashion. Also, give option a better name (SLIM_LAYOUT_BOX) - Apparently, Xmb* -> Xutf8* conversion was only safe thing to do with UTF-8 locales; those who use traditional (8-bit) locales and experience problems with fonts should try rebuilding the port with UTF8_TEXT option unset - Since our `devel/9base' port installs rc(1) but not read(1), it is of little use as rdep anyway (`devel/plan9port' installs more complete set of things, but is unfortunately broken on 8.0+) - While here, pacify portlint(1) and remove _XOPEN_SOURCE definition to prevent some warnings
Notes
Notes: svn path=/head/; revision=241216
Diffstat (limited to 'x11-wm/wmii')
-rw-r--r--x11-wm/wmii/Makefile28
-rw-r--r--x11-wm/wmii/files/extra-patch-slim-layout-boxes24
-rw-r--r--x11-wm/wmii/files/patch-no-utf891
3 files changed, 133 insertions, 10 deletions
diff --git a/x11-wm/wmii/Makefile b/x11-wm/wmii/Makefile
index f90ec79840ef..d08b1574f653 100644
--- a/x11-wm/wmii/Makefile
+++ b/x11-wm/wmii/Makefile
@@ -7,7 +7,7 @@
PORTNAME= wmii
DISTVERSION= 3.6
-PORTREVISION= 2
+PORTREVISION= 3
CATEGORIES= x11-wm
MASTER_SITES= http://dl.suckless.org/wmii/
@@ -15,28 +15,39 @@ MAINTAINER= danfe@FreeBSD.org
COMMENT= A dynamic, minimalist window manager for X11
LIB_DEPENDS= ixp.1:${PORTSDIR}/devel/libixp
-RUN_DEPENDS= dmenu:${PORTSDIR}/x11/dmenu \
- ${LOCALBASE}/9/bin/rc:${PORTSDIR}/devel/9base
+RUN_DEPENDS= dmenu:${PORTSDIR}/x11/dmenu
-CONFLICTS= wmii-s*
+CONFLICTS= wmii-s[0-9]*
-USE_ICONV= yes
USE_XORG= x11 xextproto xt xext
MAKE_ARGS= PREFIX="${PREFIX}" INCLUDE="${LOCALBASE}/include" \
INCX11="-I${LOCALBASE}/include" LIBX11="-L${LOCALBASE}/lib" \
CC="${CC} -c" LD="${CC}" LIBIXP="-lixp" STATIC="" \
- LIBICONV="-liconv" MAN="${MANPREFIX}/man"
+ MAN="${MANPREFIX}/man"
MAN1= wmii.1 wmiiloop.1 wmiir.1
-OPTIONS= LAYOUT_BOXES "Show layout boxes (some people hate them)" on
+OPTIONS= SLIM_LAYOUT_BOX "Build with slim layout boxes" off \
+ UTF8_TEXT "Work with UTF-8 instead of user locale" on
.include <bsd.port.options.mk>
+.if defined(WITH_UTF8_TEXT)
+USE_ICONV= yes
+MAKE_ARGS+= LIBICONV="-liconv"
+.else
+MAKE_ARGS+= -DNO_UTF8
+.endif
+
+.if defined(WITH_SLIM_LAYOUT_BOX)
+EXTRA_PATCHES+= ${FILESDIR}/extra-patch-slim-layout-boxes
+.endif
+
post-patch: .SILENT
${REINPLACE_CMD} -e 's|-lfmt -lutf|$${LIBX11} & -lX11|' \
${WRKSRC}/cmd/Makefile
+ ${REINPLACE_CMD} -e '/_XOPEN_SOURCE/d' ${WRKSRC}/cmd/wmii/dat.h
# Strip debug build options
${REINPLACE_CMD} -E 's| -g( -O0)?||' ${WRKSRC}/config.mk
${REINPLACE_CMD} -e 's|CFLAGS += -DIXPlint|& -DIXP_NEEDAPI=89|' \
@@ -44,8 +55,5 @@ post-patch: .SILENT
# Make actual compile/link commands appear in the build log
${REINPLACE_CMD} -e 's|^COMPILE=|& noisycc=yes| ; \
s|^LINK=|& noisycc=yes|' ${WRKSRC}/mk/hdr.mk
-.if defined(WITHOUT_LAYOUT_BOXES)
- ${REINPLACE_CMD} -e '102,104d' ${WRKSRC}/cmd/wmii/column.c
-.endif
.include <bsd.port.mk>
diff --git a/x11-wm/wmii/files/extra-patch-slim-layout-boxes b/x11-wm/wmii/files/extra-patch-slim-layout-boxes
new file mode 100644
index 000000000000..d404a93dc36e
--- /dev/null
+++ b/x11-wm/wmii/files/extra-patch-slim-layout-boxes
@@ -0,0 +1,24 @@
+--- cmd/wmii/column.c.orig
++++ cmd/wmii/column.c
+@@ -89,16 +89,12 @@
+
+ static void
+ drawimg(Image *img, ulong cbg, ulong cborder) {
+- Point pt[6];
++ Point pt[4];
+
+- pt[0] = Pt(0, 0);
+- pt[1] = Pt(Dx(img->r)/2 - 1, Dx(img->r)/2 - 1);
+-
+- pt[2] = Pt(pt[1].x, Dy(img->r));
+- pt[3] = Pt(Dx(img->r)/2, pt[2].y);
+-
+- pt[4] = Pt(pt[3].x, Dx(img->r)/2 - 1);
+- pt[5] = Pt(Dx(img->r) - 1, 0);
++ pt[0] = Pt(Dx(img->r)/2 - 1, 0);
++ pt[1] = Pt(pt[0].x, Dy(img->r));
++ pt[2] = Pt(Dx(img->r)/2, pt[1].y);
++ pt[3] = Pt(pt[2].x, pt[0].y);
+
+ fillpoly(img, pt, nelem(pt), cbg);
+ drawpoly(img, pt, nelem(pt), CapNotLast, 1, cborder);
diff --git a/x11-wm/wmii/files/patch-no-utf8 b/x11-wm/wmii/files/patch-no-utf8
new file mode 100644
index 000000000000..77b57af98e7b
--- /dev/null
+++ b/x11-wm/wmii/files/patch-no-utf8
@@ -0,0 +1,91 @@
+--- cmd/wmii/Makefile.orig
++++ cmd/wmii/Makefile
+@@ -8,8 +8,16 @@
+ HFILES= dat.h fns.h x11.h
+
+ LIB = ${LIBIXP}
+-LDFLAGS += -lm ${LIBX11} -lXext ${LIBICONV} -lregexp9 -lbio -lfmt -lutf
+-CFLAGS += ${INCX11} ${INCICONV} -DVERSION=\"${VERSION}\"
++LDFLAGS += -lm ${LIBX11} -lXext -lregexp9 -lbio -lfmt -lutf
++CFLAGS += ${INCX11} -DVERSION=\"${VERSION}\"
++
++.ifdef NO_UTF8
++CFLAGS += -DNO_UTF8
++.else
++LDFLAGS += ${LIBICONV}
++CFLAGS += ${INCICONV}
++.endif
++
+ OBJ = area \
+ bar \
+ client \
+--- cmd/wmii/utf.c.orig
++++ cmd/wmii/utf.c
+@@ -1,12 +1,17 @@
+ /* Public Domain --Kris Maglione */
+ #include "dat.h"
+ #include <errno.h>
++#ifndef NO_UTF8
+ #include <iconv.h>
++#endif
+ #include <string.h>
+ #include "fns.h"
+
+ char*
+ toutf8n(char *str, size_t nstr) {
++#ifdef NO_UTF8
++ return strndup(str, nstr);
++#else
+ static iconv_t cd;
+ char *buf, *pos;
+ size_t nbuf, bsize;
+@@ -30,6 +35,7 @@
+ break;
+ *pos = '\0';
+ return buf;
++#endif
+ }
+
+ char*
+--- cmd/wmii/x11.c.orig
++++ cmd/wmii/x11.c
+@@ -18,6 +18,12 @@
+ static MapEnt *wbucket[137];
+ static MapEnt *abucket[137];
+
++#ifdef NO_UTF8
++#define XTEXT(func) Xmb##func
++#else
++#define XTEXT(func) Xutf8##func
++#endif
++
+ XRectangle
+ XRect(Rectangle r) {
+ XRectangle xr;
+@@ -444,7 +450,7 @@
+
+ setgccol(dst, col);
+ if(font->set)
+- Xutf8DrawString(display, dst->image,
++ XTEXT(DrawString)(display, dst->image,
+ font->set, dst->gc,
+ x, y,
+ buf, len);
+@@ -552,7 +558,7 @@
+ XRectangle r;
+
+ if(font->set) {
+- Xutf8TextExtents(font->set, text, len, &r, nil);
++ XTEXT(TextExtents)(font->set, text, len, &r, nil);
+ return r.width;
+ }
+ return XTextWidth(font->xfont, text, len);
+@@ -638,7 +644,7 @@
+
+ XGetTextProperty(display, w->w, &prop, xatom(name));
+ if(prop.nitems > 0) {
+- if(Xutf8TextPropertyToTextList(display, &prop, &list, &n) == Success)
++ if(XTEXT(TextPropertyToTextList)(display, &prop, &list, &n) == Success)
+ *ret = list;
+ XFree(prop.value);
+ }