7 tune ? false, # tune to hardware, impure
10 stdenv.mkDerivation rec {
14 # sage has picked up the maintenance (bug fixes and building, not development)
15 # from the original, now unmaintained project which can be found at
16 # http://web.maths.unsw.edu.au/~davidharvey/code/zn_poly/
17 src = fetchFromGitLab {
21 hash = "sha256-QBItcrrpOGj22/ShTDdfZjm63bGW2xY4c71R1q8abPE=";
29 python3 # needed by ./configure to create the makefile
32 # name of library file ("libzn_poly.so")
33 libbasename = "libzn_poly";
34 libext = stdenv.hostPlatform.extensions.sharedLibrary;
36 makeFlags = [ "CC=${stdenv.cc.targetPrefix}cc" ];
38 # Tuning (either autotuning or with hand-written parameters) is possible
39 # but not implemented here.
40 # It seems buggy anyways (see homepage).
43 "${libbasename}${libext}"
46 configureFlags = lib.optionals (!tune) [
50 # `make install` fails to install some header files and the lib file.
52 mkdir -p "$out/include/zn_poly"
54 cp "${libbasename}"*"${libext}" "$out/lib"
55 cp include/*.h "$out/include/zn_poly"
61 homepage = "https://web.maths.unsw.edu.au/~davidharvey/code/zn_poly/";
62 description = "Polynomial arithmetic over Z/nZ";
63 license = with licenses; [ gpl3 ];
64 maintainers = teams.sage.members;
65 platforms = platforms.unix;