git: a8c7c7b4e269 - main - textproc/bat-extras: Add port

From: Adam Weinberger <adamw_at_FreeBSD.org>
Date: Fri, 07 Mar 2025 15:43:57 UTC
The branch main has been updated by adamw:

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

commit a8c7c7b4e269eda77c9b40708c9c2c7c2354b67f
Author:     Adam Weinberger <adamw@FreeBSD.org>
AuthorDate: 2025-03-07 15:40:38 +0000
Commit:     Adam Weinberger <adamw@FreeBSD.org>
CommitDate: 2025-03-07 15:43:53 +0000

    textproc/bat-extras: Add port
    
    These are various scripts that use textproc/bat as a colorizer
    and pager. The manpage colorization alone is worth the price of
    admission.
    
    Various scripts have dependencies, some mandatory and some optional.
    The pkg-descr lists them, but I opted not to register DEPENDS on them
    as it comes down to each user's personal preference.
---
 textproc/Makefile             |  1 +
 textproc/bat-extras/Makefile  | 45 +++++++++++++++++++++++++++++++++++++++++++
 textproc/bat-extras/distinfo  |  3 +++
 textproc/bat-extras/pkg-descr | 25 ++++++++++++++++++++++++
 4 files changed, 74 insertions(+)

diff --git a/textproc/Makefile b/textproc/Makefile
index 1d57ff36c178..3a3cb35409bf 100644
--- a/textproc/Makefile
+++ b/textproc/Makefile
@@ -75,6 +75,7 @@
     SUBDIR += az-aspell
     SUBDIR += bar
     SUBDIR += bat
+    SUBDIR += bat-extras
     SUBDIR += bbe
     SUBDIR += be-aspell
     SUBDIR += belr
diff --git a/textproc/bat-extras/Makefile b/textproc/bat-extras/Makefile
new file mode 100644
index 000000000000..6b0f8aee49eb
--- /dev/null
+++ b/textproc/bat-extras/Makefile
@@ -0,0 +1,45 @@
+PORTNAME=	bat-extras
+DISTVERSIONPREFIX=	v
+DISTVERSION=	2024.08.24
+CATEGORIES=	textproc
+
+MAINTAINER=	adamw@FreeBSD.org
+COMMENT=	Scripts that integrate with textproc/bat
+WWW=		https://github.com/eth-p/bat-extras
+
+LICENSE=	MIT
+
+BUILD_DEPENDS=	bash:shells/bash \
+		shfmt:devel/shfmt
+RUN_DEPENDS=	bash:shells/bash \
+		bat:textproc/bat
+
+USE_GITHUB=	yes
+GH_ACCOUNT=	eth-p
+NO_ARCH=	yes
+
+PLIST_FILES=	bin/batdiff \
+		bin/batgrep \
+		bin/batman \
+		bin/batpipe \
+		bin/batwatch \
+		bin/prettybat
+PORTDOCS=	*
+
+OPTIONS_DEFINE=	DOCS
+
+do-build:
+	${WRKSRC}/build.sh --no-verify
+
+do-install:
+	${INSTALL_SCRIPT} ${WRKSRC}/bin/batdiff   ${STAGEDIR}${PREFIX}/bin
+	${INSTALL_SCRIPT} ${WRKSRC}/bin/batgrep   ${STAGEDIR}${PREFIX}/bin
+	${INSTALL_SCRIPT} ${WRKSRC}/bin/batman    ${STAGEDIR}${PREFIX}/bin
+	${INSTALL_SCRIPT} ${WRKSRC}/bin/batpipe   ${STAGEDIR}${PREFIX}/bin
+	${INSTALL_SCRIPT} ${WRKSRC}/bin/batwatch  ${STAGEDIR}${PREFIX}/bin
+	${INSTALL_SCRIPT} ${WRKSRC}/bin/prettybat ${STAGEDIR}${PREFIX}/bin
+
+	${MKDIR} ${STAGEDIR}${DOCSDIR}
+	${INSTALL_DATA} ${WRKSRC}/README.md ${WRKSRC}/doc/* ${STAGEDIR}${DOCSDIR}
+
+.include <bsd.port.mk>
diff --git a/textproc/bat-extras/distinfo b/textproc/bat-extras/distinfo
new file mode 100644
index 000000000000..2ebcd44f0178
--- /dev/null
+++ b/textproc/bat-extras/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1741359498
+SHA256 (eth-p-bat-extras-v2024.08.24_GH0.tar.gz) = 2ff1b9104134f10721ef36580150365e94546e5b41b9a2a6eaa4851c5959b487
+SIZE (eth-p-bat-extras-v2024.08.24_GH0.tar.gz) = 50671
diff --git a/textproc/bat-extras/pkg-descr b/textproc/bat-extras/pkg-descr
new file mode 100644
index 000000000000..7cd237d5f59e
--- /dev/null
+++ b/textproc/bat-extras/pkg-descr
@@ -0,0 +1,25 @@
+A collection of scripts that integrate textproc/bat (a Rust-based uberpager)
+with various command-line tools. Note that you'll have to install some
+related tools manually if you want them.
+
+batdiff:
+    Diff a file against the current git index, or diff two files.
+    Optional: git-delta
+
+batgrep
+    Quickly search through and highlight files using ripgrep.
+    Requires: ripgrep
+
+batman:
+    Colorize manpages (I'm ruined and can never go back to plain manpages).
+
+batpipe:
+    Drop-in replacement for lesspipe.
+
+batwatch:
+    Watch for changes in one or more files and display them with bat.
+    Optional: entr
+
+prettybat:
+    Reformats and highlights source code.
+    Requires: prettier, shfmt, blank, clang-format, rustfmt, etc. (as needed)