git: b2dddd954285 - main - x11-wm/notion: New port: Tiling tabbed window manager

From: Nuno Teixeira <eduardo_at_FreeBSD.org>
Date: Sat, 08 Mar 2025 03:23:26 UTC
The branch main has been updated by eduardo:

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

commit b2dddd954285133eade5e1c9673ae9ad69e4bd17
Author:     Nuno Teixeira <eduardo@FreeBSD.org>
AuthorDate: 2025-03-08 03:12:21 +0000
Commit:     Nuno Teixeira <eduardo@FreeBSD.org>
CommitDate: 2025-03-08 03:23:11 +0000

    x11-wm/notion: New port: Tiling tabbed window manager
    
    Notion is a tiling, tabbed window manager for the X window system:
    
     o Tiling: you divide the screen into 'tiles'. Every window occupies
       one tile, and is maximized to it.
     o Tabbing: a tile may contain multiple windows - they will be
       'tabbed'
     o Static: most tiled window managers are 'dynamic'. Notion, by
       contrast, does not lay out or resize the tiles for you. You're in
       control.
     o Multihead: the mod_xinerama plugin provides very nice dual-monitor
       support
     o Xrandr: mod_xrandr picks up changes in the xrandr configuration
       without the need for restarting Notion
    
    WWW: https://notionwm.net/
---
 x11-wm/Makefile                                    |  1 +
 x11-wm/notion/Makefile                             | 45 +++++++++++
 x11-wm/notion/distinfo                             |  3 +
 .../files/patch-mod__notionflux_mod__notionflux.c  | 30 ++++++++
 x11-wm/notion/files/patch-system-autodetect.mk     | 10 +++
 x11-wm/notion/pkg-descr                            | 13 ++++
 x11-wm/notion/pkg-plist                            | 87 ++++++++++++++++++++++
 7 files changed, 189 insertions(+)

diff --git a/x11-wm/Makefile b/x11-wm/Makefile
index 37fcdb5296d6..457231f8e22c 100644
--- a/x11-wm/Makefile
+++ b/x11-wm/Makefile
@@ -74,6 +74,7 @@
     SUBDIR += muffin
     SUBDIR += mutter
     SUBDIR += niri
+    SUBDIR += notion
     SUBDIR += nscde
     SUBDIR += obconf
     SUBDIR += obconf-qt
diff --git a/x11-wm/notion/Makefile b/x11-wm/notion/Makefile
new file mode 100644
index 000000000000..84b60589a461
--- /dev/null
+++ b/x11-wm/notion/Makefile
@@ -0,0 +1,45 @@
+PORTNAME=	notion
+DISTVERSION=	4.0.3
+CATEGORIES=	x11-wm
+
+MAINTAINER=	eduardo@FreeBSD.org
+COMMENT=	Tiling tabbed window manager
+WWW=		https://notionwm.net/
+
+LICENSE=	LGPL21
+LICENSE_FILE=	${WRKSRC}/LICENSE
+
+BUILD_DEPENDS=	gsed:textproc/gsed
+
+USES=		gettext gmake localbase lua pkgconfig readline xorg
+USE_GITHUB=	yes
+GH_ACCOUNT=	raboof
+USE_XORG=	ice sm x11 xext
+
+BINARY_ALIAS=	sed=gsed
+PORTDOCS=	*
+
+OPTIONS_DEFINE=		DOCS XINERAMA XRANDR
+OPTIONS_DEFAULT=	XINERAMA XRANDR
+OPTIONS_SUB=		yes
+
+XINERAMA_DESC=	Xinerama module support
+XRANDR_DESC=	Xrandr module support
+
+XINERAMA_USE=	XORG=xinerama
+XRANDR_USE=	XORG=xrandr
+
+.include <bsd.port.options.mk>
+
+post-patch:
+.if !${PORT_OPTIONS:MDOCS}
+	@${REINPLACE_CMD} -e '/^_install:/,/^$$/ d' ${WRKSRC}/Makefile
+.endif
+.if !${PORT_OPTIONS:MXINERAMA}
+	@${REINPLACE_CMD} -e 's|mod_xinerama||' ${WRKSRC}/modulelist.mk
+.endif
+.if !${PORT_OPTIONS:MXRANDR}
+	@${REINPLACE_CMD} -e 's|mod_xrandr||' ${WRKSRC}/modulelist.mk
+.endif
+
+.include <bsd.port.mk>
diff --git a/x11-wm/notion/distinfo b/x11-wm/notion/distinfo
new file mode 100644
index 000000000000..b3604c3352b9
--- /dev/null
+++ b/x11-wm/notion/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1739028832
+SHA256 (raboof-notion-4.0.3_GH0.tar.gz) = f32095fadf1b2dd242ee4aaceda239591a0ba121209323b13709efefa0b515b0
+SIZE (raboof-notion-4.0.3_GH0.tar.gz) = 790736
diff --git a/x11-wm/notion/files/patch-mod__notionflux_mod__notionflux.c b/x11-wm/notion/files/patch-mod__notionflux_mod__notionflux.c
new file mode 100644
index 000000000000..8b084977d670
--- /dev/null
+++ b/x11-wm/notion/files/patch-mod__notionflux_mod__notionflux.c
@@ -0,0 +1,30 @@
+https://github.com/wilhelmy/notion/commit/e7638ba26ec6ddb6d86abf7443b2e617c7b68b1f
+https://github.com/raboof/notion/issues/350
+
+From e7638ba26ec6ddb6d86abf7443b2e617c7b68b1f Mon Sep 17 00:00:00 2001
+From: Moritz Wilhelmy <mw@barfooze.de>
+Date: Fri, 24 Feb 2023 02:08:25 +0100
+Subject: [PATCH] mod_notionflux: Add ifdef for fchmod on FreeBSD (closes #350)
+
+--- mod_notionflux/mod_notionflux.c.orig	2024-09-25 10:34:48 UTC
++++ mod_notionflux/mod_notionflux.c
+@@ -2,7 +2,7 @@
+  * mod_notionflux/mod_notionflux/mod_notionflux.c
+  *
+  * Copyright (c) Tuomo Valkonen 2004-2005.
+- * Copyright (c) The Notion development team 2019
++ * Copyright (c) The Notion development team 2019-2023
+  *
+  * This is free software; you can redistribute it and/or modify it under
+  * the terms of the GNU Lesser General Public License as published by
+@@ -328,8 +328,10 @@ static bool start_listening()
+     if(listenfd<0)
+         goto errwarn;
+ 
++#ifndef __FreeBSD__
+     if(fchmod(listenfd, S_IRUSR|S_IWUSR)<0)
+         goto errwarn;
++#endif
+ 
+     addr.sun_family=AF_UNIX;
+ 
diff --git a/x11-wm/notion/files/patch-system-autodetect.mk b/x11-wm/notion/files/patch-system-autodetect.mk
new file mode 100644
index 000000000000..1abd058f8cf6
--- /dev/null
+++ b/x11-wm/notion/files/patch-system-autodetect.mk
@@ -0,0 +1,10 @@
+--- system-autodetect.mk.orig	2025-02-08 16:04:21 UTC
++++ system-autodetect.mk
+@@ -138,6 +138,7 @@ HAS_SYSTEM_ASPRINTF=1
+ 
+ # On some other systems you may something like this:
+ #LIBS += -L/usr/local/lib -lintl
++LIBS += -L$(LOCALBASE)/lib -lintl
+ #CPPFLAGS += -I/usr/local/include
+ 
+ 
diff --git a/x11-wm/notion/pkg-descr b/x11-wm/notion/pkg-descr
new file mode 100644
index 000000000000..d2d26a5b8208
--- /dev/null
+++ b/x11-wm/notion/pkg-descr
@@ -0,0 +1,13 @@
+Notion is a tiling, tabbed window manager for the X window system:
+
+ o Tiling: you divide the screen into 'tiles'. Every window occupies
+   one tile, and is maximized to it.
+ o Tabbing: a tile may contain multiple windows - they will be
+   'tabbed'
+ o Static: most tiled window managers are 'dynamic'. Notion, by
+   contrast, does not lay out or resize the tiles for you. You're in
+   control.
+ o Multihead: the mod_xinerama plugin provides very nice dual-monitor
+   support
+ o Xrandr: mod_xrandr picks up changes in the xrandr configuration
+   without the need for restarting Notion
diff --git a/x11-wm/notion/pkg-plist b/x11-wm/notion/pkg-plist
new file mode 100644
index 000000000000..0c557d0a652f
--- /dev/null
+++ b/x11-wm/notion/pkg-plist
@@ -0,0 +1,87 @@
+bin/notion
+bin/notionflux
+%%ETCDIR%%/cfg_bindings.lua
+%%ETCDIR%%/cfg_defaults.lua
+%%ETCDIR%%/cfg_dock.lua
+%%ETCDIR%%/cfg_kludges.lua
+%%ETCDIR%%/cfg_layouts.lua
+%%ETCDIR%%/cfg_menu.lua
+%%ETCDIR%%/cfg_notion.lua
+%%ETCDIR%%/cfg_notion3_keybindings.lua
+%%ETCDIR%%/cfg_notion3_tiling.lua
+%%ETCDIR%%/cfg_notioncore.lua
+%%ETCDIR%%/cfg_query.lua
+%%ETCDIR%%/cfg_sp.lua
+%%ETCDIR%%/cfg_statusbar.lua
+%%ETCDIR%%/cfg_tiling.lua
+%%XRANDR%%%%ETCDIR%%/cfg_xrandr.lua
+%%ETCDIR%%/look.lua
+%%ETCDIR%%/look_brownsteel.lua
+%%ETCDIR%%/look_clean.lua
+%%ETCDIR%%/look_cleanios.lua
+%%ETCDIR%%/look_cleanviolet.lua
+%%ETCDIR%%/look_dusky.lua
+%%ETCDIR%%/look_greenlight.lua
+%%ETCDIR%%/look_greyviolet.lua
+%%ETCDIR%%/look_ios.lua
+%%ETCDIR%%/look_newviolet.lua
+%%ETCDIR%%/look_newviolet_hidpi.lua
+%%ETCDIR%%/look_paper.lua
+%%ETCDIR%%/look_simpleblue.lua
+%%ETCDIR%%/lookcommon_clean.lua
+%%ETCDIR%%/lookcommon_clean_frame.lua
+%%ETCDIR%%/lookcommon_clean_stdisp.lua
+%%ETCDIR%%/lookcommon_clean_tab.lua
+%%ETCDIR%%/lookcommon_emboss.lua
+%%ETCDIR%%/lookcommon_emboss_frame.lua
+%%ETCDIR%%/lookcommon_emboss_stdisp.lua
+%%ETCDIR%%/lookcommon_emboss_tab.lua
+%%ETCDIR%%/net_client_list.lua
+lib/notion/bin/ion-completefile
+lib/notion/bin/ion-statusd
+lib/notion/lc/de.lc
+lib/notion/lc/ioncore_bindings.lc
+lib/notion/lc/ioncore_efbb.lc
+lib/notion/lc/ioncore_ext.lc
+lib/notion/lc/ioncore_luaext.lc
+lib/notion/lc/ioncore_menudb.lc
+lib/notion/lc/ioncore_misc.lc
+lib/notion/lc/ioncore_wd.lc
+lib/notion/lc/ioncore_winprops.lc
+lib/notion/lc/mod_dock.lc
+lib/notion/lc/mod_menu.lc
+lib/notion/lc/mod_notionflux.lc
+lib/notion/lc/mod_query.lc
+lib/notion/lc/mod_query_chdir.lc
+lib/notion/lc/mod_sm.lc
+lib/notion/lc/mod_sp.lc
+lib/notion/lc/mod_statusbar.lc
+lib/notion/lc/mod_tiling.lc
+%%XINERAMA%%lib/notion/lc/mod_xinerama.lc
+lib/notion/lc/mod_xkbevents.lc
+%%XRANDR%%lib/notion/lc/mod_xrandr.lc
+lib/notion/lc/statusd_date.lc
+lib/notion/lc/statusd_load.lc
+lib/notion/lc/statusd_mail.lc
+lib/notion/mod/de.so
+lib/notion/mod/mod_dock.so
+lib/notion/mod/mod_menu.so
+lib/notion/mod/mod_notionflux.so
+lib/notion/mod/mod_query.so
+lib/notion/mod/mod_sm.so
+lib/notion/mod/mod_sp.so
+lib/notion/mod/mod_statusbar.so
+lib/notion/mod/mod_tiling.so
+%%XINERAMA%%lib/notion/mod/mod_xinerama.so
+lib/notion/mod/mod_xkbevents.so
+%%XRANDR%%lib/notion/mod/mod_xrandr.so
+share/locale/cs/LC_MESSAGES/notion.mo
+share/locale/fi/LC_MESSAGES/notion.mo
+share/man/man1/notion.1.gz
+share/man/man1/notionflux.1.gz
+%%DATADIR%%/ion-completeman
+%%DATADIR%%/ion-runinxterm
+%%DATADIR%%/notion-lock
+%%DATADIR%%/notion.1
+%%DATADIR%%/notionflux.1
+%%DATADIR%%/welcome.txt