linux_xanmod: 5.11.14 -> 5.11.15
[NixPkgs.git] / pkgs / development / libraries / science / math / sympow / default.nix
blobc31c705d39d0ab84b6091e5fb1b0b8142d4fad4b
1 { lib, stdenv
2 , fetchFromGitLab
3 , makeWrapper
4 , which
5 , autoconf
6 , help2man
7 , file
8 , pari
9 }:
11 stdenv.mkDerivation rec {
12   version = "2.023.6";
13   pname = "sympow";
15   src = fetchFromGitLab {
16     group = "rezozer";
17     owner = "forks";
18     repo = "sympow";
19     rev = "v${version}";
20     sha256 = "132l0xv00ld1svvv9wh99wfra4zzjv2885h2sq0dsl98wiyvi5zl";
21   };
23   patches = [ ./clean-extra-logfile-output-from-pari.patch ];
25   postUnpack = ''
26     patchShebangs .
27   '';
29   nativeBuildInputs = [
30     makeWrapper
31     which
32     autoconf
33     help2man
34     file
35     pari
36   ];
38   configurePhase = ''
39     runHook preConfigure
40     export PREFIX="$out"
41     export VARPREFIX="$out" # see comment on postInstall
42     ./Configure # doesn't take any options
43     runHook postConfigure
44   '';
46   # Usually, sympow has 3 levels of caching: statically distributed in /usr/,
47   # shared in /var and per-user in ~/.sympow. The shared cache assumes trust in
48   # other users and a shared /var is not compatible with nix's approach, so we
49   # set VARPREFIX to the read-only $out. This effectively disables shared
50   # caching. See https://trac.sagemath.org/ticket/3360#comment:36 and sympow's
51   # README for more details on caching.
52   # sympow will complain at runtime about the lack of write-permissions on the
53   # shared cache. We pass the `-quiet` flag by default to disable this.
54   postInstall = ''
55     wrapProgram "$out/bin/sympow" --add-flags '-quiet'
56   '';
58   # Example from the README as a sanity check.
59   doInstallCheck = true;
60   installCheckPhase = ''
61     export HOME="$TMP/home"
62     mkdir -p "$HOME"
63     "$out/bin/sympow" -sp 2p16 -curve "[1,2,3,4,5]" | grep '8.3705'
64   '';
66   meta = with lib; {
67     description = "Compute special values of symmetric power elliptic curve L-functions";
68     license = {
69       shortName = "sympow";
70       fullName = "Custom, BSD-like. See COPYING file.";
71       free = true;
72     };
73     maintainers = teams.sage.members;
74     platforms = platforms.linux;
75   };