nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 fetchurl,
5 autoreconfHook,
6 pari,
7 ntl,
8 gmp,
9 # "FLINT is optional and only used for one part of sparse matrix reduction,
10 # which is used in the modular symbol code but not mwrank or other elliptic
11 # curve programs." -- https://github.com/JohnCremona/eclib/blob/master/README
12 withFlint ? false,
13 flint ? null,
14}:
15
16assert withFlint -> flint != null;
17
18stdenv.mkDerivation rec {
19 pname = "eclib";
20 version = "20250627"; # upgrade might break the sage interface
21 # sage tests to run:
22 # src/sage/interfaces/mwrank.py
23 # src/sage/libs/eclib
24 # ping @timokau for more info
25 src = fetchurl {
26 # all releases for this project appear on its GitHub releases page
27 # by definition! other distros sometimes update whenever they see
28 # a version bump in configure.ac or a new tag (and this might show
29 # up on repology). however, a version bump or a new tag may not
30 # represent a new release, and a new release might not be tagged.
31 #
32 # see https://github.com/JohnCremona/eclib/issues/64#issuecomment-789788561
33 # for upstream's explanation of the above
34 url = "https://github.com/JohnCremona/eclib/releases/download/${version}/eclib-${version}.tar.bz2";
35 hash = "sha256-uI1LUmEuSRxUFZRtnjXyBiyhAV7n+74LYfFY+nTLS8k=";
36 };
37 buildInputs = [
38 pari
39 ntl
40 gmp
41 ]
42 ++ lib.optionals withFlint [
43 flint
44 ];
45 nativeBuildInputs = [
46 autoreconfHook
47 ];
48 doCheck = true;
49 meta = with lib; {
50 description = "Elliptic curve tools";
51 homepage = "https://github.com/JohnCremona/eclib";
52 license = licenses.gpl2Plus;
53 teams = [ teams.sage ];
54 platforms = platforms.all;
55 };
56}