git: bb4434f2ed59 - main - misc/qman: add port: More modern man page viewer for our terminals

From: Hiroki Tagato <tagattie_at_FreeBSD.org>
Date: Tue, 15 Jul 2025 20:20:39 UTC
The branch main has been updated by tagattie:

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

commit bb4434f2ed597ee2ede697f7839b18d0c7d22f7c
Author:     Hiroki Tagato <tagattie@FreeBSD.org>
AuthorDate: 2025-07-15 20:18:50 +0000
Commit:     Hiroki Tagato <tagattie@FreeBSD.org>
CommitDate: 2025-07-15 20:20:26 +0000

    misc/qman: add port: More modern man page viewer for our terminals
    
    Unix manual pages are lovely. They are concise, well-written,
    complete, and downright useful. However, the standard way of accessing
    them from the command-line hasn't changed since the early days.
    
    Qman aims to change that. It's a modern, full-featured manual page
    viewer featuring hyperlinks, web browser like navigation, a table of
    contents for each page, incremental search, on-line help, and more. It
    also strives to be fast and tiny, so that it can be used
    everywhere. For this reason, it's been written in plain C and has only
    minimal dependencies.
    
    WWW: https://github.com/plp13/qman
---
 misc/Makefile                          |  1 +
 misc/qman/Makefile                     | 59 ++++++++++++++++++++++++++++++++++
 misc/qman/distinfo                     |  3 ++
 misc/qman/files/patch-config_qman.conf | 12 +++++++
 misc/qman/pkg-descr                    | 10 ++++++
 misc/qman/pkg-plist                    |  8 +++++
 6 files changed, 93 insertions(+)

diff --git a/misc/Makefile b/misc/Makefile
index ec75cf7ef32a..4988a014b83c 100644
--- a/misc/Makefile
+++ b/misc/Makefile
@@ -547,6 +547,7 @@
     SUBDIR += qbrew
     SUBDIR += qlas
     SUBDIR += qlcplus
+    SUBDIR += qman
     SUBDIR += qt5-doc
     SUBDIR += qt5-examples
     SUBDIR += qt5-l10n
diff --git a/misc/qman/Makefile b/misc/qman/Makefile
new file mode 100644
index 000000000000..ec6a9586c7a9
--- /dev/null
+++ b/misc/qman/Makefile
@@ -0,0 +1,59 @@
+PORTNAME=	qman
+PORTVERSION=	1.4.2.20250630
+CATEGORIES=	misc
+
+MAINTAINER=	tagattie@FreeBSD.org
+COMMENT=	More modern man page viewer for our terminals
+WWW=		https://github.com/plp13/qman
+
+LICENSE=	BSD2CLAUSE
+LICENSE_FILE=	${WRKSRC}/LICENSE
+
+BUILD_DEPENDS=	cog:devel/py-cogapp
+
+USES=		groff:run meson pkgconfig
+
+USE_GITHUB=	yes
+GH_ACCOUNT=	plp13
+GH_TAGNAME=	16b4e808ab619d7bfb7d94017ca9505b69a387fb
+
+MESON_ARGS=	-Dconfigdir=${PREFIX}/etc/xdg/${PORTNAME} \
+		-Ddocs=disabled \
+		-Dtests=disabled
+
+OPTIONS_DEFINE=	BZIP2 DOCS GZIP LZMA MANPAGES
+OPTIONS_DEFAULT=BZIP2 GZIP LZMA MANPAGES
+OPTIONS_SUB=	yes
+
+BZIP2_DESC=	Support bzip2-compressed manual pages
+GZIP_DESC=	Support gzip-compressed manual pages
+LZMA_DESC=	Support xz-compressed manual pages
+
+BZIP2_MESON_ENABLED=	bzip2
+GZIP_MESON_ENABLED=	gzip
+LZMA_MESON_ENABLED=	lzma
+MANPAGES_MESON_ENABLED=	man-pages
+
+PORTDOCS=	BUILDING.md CONTRIBUTING.md DEBUGGING.md OS_SPECIFIC.md \
+		README.md TESTING.md TROUBLESHOOTING.md
+
+# FreeBSD 13 is missing /usr/libdata/pkgconfig/ncursesw.pc
+.if ${OPSYS} == FreeBSD && ${OSREL:R} == 13
+USES+=		ncurses:port
+.else
+USES+=		ncurses
+.endif
+
+post-patch:
+	@${REINPLACE_CMD} -e 's|%%LOCALBASE%%|${LOCALBASE}|' \
+		${WRKSRC}/config/qman.conf
+	@${REINPLACE_CMD} -e 's|/etc|${PREFIX}&|' \
+		${WRKSRC}/src/config.c.cog ${WRKSRC}/src/config.h.cog
+
+post-install-DOCS-on:
+	@${MKDIR} ${STAGEDIR}${DOCSDIR}
+	${INSTALL_MAN} ${WRKSRC}/README.md ${STAGEDIR}${DOCSDIR}
+	${INSTALL_MAN} ${PORTDOCS:S|README.md||:S|^|${WRKSRC}/doc/|} ${STAGEDIR}${DOCSDIR}
+
+
+.include <bsd.port.mk>
diff --git a/misc/qman/distinfo b/misc/qman/distinfo
new file mode 100644
index 000000000000..a727c006d449
--- /dev/null
+++ b/misc/qman/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1752607509
+SHA256 (plp13-qman-1.4.2.20250630-16b4e808ab619d7bfb7d94017ca9505b69a387fb_GH0.tar.gz) = 8b950c83bae0bd0fa5bd67d549b9044f152aae5925a1cf804cc56228272cabaa
+SIZE (plp13-qman-1.4.2.20250630-16b4e808ab619d7bfb7d94017ca9505b69a387fb_GH0.tar.gz) = 952625
diff --git a/misc/qman/files/patch-config_qman.conf b/misc/qman/files/patch-config_qman.conf
new file mode 100644
index 000000000000..f5bc89c71f78
--- /dev/null
+++ b/misc/qman/files/patch-config_qman.conf
@@ -0,0 +1,12 @@
+--- config/qman.conf.orig	2025-07-15 19:28:48 UTC
++++ config/qman.conf
+@@ -21,6 +21,9 @@ enable=             true
+ ; flicker after opening an email link
+ ; reset_after_email=  false
+ 
++system_type=        freebsd
++groff_path=         %%LOCALBASE%%/bin/groff
++
+ [layout]
+ 
+ ; Change this to suit your terminal window size
diff --git a/misc/qman/pkg-descr b/misc/qman/pkg-descr
new file mode 100644
index 000000000000..09396e416fd4
--- /dev/null
+++ b/misc/qman/pkg-descr
@@ -0,0 +1,10 @@
+Unix manual pages are lovely. They are concise, well-written,
+complete, and downright useful. However, the standard way of accessing
+them from the command-line hasn't changed since the early days.
+
+Qman aims to change that. It's a modern, full-featured manual page
+viewer featuring hyperlinks, web browser like navigation, a table of
+contents for each page, incremental search, on-line help, and more. It
+also strives to be fast and tiny, so that it can be used
+everywhere. For this reason, it's been written in plain C and has only
+minimal dependencies.
diff --git a/misc/qman/pkg-plist b/misc/qman/pkg-plist
new file mode 100644
index 000000000000..0472e626d2bc
--- /dev/null
+++ b/misc/qman/pkg-plist
@@ -0,0 +1,8 @@
+bin/qman
+etc/xdg/qman/qman.conf
+etc/xdg/qman/themes/adwaita-light.conf
+etc/xdg/qman/themes/adwaita.conf
+etc/xdg/qman/themes/catppuccin_latte.conf
+etc/xdg/qman/themes/modernity-light.conf
+etc/xdg/qman/themes/modernity.conf
+%%MANPAGES%%share/man/man1/qman.1.gz