pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

libassert: add libassert 2.2.1



Module Name:	pkgsrc-wip
Committed By:	Paul Ripke <stix%stix.id.au@localhost>
Pushed By:	stix
Date:		Sun Sep 6 21:24:32 2026 +1000
Changeset:	ff9da6829942e5bc57c89dd8420436050af57994

Added Files:
	libassert/COMMIT_MSG
	libassert/DESCR
	libassert/Makefile
	libassert/PLIST
	libassert/buildlink3.mk
	libassert/distinfo
	libassert/patches/patch-src_common.hpp
	libassert/patches/patch-src_platform.cpp

Log Message:
libassert: add libassert 2.2.1

The most over-engineered C++ assertion library

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=ff9da6829942e5bc57c89dd8420436050af57994

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 libassert/COMMIT_MSG                     |  4 ++++
 libassert/DESCR                          |  2 ++
 libassert/Makefile                       | 26 ++++++++++++++++++++
 libassert/PLIST                          | 17 +++++++++++++
 libassert/buildlink3.mk                  | 15 ++++++++++++
 libassert/distinfo                       |  7 ++++++
 libassert/patches/patch-src_common.hpp   | 24 +++++++++++++++++++
 libassert/patches/patch-src_platform.cpp | 41 ++++++++++++++++++++++++++++++++
 8 files changed, 136 insertions(+)

diffs:
diff --git a/libassert/COMMIT_MSG b/libassert/COMMIT_MSG
new file mode 100644
index 0000000000..63f4382a77
--- /dev/null
+++ b/libassert/COMMIT_MSG
@@ -0,0 +1,4 @@
+devel/libassert: Add libassert v2.2.1
+
+C++ assert library designed with the philosophy to provide as much helpful
+diagnostic info as possible.
diff --git a/libassert/DESCR b/libassert/DESCR
new file mode 100644
index 0000000000..d31e2bcd25
--- /dev/null
+++ b/libassert/DESCR
@@ -0,0 +1,2 @@
+C++ assert library designed with the philosophy to provide as much helpful
+diagnostic info as possible.
diff --git a/libassert/Makefile b/libassert/Makefile
new file mode 100644
index 0000000000..cafa2502a9
--- /dev/null
+++ b/libassert/Makefile
@@ -0,0 +1,26 @@
+# $NetBSD$
+
+VERSION=	2.2.1
+PKGNAME=	libassert-${VERSION}
+DISTNAME=	libassert-v${VERSION}
+CATEGORIES=	devel
+MASTER_SITES=	${MASTER_SITE_GITHUB:=jeremy-rifkin/}
+GITHUB_PROJECT=	libassert
+GITHUB_TAG=	v${VERSION}
+
+MAINTAINER=	stix%stix.id.au@localhost
+HOMEPAGE=	https://github.com/jeremy-rifkin/libassert
+COMMENT=	The most over-engineered C++ assertion library
+LICENSE=	mit
+
+USE_LANGUAGES=	c++
+
+CMAKE_CONFIGURE_ARGS+=	-DLIBASSERT_USE_EXTERNAL_CPPTRACE:BOOL=TRUE
+
+.include "../../mk/bsd.prefs.mk"
+
+.include "../../devel/catch2/buildlink3.mk"
+.include "../../devel/cmake/build.mk"
+.include "../../wip/cpptrace/buildlink3.mk"
+
+.include "../../mk/bsd.pkg.mk"
diff --git a/libassert/PLIST b/libassert/PLIST
new file mode 100644
index 0000000000..c5cf02bbbf
--- /dev/null
+++ b/libassert/PLIST
@@ -0,0 +1,17 @@
+@comment $NetBSD$
+include/libassert/assert-catch2-macros.hpp
+include/libassert/assert-catch2.hpp
+include/libassert/assert-gtest-macros.hpp
+include/libassert/assert-gtest.hpp
+include/libassert/assert-macros.hpp
+include/libassert/assert.hpp
+include/libassert/expression-decomposition.hpp
+include/libassert/platform.hpp
+include/libassert/stringification.hpp
+include/libassert/utilities.hpp
+include/libassert/version.hpp
+lib/cmake/libassert/libassert-config-version.cmake
+lib/cmake/libassert/libassert-config.cmake
+lib/cmake/libassert/libassert-targets-noconfig.cmake
+lib/cmake/libassert/libassert-targets.cmake
+lib/libassert.a
diff --git a/libassert/buildlink3.mk b/libassert/buildlink3.mk
new file mode 100644
index 0000000000..fb0fd2c9d8
--- /dev/null
+++ b/libassert/buildlink3.mk
@@ -0,0 +1,15 @@
+# $NetBSD$
+
+BUILDLINK_TREE+=	libassert
+
+.if !defined(LIBASSERT_BUILDLINK3_MK)
+LIBASSERT_BUILDLINK3_MK:=
+
+BUILDLINK_API_DEPENDS.libassert+=	libassert>=2.2.1
+BUILDLINK_PKGSRCDIR.libassert?=		../../wip/libassert
+
+.include "../../wip/cpptrace/buildlink3.mk"
+
+.endif	# LIBASSERT_BUILDLINK3_MK
+
+BUILDLINK_TREE+=	-libassert
diff --git a/libassert/distinfo b/libassert/distinfo
new file mode 100644
index 0000000000..960fc7c68d
--- /dev/null
+++ b/libassert/distinfo
@@ -0,0 +1,7 @@
+$NetBSD$
+
+BLAKE2s (libassert-v2.2.1.tar.gz) = a9fb1e6cee9d47a0ab73730d35de301c01418edfedcf00b7fb66522c25d27947
+SHA512 (libassert-v2.2.1.tar.gz) = 877f7ddac1b3ffa77d6c30b9aa4c6bf2a32bd3089b5348b75b4f52ef474cf6ee1f754bab5f0396e3ee3df83f9a438a5154c0fefce683c479b2f3a8adaef3c0a7
+Size (libassert-v2.2.1.tar.gz) = 323143 bytes
+SHA1 (patch-src_common.hpp) = 5f626c771cbb1de52210e233caca210dd7eaabf6
+SHA1 (patch-src_platform.cpp) = ff863a7eee1473cbac170442dd6a426ed277898e
diff --git a/libassert/patches/patch-src_common.hpp b/libassert/patches/patch-src_common.hpp
new file mode 100644
index 0000000000..424677f2a3
--- /dev/null
+++ b/libassert/patches/patch-src_common.hpp
@@ -0,0 +1,24 @@
+$NetBSD$
+
+Add platform support for NetBSD.
+
+--- src/common.hpp.orig	2026-09-06 09:37:58.975756001 +0000
++++ src/common.hpp
+@@ -43,6 +43,7 @@
+ 
+ #define IS_WINDOWS 0
+ #define IS_LINUX 0
++#define IS_NETBSD 0
+ #define IS_APPLE 0
+ 
+ #if defined(_WIN32)
+@@ -51,6 +52,9 @@
+ #elif defined(__linux)
+  #undef IS_LINUX
+  #define IS_LINUX 1
++#elif defined(__NetBSD__)
++ #undef IS_NETBSD
++ #define IS_NETBSD 1
+ #elif defined(__APPLE__)
+  #undef IS_APPLE
+  #define IS_APPLE 1
diff --git a/libassert/patches/patch-src_platform.cpp b/libassert/patches/patch-src_platform.cpp
new file mode 100644
index 0000000000..b3d4336249
--- /dev/null
+++ b/libassert/patches/patch-src_platform.cpp
@@ -0,0 +1,41 @@
+$NetBSD$
+
+Add support for NetBSD.
+
+--- src/platform.cpp.orig	2026-09-06 09:40:24.074538397 +0000
++++ src/platform.cpp
+@@ -22,6 +22,12 @@
+  #include <fcntl.h>
+  #include <sys/ioctl.h>
+  #include <unistd.h>
++#elif IS_NETBSD
++ #include <charconv>
++ #include <sys/ioctl.h>
++ #include <sys/param.h>
++ #include <sys/sysctl.h>
++ #include <unistd.h>
+ #elif IS_APPLE
+  #include <sys/ioctl.h>
+  #include <sys/sysctl.h>
+@@ -127,6 +133,21 @@ LIBASSERT_BEGIN_NAMESPACE
+              return false;
+          }
+          return false;
++        #elif IS_NETBSD
++         int mib[6];
++         struct kinfo_proc2 kp;
++         size_t len = sizeof(kp);
++         mib[0] = CTL_KERN;
++         mib[1] = KERN_PROC2;
++         mib[2] = KERN_PROC_PID;
++         mib[3] = getpid();
++         mib[4] = sizeof(kp);
++         mib[5] = 1;  // fetch 1 matching process structure
++         if (sysctl(mib, 6, &kp, &len, NULL, 0) == -1) {
++             perror("sysctl");
++             return false;
++         }
++         return (kp.p_flag & P_TRACED) != 0;
+         #else
+          // https://developer.apple.com/library/archive/qa/qa1361/_index.html
+          int mib[4] {CTL_KERN, KERN_PROC, KERN_PROC_PID, getpid()};


Home | Main Index | Thread Index | Old Index