Merge pull request #294869 from atorres1985-contrib/primecount

primecount, primesieve: refactor

authored by Thiago Kenji Okada and committed by GitHub 1040e568 f8a35f42

+41 -28
+18 -13
pkgs/applications/science/math/primecount/default.nix pkgs/by-name/pr/primecount/package.nix
··· 1 { lib 2 - , stdenv 3 - , fetchFromGitHub 4 , cmake 5 , primesieve 6 }: 7 8 - stdenv.mkDerivation rec { 9 pname = "primecount"; 10 version = "7.10"; 11 12 src = fetchFromGitHub { 13 owner = "kimwalisch"; 14 repo = "primecount"; 15 - rev = "v${version}"; 16 hash = "sha256-z7sHGR6zZSTV1PbL0WPGHf52CYQ572KC1yznCuIEJbQ="; 17 }; 18 19 nativeBuildInputs = [ 20 cmake 21 ]; ··· 23 buildInputs = [ 24 primesieve 25 ]; 26 27 cmakeFlags = [ 28 - "-DBUILD_LIBPRIMESIEVE=ON" 29 - "-DBUILD_PRIMECOUNT=ON" 30 - "-DBUILD_SHARED_LIBS=ON" 31 - "-DBUILD_STATIC_LIBS=OFF" 32 - "-DBUILD_TESTS=ON" 33 ]; 34 35 - meta = with lib; { 36 homepage = "https://github.com/kimwalisch/primecount"; 37 - changelog = "https://github.com/kimwalisch/primecount/blob/v${version}/ChangeLog"; 38 description = "Fast prime counting function implementations"; 39 longDescription = '' 40 primecount is a command-line program and C/C++ library that counts the ··· 50 of CPU cores. primecount has already been used to compute several prime 51 counting function world records. 52 ''; 53 - license = licenses.bsd2; 54 inherit (primesieve.meta) maintainers platforms; 55 }; 56 - }
··· 1 { lib 2 , cmake 3 + , fetchFromGitHub 4 , primesieve 5 + , stdenv 6 }: 7 8 + stdenv.mkDerivation (finalAttrs: { 9 pname = "primecount"; 10 version = "7.10"; 11 12 src = fetchFromGitHub { 13 owner = "kimwalisch"; 14 repo = "primecount"; 15 + rev = "v${finalAttrs.version}"; 16 hash = "sha256-z7sHGR6zZSTV1PbL0WPGHf52CYQ572KC1yznCuIEJbQ="; 17 }; 18 19 + outputs = [ "out" "dev" "lib" "man" ]; 20 + 21 nativeBuildInputs = [ 22 cmake 23 ]; ··· 25 buildInputs = [ 26 primesieve 27 ]; 28 + 29 + strictDeps = true; 30 31 cmakeFlags = [ 32 + (lib.cmakeBool "BUILD_LIBPRIMESIEVE" true) 33 + (lib.cmakeBool "BUILD_PRIMECOUNT" true) 34 + (lib.cmakeBool "BUILD_SHARED_LIBS" (!stdenv.hostPlatform.isStatic)) 35 + (lib.cmakeBool "BUILD_STATIC_LIBS" stdenv.hostPlatform.isStatic) 36 + (lib.cmakeBool "BUILD_TESTS" true) 37 ]; 38 39 + meta = { 40 homepage = "https://github.com/kimwalisch/primecount"; 41 description = "Fast prime counting function implementations"; 42 longDescription = '' 43 primecount is a command-line program and C/C++ library that counts the ··· 53 of CPU cores. primecount has already been used to compute several prime 54 counting function world records. 55 ''; 56 + changelog = "https://github.com/kimwalisch/primecount/blob/${finalAttrs.src.rev}/ChangeLog"; 57 + license = lib.licenses.bsd2; 58 + mainProgram = "primecount"; 59 inherit (primesieve.meta) maintainers platforms; 60 }; 61 + })
+23 -11
pkgs/applications/science/math/primesieve/default.nix pkgs/by-name/pr/primesieve/package.nix
··· 1 { lib 2 , stdenv 3 - , fetchFromGitHub 4 - , cmake 5 }: 6 7 - stdenv.mkDerivation rec { 8 pname = "primesieve"; 9 version = "12.1"; 10 11 src = fetchFromGitHub { 12 owner = "kimwalisch"; 13 repo = "primesieve"; 14 - rev = "v${version}"; 15 hash = "sha256-AHl2GfZ1oJ8ZyjJzvg10AqN7TA7HFZ+qa6N2v51Qa78="; 16 }; 17 18 nativeBuildInputs = [ cmake ]; 19 20 - meta = with lib; { 21 homepage = "https://primesieve.org/"; 22 - changelog = "https://github.com/kimwalisch/primesieve/blob/v${version}/ChangeLog"; 23 description = "Fast C/C++ prime number generator"; 24 longDescription = '' 25 primesieve is a command-line program and C/C++ library for quickly ··· 29 CPU cores whenever possible i.e. if sequential ordering is not 30 required. primesieve can generate primes and prime k-tuplets up to 264. 31 ''; 32 - license = licenses.bsd2; 33 - maintainers = teams.sage.members ++ 34 - (with maintainers; [ abbradar AndersonTorres ]); 35 - platforms = platforms.unix; 36 }; 37 - }
··· 1 { lib 2 + , cmake 3 + , fetchFromGitHub 4 , stdenv 5 + , primecount 6 }: 7 8 + stdenv.mkDerivation (finalAttrs: { 9 pname = "primesieve"; 10 version = "12.1"; 11 12 src = fetchFromGitHub { 13 owner = "kimwalisch"; 14 repo = "primesieve"; 15 + rev = "v${finalAttrs.version}"; 16 hash = "sha256-AHl2GfZ1oJ8ZyjJzvg10AqN7TA7HFZ+qa6N2v51Qa78="; 17 }; 18 19 + outputs = [ "out" "dev" "lib" "man" ]; 20 + 21 nativeBuildInputs = [ cmake ]; 22 23 + strictDeps = true; 24 + 25 + passthru = { 26 + tests = { 27 + inherit primecount; # dependent 28 + }; 29 + }; 30 + 31 + meta = { 32 homepage = "https://primesieve.org/"; 33 description = "Fast C/C++ prime number generator"; 34 longDescription = '' 35 primesieve is a command-line program and C/C++ library for quickly ··· 39 CPU cores whenever possible i.e. if sequential ordering is not 40 required. primesieve can generate primes and prime k-tuplets up to 264. 41 ''; 42 + changelog = "https://github.com/kimwalisch/primesieve/blob/${finalAttrs.src.rev}/ChangeLog"; 43 + license = lib.licenses.bsd2; 44 + mainProgram = "primesieve"; 45 + maintainers = lib.teams.sage.members ++ 46 + (with lib.maintainers; [ abbradar AndersonTorres ]); 47 + platforms = lib.platforms.unix; 48 }; 49 + })
-4
pkgs/top-level/all-packages.nix
··· 24233 24234 prime-server = callPackage ../development/libraries/prime-server { }; 24235 24236 - primecount = callPackage ../applications/science/math/primecount { }; 24237 - 24238 - primesieve = callPackage ../applications/science/math/primesieve { }; 24239 - 24240 proj = callPackage ../development/libraries/proj { 24241 stdenv = if stdenv.cc.isClang then overrideLibcxx llvmPackages_13.stdenv else stdenv; 24242 };
··· 24233 24234 prime-server = callPackage ../development/libraries/prime-server { }; 24235 24236 proj = callPackage ../development/libraries/proj { 24237 stdenv = if stdenv.cc.isClang then overrideLibcxx llvmPackages_13.stdenv else stdenv; 24238 };