1{
2 lib,
3 stdenv,
4 fetchsvn,
5 zlib,
6 gmp,
7 ecm,
8}:
9
10stdenv.mkDerivation rec {
11 pname = "msieve";
12 version = "1056";
13
14 src = fetchsvn {
15 url = "svn://svn.code.sf.net/p/msieve/code/trunk";
16 rev = version;
17 hash = "sha256-6ErVn4pYPMG5VFjOQURLsHNpN0pGdp55+rjY8988onU=";
18 };
19
20 patches = [ ./savefile_t-pointer-type.patch ];
21
22 buildInputs = [
23 zlib
24 gmp
25 ecm
26 ];
27
28 ECM = if ecm == null then "0" else "1";
29
30 # Doesn't hurt Linux but lets clang-based platforms like Darwin work fine too
31 makeFlags = [
32 "CC=${stdenv.cc.targetPrefix}cc"
33 "all"
34 ];
35
36 enableParallelBuilding = true;
37
38 installPhase = ''
39 mkdir -p $out/bin/
40 cp msieve $out/bin/
41 '';
42
43 meta = {
44 description = "C library implementing a suite of algorithms to factor large integers";
45 mainProgram = "msieve";
46 license = lib.licenses.publicDomain;
47 homepage = "http://msieve.sourceforge.net/";
48 maintainers = [ lib.maintainers.roconnor ];
49 platforms = [ "x86_64-linux" ] ++ lib.platforms.darwin;
50 };
51}