git: 209955a6eb37 - main - x11-wm/dwl: add new port

From: Jan Beich <jbeich_at_FreeBSD.org>
Date: Thu, 30 Dec 2021 21:01:36 UTC
The branch main has been updated by jbeich:

URL: https://cgit.FreeBSD.org/ports/commit/?id=209955a6eb37b017918a9176d19b071cefe05272

commit 209955a6eb37b017918a9176d19b071cefe05272
Author:     Jan Beich <jbeich@FreeBSD.org>
AuthorDate: 2021-12-30 19:56:52 +0000
Commit:     Jan Beich <jbeich@FreeBSD.org>
CommitDate: 2021-12-30 20:58:37 +0000

    x11-wm/dwl: add new port
    
    dwl is a compact, hackable compositor for Wayland based on wlroots. It is
    intended to fill the same space in the Wayland world that dwm does in X11,
    primarily in terms of philosophy, and secondarily in terms of
    functionality. Like dwm, dwl is:
    
    - Easy to understand, hack on, and extend with patches
    - One C source file (or a very small number) configurable via config.h
    - Limited to 2000 SLOC to promote hackability
    - Tied to as few external dependencies as possible
    
    dwl is not meant to provide every feature under the sun. Instead, like dwm,
    it sticks to features which are necessary, simple, and straightforward to
    implement given the base on which it is built. Implemented default features:
    
    - Any features provided by dwm/Xlib: simple window borders, tags,
      keybindings, client rules, mouse move/resize. Providing a built-in
      status bar is an exception to this goal, to avoid dependencies on
      font rendering and/or drawing libraries when an external bar could
      work well.
    - Configurable multi-monitor layout support, including position and rotation
    - Configurable HiDPI/multi-DPI support
    - Provide information to external status bars via stdout/stdin
    - Urgency hints via xdg-activate protocol
    - Various Wayland protocols
    - XWayland support as provided by wlroots (can be enabled in config.mk)
    - Zero flickering - Wayland users naturally expect "every frame is perfect"
    
    https://github.com/djpohly/dwl
---
 x11-wm/Makefile              |  1 +
 x11-wm/dwl/Makefile          | 64 ++++++++++++++++++++++++++++++++++++++++++++
 x11-wm/dwl/distinfo          |  3 +++
 x11-wm/dwl/files/dwl.desktop |  7 +++++
 x11-wm/dwl/pkg-descr         | 28 +++++++++++++++++++
 5 files changed, 103 insertions(+)

diff --git a/x11-wm/Makefile b/x11-wm/Makefile
index 1a06782520a2..02c0f00363e4 100644
--- a/x11-wm/Makefile
+++ b/x11-wm/Makefile
@@ -24,6 +24,7 @@
     SUBDIR += cwm
     SUBDIR += devilspie
     SUBDIR += durden
+    SUBDIR += dwl
     SUBDIR += dwm
     SUBDIR += e16
     SUBDIR += e16-docs
diff --git a/x11-wm/dwl/Makefile b/x11-wm/dwl/Makefile
new file mode 100644
index 000000000000..e812062142a5
--- /dev/null
+++ b/x11-wm/dwl/Makefile
@@ -0,0 +1,64 @@
+PORTNAME=	dwl
+DISTVERSIONPREFIX=	v
+DISTVERSION=	0.2.2
+CATEGORIES=	x11-wm
+
+MAINTAINER=	jbeich@FreeBSD.org
+COMMENT=	dwm for Wayland
+
+LICENSE=	CC0-1.0 GPLv3+ MIT
+LICENSE_COMB=	multi
+LICENSE_FILE_CC0-1.0=	${WRKSRC}/LICENSE.tinywl
+LICENSE_FILE_GPLv3+ =	${WRKSRC}/LICENSE
+LICENSE_FILE_MIT=	${WRKSRC}/LICENSE.dwm
+
+BUILD_DEPENDS=	evdev-proto>0:devel/evdev-proto \
+		wayland-protocols>0:graphics/wayland-protocols \
+		wlroots>=0.15.0:x11-toolkits/wlroots
+LIB_DEPENDS=	libwayland-server.so:graphics/wayland \
+		libwlroots.so:x11-toolkits/wlroots \
+		libinput.so:x11/libinput \
+		libxkbcommon.so:x11/libxkbcommon
+
+USES=		gmake pkgconfig
+USE_GITHUB=	yes
+GH_ACCOUNT=	djpohly
+PLIST_FILES=	bin/${PORTNAME} \
+		share/wayland-sessions/${PORTNAME}.desktop
+PORTDOCS=	README.md
+
+OPTIONS_DEFINE=	ADDONS DOCS X11
+OPTIONS_DEFAULT=ADDONS X11
+
+ADDONS_DESC=		Install extra applications: ${ADDONS_RUN_DEPENDS:C/\:.*//}
+ADDONS_RUN_DEPENDS?=	alacritty:x11/alacritty \
+			bemenu-run:x11/bemenu
+
+X11_USES=		xorg
+X11_USE=		XORG=xcb
+X11_CFLAGS=		-DXWAYLAND
+
+pre-everything::
+	@${ECHO_MSG} "To build ${PORTNAME} with your own config.h set ${PORTNAME:tu}_CONF variable"
+	@${ECHO_MSG} "either in ${.CURDIR:T}/Makefile.local, make.conf(5), environ(7) or command line e.g.,"
+	@${ECHO_MSG} "\$$ make install clean ${PORTNAME:tu}_CONF=/path/to/${PORTNAME}/config.h"
+
+post-extract:
+# .if exists(...) before bsd.port.mk ignores *_CONF in make.conf(5) and Makefile.local
+	@if [ -e "${${PORTNAME:tu}_CONF}" ]; then \
+		${ECHO_MSG} "Creating symlink: config.h -> ${${PORTNAME:tu}_CONF}"; \
+		${LN} -fs "${${PORTNAME:tu}_CONF}" ${WRKSRC}/config.h; \
+	fi
+
+post-patch-X11-off:
+	@${REINPLACE_CMD} 's/ xcb//' ${WRKSRC}/Makefile
+
+do-install:
+	${INSTALL_PROGRAM} ${WRKSRC}/${PORTNAME} ${STAGEDIR}${PREFIX}/bin
+	${MKDIR} ${STAGEDIR}${PREFIX}/share/wayland-sessions
+	${INSTALL_DATA} ${FILESDIR}/${PORTNAME}.desktop \
+		${STAGEDIR}${PREFIX}/share/wayland-sessions
+	(cd ${WRKSRC} && ${COPYTREE_SHARE} "${PORTDOCS}" \
+		${STAGEDIR}${DOCSDIR})
+
+.include <bsd.port.mk>
diff --git a/x11-wm/dwl/distinfo b/x11-wm/dwl/distinfo
new file mode 100644
index 000000000000..818d6bdafe8c
--- /dev/null
+++ b/x11-wm/dwl/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1640196876
+SHA256 (djpohly-dwl-v0.2.2_GH0.tar.gz) = c629fa7f38050db9850dc0cdf487191c725e6fc68f0c497f6297b48e873c9e5e
+SIZE (djpohly-dwl-v0.2.2_GH0.tar.gz) = 50077
diff --git a/x11-wm/dwl/files/dwl.desktop b/x11-wm/dwl/files/dwl.desktop
new file mode 100644
index 000000000000..4d792f27e5da
--- /dev/null
+++ b/x11-wm/dwl/files/dwl.desktop
@@ -0,0 +1,7 @@
+[Desktop Entry]
+Name=dwl
+Exec=dwl
+TryExec=dwl
+Icon=
+Type=Application
+DesktopNames=wlroots
diff --git a/x11-wm/dwl/pkg-descr b/x11-wm/dwl/pkg-descr
new file mode 100644
index 000000000000..90eacd92744e
--- /dev/null
+++ b/x11-wm/dwl/pkg-descr
@@ -0,0 +1,28 @@
+dwl is a compact, hackable compositor for Wayland based on wlroots. It is
+intended to fill the same space in the Wayland world that dwm does in X11,
+primarily in terms of philosophy, and secondarily in terms of
+functionality. Like dwm, dwl is:
+
+- Easy to understand, hack on, and extend with patches
+- One C source file (or a very small number) configurable via config.h
+- Limited to 2000 SLOC to promote hackability
+- Tied to as few external dependencies as possible
+
+dwl is not meant to provide every feature under the sun. Instead, like dwm,
+it sticks to features which are necessary, simple, and straightforward to
+implement given the base on which it is built. Implemented default features:
+
+- Any features provided by dwm/Xlib: simple window borders, tags,
+  keybindings, client rules, mouse move/resize. Providing a built-in
+  status bar is an exception to this goal, to avoid dependencies on
+  font rendering and/or drawing libraries when an external bar could
+  work well.
+- Configurable multi-monitor layout support, including position and rotation
+- Configurable HiDPI/multi-DPI support
+- Provide information to external status bars via stdout/stdin
+- Urgency hints via xdg-activate protocol
+- Various Wayland protocols
+- XWayland support as provided by wlroots (can be enabled in config.mk)
+- Zero flickering - Wayland users naturally expect "every frame is perfect"
+
+WWW: https://github.com/djpohly/dwl