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