git: a5ee80bea3eb - main - devel/libcsptr: New port: Smart pointers for the (GNU) C programming language

From: Yuri Victorovich <yuri_at_FreeBSD.org>
Date: Sun, 03 Jul 2022 23:05:34 UTC
The branch main has been updated by yuri:

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

commit a5ee80bea3ebc16aa9875b0718a4ddd917a60a36
Author:     Yuri Victorovich <yuri@FreeBSD.org>
AuthorDate: 2022-07-03 23:04:51 +0000
Commit:     Yuri Victorovich <yuri@FreeBSD.org>
CommitDate: 2022-07-03 23:04:51 +0000

    devel/libcsptr: New port: Smart pointers for the (GNU) C programming language
---
 devel/Makefile                            |  1 +
 devel/libcsptr/Makefile                   | 24 ++++++++++++++++++++++++
 devel/libcsptr/distinfo                   |  3 +++
 devel/libcsptr/files/patch-CMakeLists.txt | 11 +++++++++++
 devel/libcsptr/pkg-descr                  | 11 +++++++++++
 devel/libcsptr/pkg-plist                  |  7 +++++++
 6 files changed, 57 insertions(+)

diff --git a/devel/Makefile b/devel/Makefile
index dd52006d2766..9e27d35cca96 100644
--- a/devel/Makefile
+++ b/devel/Makefile
@@ -1126,6 +1126,7 @@
     SUBDIR += libconfuse
     SUBDIR += libcreg
     SUBDIR += libcrossguid
+    SUBDIR += libcsptr
     SUBDIR += libcuckoo
     SUBDIR += libcutl
     SUBDIR += libcwd
diff --git a/devel/libcsptr/Makefile b/devel/libcsptr/Makefile
new file mode 100644
index 000000000000..cddb05b14bf6
--- /dev/null
+++ b/devel/libcsptr/Makefile
@@ -0,0 +1,24 @@
+PORTNAME=	libcsptr
+DISTVERSIONPREFIX=	v
+DISTVERSION=	2.0.4-24
+DISTVERSIONSUFFIX=	-gac73451
+CATEGORIES=	devel
+
+MAINTAINER=	yuri@FreeBSD.org
+COMMENT=	Smart pointers for the (GNU) C programming language
+
+LICENSE=	MIT
+LICENSE_FILE=	${WRKSRC}/LICENSE
+
+TEST_DEPENDS=	check>0:devel/check
+
+USES=		cmake:testing localbase
+USE_LDCONFIG=	yes
+
+USE_GITHUB=	yes
+GH_ACCOUNT=	Snaipe
+
+CMAKE_ON=	BUILD_SHARED_LIBS
+CMAKE_TESTING_ON=	LIBCSPTR_TESTS # tests fail to compile, see https://github.com/Snaipe/libcsptr/issues/23
+
+.include <bsd.port.mk>
diff --git a/devel/libcsptr/distinfo b/devel/libcsptr/distinfo
new file mode 100644
index 000000000000..ba28090a95a9
--- /dev/null
+++ b/devel/libcsptr/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1656888806
+SHA256 (Snaipe-libcsptr-v2.0.4-24-gac73451_GH0.tar.gz) = 4c5a38c65219fc3013504d13e27b44da7c91a758252297041916abf14e744f1d
+SIZE (Snaipe-libcsptr-v2.0.4-24-gac73451_GH0.tar.gz) = 32325
diff --git a/devel/libcsptr/files/patch-CMakeLists.txt b/devel/libcsptr/files/patch-CMakeLists.txt
new file mode 100644
index 000000000000..ef5f6d8ba688
--- /dev/null
+++ b/devel/libcsptr/files/patch-CMakeLists.txt
@@ -0,0 +1,11 @@
+--- CMakeLists.txt.orig	2022-07-03 22:54:45 UTC
++++ CMakeLists.txt
+@@ -72,7 +72,7 @@ if (NOT WIN32)
+ endif ()
+ 
+ include_directories(include/csptr src)
+-add_library(csptr STATIC ${SOURCE_FILES} ${INTERFACE_FILES})
++add_library(csptr ${SOURCE_FILES} ${INTERFACE_FILES})
+ 
+ if (COVERALLS AND NOT LIBCSPTR_DISABLE_COVERALLS)
+   coveralls_setup("${SOURCE_FILES}" ${COVERALLS_UPLOAD})
diff --git a/devel/libcsptr/pkg-descr b/devel/libcsptr/pkg-descr
new file mode 100644
index 000000000000..3453f81bd861
--- /dev/null
+++ b/devel/libcsptr/pkg-descr
@@ -0,0 +1,11 @@
+libcsptr is an attempt to bring smart pointer constructs to the (GNU)
+C programming language.
+
+Features:
+* unique_ptr, shared_ptr macros, and smart type attribute
+* Destructor support for cleanup
+* Custom variable metadata on allocation
+* Cross-platform: tested under linux 3.18.6-1, Mac OS X Yosemite
+  10.10, and Windows 7 (with MinGW and the Cygwin port of GCC)
+
+WWW: https://github.com/Snaipe/libcsptr
diff --git a/devel/libcsptr/pkg-plist b/devel/libcsptr/pkg-plist
new file mode 100644
index 000000000000..e9171ac26cf6
--- /dev/null
+++ b/devel/libcsptr/pkg-plist
@@ -0,0 +1,7 @@
+include/csptr/array.h
+include/csptr/common.h
+include/csptr/config.h
+include/csptr/smalloc.h
+include/csptr/smart_ptr.h
+lib/libcsptr.so
+share/man/man3/csptr.3.gz