Merge pull request #294869 from atorres1985-contrib/primecount

primecount, primesieve: refactor
This commit is contained in:
Thiago Kenji Okada 2024-03-12 19:20:56 +00:00 committed by GitHub
commit 1040e5688c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 41 additions and 28 deletions

View file

@ -1,21 +1,23 @@
{ lib
, stdenv
, fetchFromGitHub
, cmake
, fetchFromGitHub
, primesieve
, stdenv
}:
stdenv.mkDerivation rec {
stdenv.mkDerivation (finalAttrs: {
pname = "primecount";
version = "7.10";
src = fetchFromGitHub {
owner = "kimwalisch";
repo = "primecount";
rev = "v${version}";
rev = "v${finalAttrs.version}";
hash = "sha256-z7sHGR6zZSTV1PbL0WPGHf52CYQ572KC1yznCuIEJbQ=";
};
outputs = [ "out" "dev" "lib" "man" ];
nativeBuildInputs = [
cmake
];
@ -24,17 +26,18 @@ stdenv.mkDerivation rec {
primesieve
];
strictDeps = true;
cmakeFlags = [
"-DBUILD_LIBPRIMESIEVE=ON"
"-DBUILD_PRIMECOUNT=ON"
"-DBUILD_SHARED_LIBS=ON"
"-DBUILD_STATIC_LIBS=OFF"
"-DBUILD_TESTS=ON"
(lib.cmakeBool "BUILD_LIBPRIMESIEVE" true)
(lib.cmakeBool "BUILD_PRIMECOUNT" true)
(lib.cmakeBool "BUILD_SHARED_LIBS" (!stdenv.hostPlatform.isStatic))
(lib.cmakeBool "BUILD_STATIC_LIBS" stdenv.hostPlatform.isStatic)
(lib.cmakeBool "BUILD_TESTS" true)
];
meta = with lib; {
meta = {
homepage = "https://github.com/kimwalisch/primecount";
changelog = "https://github.com/kimwalisch/primecount/blob/v${version}/ChangeLog";
description = "Fast prime counting function implementations";
longDescription = ''
primecount is a command-line program and C/C++ library that counts the
@ -50,7 +53,9 @@ stdenv.mkDerivation rec {
of CPU cores. primecount has already been used to compute several prime
counting function world records.
'';
license = licenses.bsd2;
changelog = "https://github.com/kimwalisch/primecount/blob/${finalAttrs.src.rev}/ChangeLog";
license = lib.licenses.bsd2;
mainProgram = "primecount";
inherit (primesieve.meta) maintainers platforms;
};
}
})

View file

@ -1,25 +1,35 @@
{ lib
, stdenv
, fetchFromGitHub
, cmake
, fetchFromGitHub
, stdenv
, primecount
}:
stdenv.mkDerivation rec {
stdenv.mkDerivation (finalAttrs: {
pname = "primesieve";
version = "12.1";
src = fetchFromGitHub {
owner = "kimwalisch";
repo = "primesieve";
rev = "v${version}";
rev = "v${finalAttrs.version}";
hash = "sha256-AHl2GfZ1oJ8ZyjJzvg10AqN7TA7HFZ+qa6N2v51Qa78=";
};
outputs = [ "out" "dev" "lib" "man" ];
nativeBuildInputs = [ cmake ];
meta = with lib; {
strictDeps = true;
passthru = {
tests = {
inherit primecount; # dependent
};
};
meta = {
homepage = "https://primesieve.org/";
changelog = "https://github.com/kimwalisch/primesieve/blob/v${version}/ChangeLog";
description = "Fast C/C++ prime number generator";
longDescription = ''
primesieve is a command-line program and C/C++ library for quickly
@ -29,9 +39,11 @@ stdenv.mkDerivation rec {
CPU cores whenever possible i.e. if sequential ordering is not
required. primesieve can generate primes and prime k-tuplets up to 264.
'';
license = licenses.bsd2;
maintainers = teams.sage.members ++
(with maintainers; [ abbradar AndersonTorres ]);
platforms = platforms.unix;
changelog = "https://github.com/kimwalisch/primesieve/blob/${finalAttrs.src.rev}/ChangeLog";
license = lib.licenses.bsd2;
mainProgram = "primesieve";
maintainers = lib.teams.sage.members ++
(with lib.maintainers; [ abbradar AndersonTorres ]);
platforms = lib.platforms.unix;
};
}
})

View file

@ -24233,10 +24233,6 @@ with pkgs;
prime-server = callPackage ../development/libraries/prime-server { };
primecount = callPackage ../applications/science/math/primecount { };
primesieve = callPackage ../applications/science/math/primesieve { };
proj = callPackage ../development/libraries/proj {
stdenv = if stdenv.cc.isClang then overrideLibcxx llvmPackages_13.stdenv else stdenv;
};