···175 done
176 '';
177178+ # Until https://github.com/NixOS/nixpkgs/pull/172617 is applied,
179+ # parallel builds do not always work because of a bug in dlltool.
180+ enableParallelBuilding = false;
181182 # https://bugs.winehq.org/show_bug.cgi?id=43530
183 # https://github.com/NixOS/nixpkgs/issues/31989
···1+{ lib
2+, stdenv
3+, fetchFromGitHub
4+, cmake
5+, primesieve
6+}:
7+8+stdenv.mkDerivation rec {
9+ pname = "primecount";
10+ version = "7.3";
11+12+ src = fetchFromGitHub {
13+ owner = "kimwalisch";
14+ repo = "primecount";
15+ rev = "v${version}";
16+ hash = "sha256-hxnn1uiGSB6XRC7yK+SXTwTsJfjhemWXsMNhhL7Ghek=";
17+ };
18+19+ nativeBuildInputs = [ cmake ];
20+21+ buildInputs = [ primesieve ];
22+23+ cmakeFlags = [
24+ "-DBUILD_LIBPRIMESIEVE=ON"
25+ "-DBUILD_PRIMECOUNT=ON"
26+ "-DBUILD_SHARED_LIBS=ON"
27+ "-DBUILD_STATIC_LIBS=OFF"
28+ "-DBUILD_TESTS=ON"
29+ ];
30+31+ meta = with lib; {
32+ homepage = "https://github.com/kimwalisch/primecount";
33+ description = "Fast prime counting function implementations";
34+ longDescription = ''
35+ primecount is a command-line program and C/C++ library that counts the
36+ primes below an integer x ≤ 10^31 using highly optimized implementations
37+ of the combinatorial prime counting algorithms.
38+39+ primecount includes implementations of all important combinatorial prime
40+ counting algorithms known up to this date all of which have been
41+ parallelized using OpenMP. primecount contains the first ever open source
42+ implementations of the Deleglise-Rivat algorithm and Xavier Gourdon's
43+ algorithm (that works). primecount also features a novel load balancer
44+ that is shared amongst all implementations and that scales up to hundreds
45+ of CPU cores. primecount has already been used to compute several prime
46+ counting function world records.
47+ '';
48+ license = licenses.bsd2;
49+ inherit (primesieve.meta) maintainers platforms;
50+ };
51+}
···1+{ lib
2+, stdenv
3+, fetchFromGitHub
4+, cmake
5+}:
6+7+stdenv.mkDerivation rec {
8+ pname = "primesieve";
9+ version = "7.9";
10+11+ src = fetchFromGitHub {
12+ owner = "kimwalisch";
13+ repo = "primesieve";
14+ rev = "v${version}";
15+ hash = "sha256-lwT+adKFoNI125y5FuJMovtMh8sFi9oqMLYGLabzrCI=";
16+ };
17+18+ nativeBuildInputs = [ cmake ];
19+20+ meta = with lib; {
21+ homepage = "https://primesieve.org/";
22+ description = "Fast C/C++ prime number generator";
23+ longDescription = ''
24+ primesieve is a command-line program and C/C++ library for quickly
25+ generating prime numbers. It is very cache efficient, it detects your
26+ CPU's L1 & L2 cache sizes and allocates its main data structures
27+ accordingly. It is also multi-threaded by default, it uses all available
28+ CPU cores whenever possible i.e. if sequential ordering is not
29+ required. primesieve can generate primes and prime k-tuplets up to 264.
30+ '';
31+ license = licenses.bsd2;
32+ maintainers = teams.sage.members ++
33+ (with maintainers; [ abbradar AndersonTorres ]);
34+ platforms = platforms.unix;
35+ };
36+}