7 # I asked the ntl maintainer weather or not to include gf2x by default:
8 # > If I remember correctly, gf2x is now thread safe, so there's no reason not to use it.
10 , tune ? false # tune for current system; non reproducible and time consuming
13 assert withGf2x -> gf2x != null;
15 stdenv.mkDerivation rec {
20 url = "http://www.shoup.net/ntl/ntl-${version}.tar.gz";
21 sha256 = "sha256-nX9uguEaQJ8VHA3i3rCMDXY7r5g0/d/UMr89IY+AIds=";
29 perl # needed for ./configure
32 sourceRoot = "${pname}-${version}/src";
34 enableParallelBuilding = true;
36 dontAddPrefix = true; # DEF_PREFIX instead
38 # reference: http://shoup.net/ntl/doc/tour-unix.html
41 "SHARED=on" # genereate a shared library (as well as static)
42 "NATIVE=off" # don't target code to current hardware (reproducibility, portability)
46 else if stdenv.targetPlatform.isx86 then
47 "x86" # "chooses options that should be well suited for most x86 platforms"
49 "generic" # "chooses options that should be OK for most platforms"
51 "CXX=${stdenv.cc.targetPrefix}c++"
52 ] ++ lib.optionals withGf2x [
57 doCheck = true; # takes some time
60 description = "A Library for doing Number Theory";
62 NTL is a high-performance, portable C++ library providing data
63 structures and algorithms for manipulating signed, arbitrary
64 length integers, and for vectors, matrices, and polynomials over
65 the integers and over finite fields.
67 # Upstream contact: maintainer is victorshoup on GitHub. Alternatively the
68 # email listed on the homepage.
69 homepage = "http://www.shoup.net/ntl/";
70 # also locally at "${src}/doc/tour-changes.html";
71 changelog = "https://www.shoup.net/ntl/doc/tour-changes.html";
72 maintainers = teams.sage.members;
73 license = licenses.gpl2Plus;
74 platforms = platforms.all;