Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
94 lines
2.1 KiB
Nix
94 lines
2.1 KiB
Nix
{
|
|
stdenv,
|
|
lib,
|
|
fetchurl,
|
|
unzip,
|
|
boost,
|
|
curl,
|
|
hwloc,
|
|
gmp,
|
|
}:
|
|
|
|
let
|
|
throwSystem = throw "Unsupported system: ${stdenv.hostPlatform.system}";
|
|
|
|
srcDir =
|
|
{
|
|
x86_64-linux = "linux64";
|
|
i686-linux = "linux";
|
|
x86_64-darwin = "macosx64";
|
|
}
|
|
."${stdenv.hostPlatform.system}" or throwSystem;
|
|
|
|
gwnum =
|
|
{
|
|
x86_64-linux = "make64";
|
|
i686-linux = "makefile";
|
|
x86_64-darwin = "makemac";
|
|
}
|
|
."${stdenv.hostPlatform.system}" or throwSystem;
|
|
in
|
|
|
|
stdenv.mkDerivation rec {
|
|
pname = "mprime";
|
|
version = "30.19b21";
|
|
src = fetchurl {
|
|
url = "https://download.mersenne.ca/gimps/v30/30.19/p95v${
|
|
lib.replaceStrings [ "." ] [ "" ] version
|
|
}.source.zip";
|
|
hash = "sha256-vchDpUem+R3GcASj77zZmFivfbB17Nd7cYiyPlrCzio=";
|
|
};
|
|
|
|
postPatch = ''
|
|
sed -i ${srcDir}/makefile \
|
|
-e 's/^LFLAGS =.*//'
|
|
substituteInPlace ${srcDir}/makefile \
|
|
--replace '-Wl,-Bstatic' "" \
|
|
--replace '-Wl,-Bdynamic' ""
|
|
'';
|
|
|
|
sourceRoot = ".";
|
|
|
|
nativeBuildInputs = [ unzip ];
|
|
|
|
buildInputs = [
|
|
boost
|
|
curl
|
|
hwloc
|
|
gmp
|
|
];
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
buildPhase = ''
|
|
make -C gwnum -f ${gwnum}
|
|
make -C ${srcDir}
|
|
'';
|
|
|
|
installPhase = ''
|
|
install -Dm555 -t $out/bin ${srcDir}/mprime
|
|
'';
|
|
|
|
meta = with lib; {
|
|
description = "Mersenne prime search / System stability tester";
|
|
longDescription = ''
|
|
MPrime is the Linux command-line interface version of Prime95, to be run
|
|
in a text terminal or in a terminal emulator window as a remote shell
|
|
client. It is identical to Prime95 in functionality, except it lacks a
|
|
graphical user interface.
|
|
'';
|
|
homepage = "https://www.mersenne.org/";
|
|
# Unfree, because of a license requirement to share prize money if you find
|
|
# a suitable prime. http://www.mersenne.org/legal/#EULA
|
|
license = licenses.unfree;
|
|
# Untested on linux-32 and osx. Works in theory.
|
|
platforms = [
|
|
"i686-linux"
|
|
"x86_64-linux"
|
|
"x86_64-darwin"
|
|
];
|
|
maintainers = with maintainers; [ dstremur ];
|
|
mainProgram = "mprime";
|
|
};
|
|
}
|