git: 3884b164cdc4 - main - devel/libprinthex: Add libprinthex 1.0.3

From: Po-Chuan Hsieh <sunpoet_at_FreeBSD.org>
Date: Tue, 12 Aug 2025 18:16:52 UTC
The branch main has been updated by sunpoet:

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

commit 3884b164cdc4ec4ae0a9aa26ab1919c59440f544
Author:     Po-Chuan Hsieh <sunpoet@FreeBSD.org>
AuthorDate: 2025-08-12 17:41:28 +0000
Commit:     Po-Chuan Hsieh <sunpoet@FreeBSD.org>
CommitDate: 2025-08-12 18:15:27 +0000

    devel/libprinthex: Add libprinthex 1.0.3
    
    libprinthex provides a function to print a hex dump with colored sections.
---
 devel/Makefile              |  1 +
 devel/libprinthex/Makefile  | 32 ++++++++++++++++++++++++++++++++
 devel/libprinthex/distinfo  |  3 +++
 devel/libprinthex/pkg-descr |  1 +
 4 files changed, 37 insertions(+)

diff --git a/devel/Makefile b/devel/Makefile
index 5827a5eaecb3..344ed1682a9f 100644
--- a/devel/Makefile
+++ b/devel/Makefile
@@ -1400,6 +1400,7 @@
     SUBDIR += libplist
     SUBDIR += libpo6
     SUBDIR += libpololu-avr
+    SUBDIR += libprinthex
     SUBDIR += libprotobuf-mutator
     SUBDIR += libpru
     SUBDIR += libqb
diff --git a/devel/libprinthex/Makefile b/devel/libprinthex/Makefile
new file mode 100644
index 000000000000..fd6096552b25
--- /dev/null
+++ b/devel/libprinthex/Makefile
@@ -0,0 +1,32 @@
+PORTNAME=	libprinthex
+PORTVERSION=	1.0.3
+DISTVERSIONPREFIX=	v
+CATEGORIES=	devel
+
+MAINTAINER=	sunpoet@FreeBSD.org
+COMMENT=	Print a hex dump with colored sections
+WWW=		https://github.com/rstemmer/libprinthex
+
+LICENSE=	GPLv3
+LICENSE_FILE=	${WRKSRC}/LICENSE
+
+CFLAGS+=	-fPIC
+
+PLIST_FILES=	include/printhex.h \
+		lib/libprinthex.so \
+		lib/libprinthex.so.1 \
+		lib/libprinthex.so.${PORTVERSION}
+
+USE_GITHUB=	yes
+GH_ACCOUNT=	rstemmer
+
+do-build:
+	@${CC} ${CFLAGS} -I${WRKSRC} -shared -Wl,-soname,libprinthex.so.1 ${WRKSRC}/printhex.c -o ${WRKSRC}/libprinthex.so
+
+do-install:
+	${INSTALL_DATA} ${WRKSRC}/printhex.h ${STAGEDIR}${PREFIX}/include/printhex.h
+	${INSTALL_LIB} ${WRKSRC}/libprinthex.so ${STAGEDIR}${PREFIX}/lib/libprinthex.so.${PORTVERSION}
+	${LN} -s libprinthex.so.${PORTVERSION} ${STAGEDIR}${PREFIX}/lib/libprinthex.so
+	${LN} -s libprinthex.so.${PORTVERSION} ${STAGEDIR}${PREFIX}/lib/libprinthex.so.1
+
+.include <bsd.port.mk>
diff --git a/devel/libprinthex/distinfo b/devel/libprinthex/distinfo
new file mode 100644
index 000000000000..f0ba96bce7c5
--- /dev/null
+++ b/devel/libprinthex/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1753796002
+SHA256 (rstemmer-libprinthex-v1.0.3_GH0.tar.gz) = d2ba05eff6bcd45e7ac4e6db344f68fd8cb81179272b0248597c7a55550f9ca1
+SIZE (rstemmer-libprinthex-v1.0.3_GH0.tar.gz) = 68100
diff --git a/devel/libprinthex/pkg-descr b/devel/libprinthex/pkg-descr
new file mode 100644
index 000000000000..580b20d1d224
--- /dev/null
+++ b/devel/libprinthex/pkg-descr
@@ -0,0 +1 @@
+libprinthex provides a function to print a hex dump with colored sections.