commit:     59700e9c437870c74b498e5f214571c4be5ea3a6
Author:     Michael Orlitzky <mjo <AT> gentoo <DOT> org>
AuthorDate: Fri Dec 24 00:51:27 2021 +0000
Commit:     Michael Orlitzky <mjo <AT> gentoo <DOT> org>
CommitDate: Fri Dec 24 13:05:43 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=59700e9c

sci-mathematics/primecount: new fast CLI/library to count primes.

This is a new dependency of SageMath. The SageMath ./configure script
will detect primecount on the system and use it (rather than
rebuilding a bundled copy) if installed. Based on the sage-on-gentoo
ebuild contributed by François Bissey.

Package-Manager: Portage-3.0.28, Repoman-3.0.3
Signed-off-by: Michael Orlitzky <mjo <AT> gentoo.org>

 sci-mathematics/primecount/Manifest              |  1 +
 sci-mathematics/primecount/metadata.xml          | 24 ++++++++++++
 sci-mathematics/primecount/primecount-7.2.ebuild | 48 ++++++++++++++++++++++++
 3 files changed, 73 insertions(+)

diff --git a/sci-mathematics/primecount/Manifest 
b/sci-mathematics/primecount/Manifest
new file mode 100644
index 000000000000..f723765658e3
--- /dev/null
+++ b/sci-mathematics/primecount/Manifest
@@ -0,0 +1 @@
+DIST primecount-7.2.tar.gz 340799 BLAKE2B 
5ce3661e322be363e2fe79de1dd134b5c3009269cbb10d36dc69bee4c23c9f41d2117b3ed7aa4c5f852e494832573c84a8d9c37cbe92cf80a5024bdec9b22c69
 SHA512 
df14929012434eddfab94410ba9165642094327f8abd139a6a1ba87e508bba56df91cb0dc9411e873e90a9aa4aa3ba4007396c930d593f5954be8c715fa26e84

diff --git a/sci-mathematics/primecount/metadata.xml 
b/sci-mathematics/primecount/metadata.xml
new file mode 100644
index 000000000000..524d8bf2ac66
--- /dev/null
+++ b/sci-mathematics/primecount/metadata.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd";>
+<pkgmetadata>
+    <maintainer type="person">
+    <email>[email protected]</email>
+  </maintainer>
+
+  <maintainer type="person" proxied="yes">
+    <email>[email protected]</email>
+    <name>François Bissey</name>
+  </maintainer>
+  <maintainer type="project" proxied="proxy">
+    <email>[email protected]</email>
+    <name>Proxy Maintainers</name>
+  </maintainer>
+
+  <use>
+    <flag name="executable">Build the primecount CLI executable</flag>
+  </use>
+
+  <upstream>
+    <remote-id type="github">kimwalisch/primecount</remote-id>
+  </upstream>
+</pkgmetadata>

diff --git a/sci-mathematics/primecount/primecount-7.2.ebuild 
b/sci-mathematics/primecount/primecount-7.2.ebuild
new file mode 100644
index 000000000000..1e394a48459e
--- /dev/null
+++ b/sci-mathematics/primecount/primecount-7.2.ebuild
@@ -0,0 +1,48 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit cmake toolchain-funcs
+
+DESCRIPTION="Highly optimized CLI and library to count primes"
+HOMEPAGE="https://github.com/kimwalisch/primecount";
+SRC_URI="https://github.com/kimwalisch/${PN}/archive/refs/tags/v${PV}.tar.gz 
-> ${P}.tar.gz"
+LICENSE="BSD-2"
+SLOT="0/7"  # subslot is first component of libprimecount.so version
+KEYWORDS="~amd64"
+IUSE="+executable openmp test"
+RESTRICT="!test? ( test )"
+
+DEPEND="sci-mathematics/primesieve:="
+RDEPEND="${DEPEND}"
+
+DOCS=(
+       ChangeLog
+       README.md
+       doc/Credits.md
+       doc/Easy-Special-Leaves.md
+       doc/Hard-Special-Leaves.md
+       doc/Records.md
+       doc/References.md
+       doc/alpha-factor-dr.pdf
+       doc/alpha-factor-gourdon.pdf
+       doc/alpha-factor-lmo.pdf
+       doc/libprimecount.md
+)
+
+pkg_pretend() {
+       use openmp && tc-check-openmp
+}
+
+src_configure() {
+       local mycmakeargs=(
+               -DBUILD_LIBPRIMESIEVE="OFF"
+               -DBUILD_PRIMECOUNT="$(usex executable)"
+               -DBUILD_STATIC_LIBS="OFF"
+               -DBUILD_TESTS="$(usex test)"
+               -DWITH_OPENMP="$(usex openmp)"
+       )
+
+       cmake_src_configure
+}

Reply via email to