diff --git a/pkgs/applications/science/math/primecount/default.nix b/pkgs/by-name/pr/primecount/package.nix similarity index 70% rename from pkgs/applications/science/math/primecount/default.nix rename to pkgs/by-name/pr/primecount/package.nix index c3e2565989ed..791acca6ae5d 100644 --- a/pkgs/applications/science/math/primecount/default.nix +++ b/pkgs/by-name/pr/primecount/package.nix @@ -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; }; -} +}) diff --git a/pkgs/applications/science/math/primesieve/default.nix b/pkgs/by-name/pr/primesieve/package.nix similarity index 61% rename from pkgs/applications/science/math/primesieve/default.nix rename to pkgs/by-name/pr/primesieve/package.nix index 4d3c06bd9287..470b62111b3f 100644 --- a/pkgs/applications/science/math/primesieve/default.nix +++ b/pkgs/by-name/pr/primesieve/package.nix @@ -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; }; -} +}) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 40a56c4c9e6c..51b543770b23 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -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; };