git: b55bde09b21a - main - misc/py-cppman: add port: C++ 98/11/14/17/20 manual pages on the terminal

From: Hiroki Tagato <tagattie_at_FreeBSD.org>
Date: Tue, 05 Aug 2025 01:57:39 UTC
The branch main has been updated by tagattie:

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

commit b55bde09b21a27008e0ba4ab0638b3cbc8225c9b
Author:     Hiroki Tagato <tagattie@FreeBSD.org>
AuthorDate: 2025-08-05 01:54:42 +0000
Commit:     Hiroki Tagato <tagattie@FreeBSD.org>
CommitDate: 2025-08-05 01:57:27 +0000

    misc/py-cppman: add port: C++ 98/11/14/17/20 manual pages on the terminal
    
    Cppman is a tool that provides C++ manual pages on the terminal. It
    acts as a convenient interface to view formatted C++ documentation
    directly from cplusplus.com and cppreference.com, allowing developers
    to access relevant information quickly without switching to a web
    browser.
    
    Features:
    - Supports two backends (switch it with cppman -s):
      cplusplus.com
      cppreference.com
    - Syntax highlighting support for sections and example source code.
    - Usage/Interface similar to the 'man' command
    - Hyperlink between manpages (only available when pager=vim)
      - Press Ctrl-] when cursor is on keyword to go forward and Ctrl-T to
        go backward.
      - You can also double-click on keyword to go forward and right-click
        to go backward.
    - Frequently update to support cplusplus.com.
    
    WWW: https://github.com/aitjcize/cppman
    
    Co-authored-by: freebsd@fron.io
    
    PR:             284157
    Reported by:    freebsd@fron.io (initial version)
---
 misc/Makefile                       |  1 +
 misc/py-cppman/Makefile             | 41 +++++++++++++++++++++++++++++++++++++
 misc/py-cppman/distinfo             |  3 +++
 misc/py-cppman/files/patch-setup.py | 15 ++++++++++++++
 misc/py-cppman/pkg-descr            | 18 ++++++++++++++++
 misc/py-cppman/pkg-message          | 16 +++++++++++++++
 6 files changed, 94 insertions(+)

diff --git a/misc/Makefile b/misc/Makefile
index e266bfe77882..58ef922599a5 100644
--- a/misc/Makefile
+++ b/misc/Makefile
@@ -430,6 +430,7 @@
     SUBDIR += py-colorbrewer
     SUBDIR += py-colored
     SUBDIR += py-colorzero
+    SUBDIR += py-cppman
     SUBDIR += py-crudini
     SUBDIR += py-datasets
     SUBDIR += py-detecta
diff --git a/misc/py-cppman/Makefile b/misc/py-cppman/Makefile
new file mode 100644
index 000000000000..4b92dd4f495a
--- /dev/null
+++ b/misc/py-cppman/Makefile
@@ -0,0 +1,41 @@
+PORTNAME=	cppman
+PORTVERSION=	0.5.9
+CATEGORIES=	misc python
+MASTER_SITES=	PYPI
+PKGNAMEPREFIX=	${PYTHON_PKGNAMEPREFIX}
+
+MAINTAINER=	tagattie@FreeBSD.org
+COMMENT=	C++ 98/11/14/17/20 manual pages on the terminal
+WWW=		https://github.com/aitjcize/cppman
+
+LICENSE=	GPLv3
+LICENSE_FILE=	${WRKSRC}/COPYING
+
+RUN_DEPENDS=	${PYTHON_PKGNAMEPREFIX}beautifulsoup>=4.13.3:www/py-beautifulsoup@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}html5lib>=1.1:www/py-html5lib@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}lxml5>=5.3.2:devel/py-lxml5@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}six>=1.17.0:devel/py-six@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}soupsieve>=2.6:www/py-soupsieve@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}typing-extensions>=4.13.1:devel/py-typing-extensions@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}webencodings>=0.5.1:converters/py-webencodings@${PY_FLAVOR} \
+		vim:editors/vim \
+		bash:shells/bash
+
+USES=		python shebangfix
+
+USE_PYTHON=	autoplist concurrent distutils
+
+SHEBANG_FILES=	bin/cppman \
+		cppman/lib/pager.sh
+
+NO_ARCH=	yes
+
+PORTDOCS=	AUTHORS ChangeLog README.rst
+
+OPTIONS_DEFINE=	DOCS
+
+post-install-DOCS-on:
+	@${MKDIR} ${STAGEDIR}${DOCSDIR}
+	${INSTALL_MAN} ${PORTDOCS:S|^|${WRKSRC}/|} ${STAGEDIR}${DOCSDIR}
+
+.include <bsd.port.mk>
diff --git a/misc/py-cppman/distinfo b/misc/py-cppman/distinfo
new file mode 100644
index 000000000000..c0f5932d5a3b
--- /dev/null
+++ b/misc/py-cppman/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1751778661
+SHA256 (cppman-0.5.9.tar.gz) = 15a4e40ab025b4dcec5a73a50df26b7ddaef7c148fcb197940fff2484f9e9903
+SIZE (cppman-0.5.9.tar.gz) = 1644343
diff --git a/misc/py-cppman/files/patch-setup.py b/misc/py-cppman/files/patch-setup.py
new file mode 100644
index 000000000000..23eb8489cf39
--- /dev/null
+++ b/misc/py-cppman/files/patch-setup.py
@@ -0,0 +1,15 @@
+--- setup.py.orig	2025-07-22 07:20:26 UTC
++++ setup.py
+@@ -9,10 +9,9 @@ _data_files = [
+         ]
+ 
+ _data_files = [
+-        ('share/doc/cppman', ['README.rst', 'AUTHORS', 'COPYING', 'ChangeLog']),
+         ('share/man/man1', ['misc/cppman.1']),
+-        ('share/bash-completion/completions', ['misc/completions/cppman.bash']),
+-        ('share/zsh/vendor-completions/', ['misc/completions/zsh/_cppman']),
++        ('etc/bash_completion.d', ['misc/completions/cppman.bash']),
++        ('share/zsh/site-functions/', ['misc/completions/zsh/_cppman']),
+         ('share/fish/vendor_completions.d/', ['misc/completions/fish/cppman.fish'])
+         ]
+ 
diff --git a/misc/py-cppman/pkg-descr b/misc/py-cppman/pkg-descr
new file mode 100644
index 000000000000..fd38305caaf9
--- /dev/null
+++ b/misc/py-cppman/pkg-descr
@@ -0,0 +1,18 @@
+Cppman is a tool that provides C++ manual pages on the terminal. It
+acts as a convenient interface to view formatted C++ documentation
+directly from cplusplus.com and cppreference.com, allowing developers
+to access relevant information quickly without switching to a web
+browser.
+
+Features:
+- Supports two backends (switch it with cppman -s):
+  cplusplus.com
+  cppreference.com
+- Syntax highlighting support for sections and example source code.
+- Usage/Interface similar to the 'man' command
+- Hyperlink between manpages (only available when pager=vim)
+  - Press Ctrl-] when cursor is on keyword to go forward and Ctrl-T to
+    go backward.
+  - You can also double-click on keyword to go forward and right-click
+    to go backward.
+- Frequently update to support cplusplus.com.
diff --git a/misc/py-cppman/pkg-message b/misc/py-cppman/pkg-message
new file mode 100644
index 000000000000..a0a6582fc08d
--- /dev/null
+++ b/misc/py-cppman/pkg-message
@@ -0,0 +1,16 @@
+[
+{ type: install
+  message: <<EOM
+To support vim on nvim as pager, cppman needs fdescfs(5)
+to be mounted on /dev/fd.
+
+If /dev/fd is not already mounted:
+
+	mount -t fdescfs fdesc /dev/fd
+
+To make it permanent, add the following line to /etc/fstab:
+
+	fdesc	/dev/fd		fdescfs		rw	0	0
+EOM
+}
+]