electron_32: fix log spam when building on aarch64-linux (#378988)
[NixPkgs.git] / pkgs / by-name / zn / zn_poly / package.nix
blob2150cef6d4cd26a30b2a6c01bd26f9ea22a65745
2   stdenv,
3   lib,
4   fetchFromGitLab,
5   gmp,
6   python3,
7   tune ? false, # tune to hardware, impure
8 }:
10 stdenv.mkDerivation rec {
11   version = "0.9.2";
12   pname = "zn_poly";
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 {
18     owner = "sagemath";
19     repo = "zn_poly";
20     rev = version;
21     hash = "sha256-QBItcrrpOGj22/ShTDdfZjm63bGW2xY4c71R1q8abPE=";
22   };
24   buildInputs = [
25     gmp
26   ];
28   nativeBuildInputs = [
29     python3 # needed by ./configure to create the makefile
30   ];
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).
41   buildFlags = [
42     "all"
43     "${libbasename}${libext}"
44   ];
46   configureFlags = lib.optionals (!tune) [
47     "--disable-tuning"
48   ];
50   # `make install` fails to install some header files and the lib file.
51   installPhase = ''
52     mkdir -p "$out/include/zn_poly"
53     mkdir -p "$out/lib"
54     cp "${libbasename}"*"${libext}" "$out/lib"
55     cp include/*.h "$out/include/zn_poly"
56   '';
58   doCheck = true;
60   meta = with lib; {
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;
66   };