git: 818abd4c5541 - main - math/primecount: addind fast prime counting function implementations

From: Thierry Thomas <thierry_at_FreeBSD.org>
Date: Sun, 28 Nov 2021 17:56:02 UTC
The branch main has been updated by thierry:

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

commit 818abd4c554116d4a6ae6a0c7b722b2617c0f5b2
Author:     Thierry Thomas <thierry@FreeBSD.org>
AuthorDate: 2021-11-28 17:48:00 +0000
Commit:     Thierry Thomas <thierry@FreeBSD.org>
CommitDate: 2021-11-28 17:55:56 +0000

    math/primecount: addind fast prime counting function implementations
    
    primecount is a command-line program and C/C++ library that counts the
    primes below an integer x ≤ 1031 using highly optimized implementations
    of the combinatorial prime counting algorithms.
    
    To be used by SageMath.
---
 math/Makefile             |  1 +
 math/primecount/Makefile  | 31 +++++++++++++++++++++++++++++++
 math/primecount/distinfo  |  3 +++
 math/primecount/pkg-descr |  5 +++++
 math/primecount/pkg-plist |  7 +++++++
 5 files changed, 47 insertions(+)

diff --git a/math/Makefile b/math/Makefile
index 5341be1e6987..5ee6ba182630 100644
--- a/math/Makefile
+++ b/math/Makefile
@@ -778,6 +778,7 @@
     SUBDIR += poly2tri
     SUBDIR += polylib
     SUBDIR += polymake
+    SUBDIR += primecount
     SUBDIR += primegen
     SUBDIR += primesieve
     SUBDIR += primme
diff --git a/math/primecount/Makefile b/math/primecount/Makefile
new file mode 100644
index 000000000000..1a69fdf704c9
--- /dev/null
+++ b/math/primecount/Makefile
@@ -0,0 +1,31 @@
+# Created by: thierry@pompo.net
+
+PORTNAME=	primecount
+DISTVERSIONPREFIX=	v
+DISTVERSION=	7.1
+CATEGORIES=	math
+
+MAINTAINER=	thierry@FreeBSD.org
+COMMENT=	Fast prime counting function implementations
+
+LICENSE=	BSD2CLAUSE
+
+BUILD_DEPENDS=	libdivide>0:math/libdivide
+LIB_DEPENDS=	libprimesieve.so:math/primesieve
+
+USE_GITHUB=	yes
+GH_ACCOUNT=	kimwalisch
+
+USES=		cmake compiler:c++11-lang
+USE_LDCONFIG=	yes
+
+CMAKE_ON=	BUILD_SHARED_LIBS
+CMAKE_OFF=	BUILD_LIBPRIMESIEVE BUILD_STATIC_LIBS
+
+do-test:
+	cd ${BUILD_WRKSRC} && \
+	${SETENV} ${CONFIGURE_ENV} ${CMAKE_BIN} ${CMAKE_ARGS} -DBUILD_TESTS:BOOL=ON ${CMAKE_SOURCE_PATH} && \
+	${SETENV} ${MAKE_ENV} ${MAKE_CMD} ${MAKE_ARGS} ${ALL_TARGET} && \
+	${SETENV} ${MAKE_ENV} ${MAKE_CMD} ${MAKE_ARGS} test
+
+.include <bsd.port.mk>
diff --git a/math/primecount/distinfo b/math/primecount/distinfo
new file mode 100644
index 000000000000..96c6224de16d
--- /dev/null
+++ b/math/primecount/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1638108625
+SHA256 (kimwalisch-primecount-v7.1_GH0.tar.gz) = 4f156f3945b613c9262156a25255f689abcaf30fff778c1d27b17126fcd1db72
+SIZE (kimwalisch-primecount-v7.1_GH0.tar.gz) = 331976
diff --git a/math/primecount/pkg-descr b/math/primecount/pkg-descr
new file mode 100644
index 000000000000..39d205fd17fb
--- /dev/null
+++ b/math/primecount/pkg-descr
@@ -0,0 +1,5 @@
+primecount is a command-line program and C/C++ library that counts the primes
+below an integer x <= 1031 using highly optimized implementations of the
+combinatorial prime counting algorithms.
+
+WWW: https://github.com/kimwalisch/primecount
diff --git a/math/primecount/pkg-plist b/math/primecount/pkg-plist
new file mode 100644
index 000000000000..c437ab5777b0
--- /dev/null
+++ b/math/primecount/pkg-plist
@@ -0,0 +1,7 @@
+bin/primecount
+include/primecount.h
+include/primecount.hpp
+lib/libprimecount.so
+lib/libprimecount.so.7
+lib/libprimecount.so.7.1
+man/man1/primecount.1.gz