Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 25 Mar 2011 13:47:36 +0100
From:      Jeroen Schot <schot@A-Eskwadraat.nl>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/155930: Update port: x11-wm/dwm Xinerama option and depends change
Message-ID:  <20110325124736.GA21258@A-Eskwadraat.nl>
Resent-Message-ID: <201103251250.p2PCoCXU084733@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         155930
>Category:       ports
>Synopsis:       Update port: x11-wm/dwm Xinerama option and depends change
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          maintainer-update
>Submitter-Id:   current-users
>Arrival-Date:   Fri Mar 25 12:50:11 UTC 2011
>Closed-Date:
>Last-Modified:
>Originator:     Jeroen Schot
>Release:        FreeBSD 8.2-RELEASE i386
>Organization:
>Environment:
System: FreeBSD maxwell.localdomain 8.2-RELEASE FreeBSD 8.2-RELEASE #0: Fri Feb 18 02:24:46 UTC 2011     root@almeida.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC  i386
>Description:
Update port: x11-wm/dwm Xinerama option and depends change
Attached diff updates the port of x11/dmenu. It fixes some small issues:

o Build option for Xinerama support.
o Drop RUN_DEPENDS on dmenu since its usable without it.
o Add pkg-message telling that xterm and dmenu are recommended.

>How-To-Repeat:
>Fix:
diff -ruN dwm.orig/Makefile dwm/Makefile
--- dwm.orig/Makefile	2010-06-19 23:41:59.000000000 +0200
+++ dwm/Makefile	2011-03-25 13:19:26.000000000 +0100
@@ -7,6 +7,7 @@
 
 PORTNAME=	dwm
 PORTVERSION=	5.8.2
+PORTREVISION=	1
 CATEGORIES=	x11-wm
 MASTER_SITES=	http://dl.suckless.org/${PORTNAME}/ \
 		http://schot.a-eskwadraat.nl/files/
@@ -14,14 +15,20 @@
 MAINTAINER=	schot@a-eskwadraat.nl
 COMMENT=	A dynamic, small, fast and simple window manager
 
-RUN_DEPENDS=	dmenu:${PORTSDIR}/x11/dmenu
+OPTIONS=	XINERAMA	"Enable Xinerama support" On
 
-USE_XORG=	x11 xinerama
+USE_XORG=	x11
 
 MAN1=		dwm.1
 PLIST_FILES=	bin/dwm
 PORTDOCS=	LICENSE README
 
+.include <bsd.port.options.mk>
+
+.if defined(WITH_XINERAMA)
+USE_XORG+=	xinerama
+.endif
+
 pre-everything::
 	@${ECHO_MSG} "You can build dwm with your own config.h using the DWM_CONF knob:"
 	@${ECHO_MSG} "make DWM_CONF=/path/to/dwm/config.h install clean"
@@ -33,6 +40,16 @@
 	@${CP} ${DWM_CONF} ${WRKSRC}/config.h
 .endif
 
+post-patch:
+	@${GREP} -Rl '%%[[:alpha:]]\+%%' ${WRKSRC}|${XARGS} ${REINPLACE_CMD} \
+	         -e "s,%%PREFIX%%,${PREFIX},g" \
+	         -e "s,%%LOCALBASE%%,${LOCALBASE},g" \
+	         -e "s,%%MANPREFIX%%,${MANPREFIX},g"
+.if defined(WITHOUT_XINERAMA)
+	@${REINPLACE_CMD} -e 's,$${XINERAMALIBS},,g' \
+	         -e 's,$${XINERAMAFLAGS},,g' ${WRKSRC}/config.mk
+.endif
+
 post-install:
 .if !defined(NOPORTDOCS)
 	@${ECHO_MSG} "installing additional documentation to ${DOCSDIR}"
@@ -40,5 +57,6 @@
 	@${INSTALL_MAN} ${WRKSRC}/LICENSE ${DOCSDIR}
 	@${INSTALL_MAN} ${WRKSRC}/README ${DOCSDIR}
 .endif
+	@${CAT} ${PKGMESSAGE}
 
 .include <bsd.port.mk>
diff -ruN dwm.orig/files/patch-Makefile dwm/files/patch-Makefile
--- dwm.orig/files/patch-Makefile	1970-01-01 01:00:00.000000000 +0100
+++ dwm/files/patch-Makefile	2011-03-25 12:55:01.000000000 +0100
@@ -0,0 +1,24 @@
+--- Makefile.orig	2011-03-25 12:53:10.000000000 +0100
++++ Makefile	2011-03-25 12:53:19.000000000 +0100
+@@ -46,15 +46,15 @@
+ 	@mkdir -p ${DESTDIR}${PREFIX}/bin
+ 	@cp -f dwm ${DESTDIR}${PREFIX}/bin
+ 	@chmod 755 ${DESTDIR}${PREFIX}/bin/dwm
+-	@echo installing manual page to ${DESTDIR}${MANPREFIX}/man1
+-	@mkdir -p ${DESTDIR}${MANPREFIX}/man1
+-	@sed "s/VERSION/${VERSION}/g" < dwm.1 > ${DESTDIR}${MANPREFIX}/man1/dwm.1
+-	@chmod 644 ${DESTDIR}${MANPREFIX}/man1/dwm.1
++	@echo installing manual page to ${DESTDIR}${MANPREFIX}/man/man1
++	@mkdir -p ${DESTDIR}${MANPREFIX}/man/man1
++	@sed "s/VERSION/${VERSION}/g" < dwm.1 > ${DESTDIR}${MANPREFIX}/man/man1/dwm.1
++	@chmod 644 ${DESTDIR}${MANPREFIX}/man/man1/dwm.1
+ 
+ uninstall:
+ 	@echo removing executable file from ${DESTDIR}${PREFIX}/bin
+ 	@rm -f ${DESTDIR}${PREFIX}/bin/dwm
+-	@echo removing manual page from ${DESTDIR}${MANPREFIX}/man1
+-	@rm -f ${DESTDIR}${MANPREFIX}/man1/dwm.1
++	@echo removing manual page from ${DESTDIR}${MANPREFIX}/man/man1
++	@rm -f ${DESTDIR}${MANPREFIX}/man/man1/dwm.1
+ 
+ .PHONY: all options clean dist install uninstall
diff -ruN dwm.orig/files/patch-config.mk dwm/files/patch-config.mk
--- dwm.orig/files/patch-config.mk	2010-05-31 01:37:39.000000000 +0200
+++ dwm/files/patch-config.mk	2011-03-25 12:54:44.000000000 +0100
@@ -1,26 +1,28 @@
---- config.mk.orig	2010-05-28 12:43:17.000000000 +0200
-+++ config.mk	2010-05-28 14:05:14.000000000 +0200
+--- config.mk.orig	2011-03-25 12:53:06.000000000 +0100
++++ config.mk	2011-03-25 12:54:25.000000000 +0100
 @@ -4,11 +4,11 @@
  # Customize below to fit your system
  
  # paths
 -PREFIX = /usr/local
 -MANPREFIX = ${PREFIX}/share/man
-+PREFIX?= /usr/local
-+MANPREFIX = ${PREFIX}/man
++PREFIX = %%PREFIX%% 
++MANPREFIX = %%MANPREFIX%%
  
 -X11INC = /usr/X11R6/include
 -X11LIB = /usr/X11R6/lib
-+X11INC = $(LOCALBASE)/include
-+X11LIB = $(LOCALBASE)/lib
++X11INC = %%LOCALBASE%%/include
++X11LIB = %%LOCALBASE%%/lib
  
  # Xinerama
  XINERAMALIBS = -L${X11LIB} -lXinerama
-@@ -20,9 +20,9 @@
+@@ -19,10 +19,10 @@
+ LIBS = -L/usr/lib -lc -L${X11LIB} -lX11 ${XINERAMALIBS}
  
  # flags
- CPPFLAGS = -DVERSION=\"${VERSION}\" ${XINERAMAFLAGS}
+-CPPFLAGS = -DVERSION=\"${VERSION}\" ${XINERAMAFLAGS}
 -CFLAGS = -g -std=c99 -pedantic -Wall -O0 ${INCS} ${CPPFLAGS}
++CPPFLAGS+= -DVERSION=\"${VERSION}\" ${XINERAMAFLAGS}
 +CFLAGS+= -std=c99 ${INCS} ${CPPFLAGS}
  #CFLAGS = -std=c99 -pedantic -Wall -Os ${INCS} ${CPPFLAGS}
 -LDFLAGS = -g ${LIBS}
diff -ruN dwm.orig/pkg-message dwm/pkg-message
--- dwm.orig/pkg-message	1970-01-01 01:00:00.000000000 +0100
+++ dwm/pkg-message	2011-03-25 13:24:32.000000000 +0100
@@ -0,0 +1,6 @@
+*************************************************************
+
+When using the default dwm config.h installation of xterm and
+dmenu is recommended.
+
+*************************************************************
>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20110325124736.GA21258>