1{ lib, stdenv
2, fetchurl
3, python3
4}:
5
6stdenv.mkDerivation rec {
7 pname = "elliptic_curves";
8 version = "0.8.1";
9
10 src = fetchurl {
11 url = "mirror://sageupstream/${pname}/${pname}-${version}.tar.bz2";
12 sha256 = "0l7xh4abw5sb4d37r0ylr3vwb88fpx2zrvfm5ql0c7yrv5q59fjz";
13 };
14
15
16 # Script that creates the sqlite database from the allcurves textfile
17 spkg-install = fetchurl {
18 url = "https://git.sagemath.org/sage.git/plain/build/pkgs/${pname}/spkg-install.py?id=07d6c37d18811e2b377a9689790a7c5e24da16ba";
19 sha256 = "116g684i6mvs11fvb6fzfsr4fn903axn31vigdyb8bgpf8l4hvc5";
20 };
21
22 installPhase = ''
23 # directory layout as spkg-install.py expects
24 dir="$PWD"
25 cd ..
26 ln -s "$dir" "src"
27
28 # environment spkg-install.py expects
29 mkdir -p "$out/share"
30 export SAGE_SHARE="$out/share"
31 export PYTHONPATH=$PWD
32
33 ${python3.interpreter} ${spkg-install}
34 '';
35
36 meta = with lib; {
37 description = "Databases of elliptic curves";
38 longDescription = ''
39 Includes two databases:
40
41 * A small subset of the data in John Cremona's database of elliptic curves up
42 to conductor 10000. See http://www.warwick.ac.uk/~masgaj/ftp/data/ or
43 http://sage.math.washington.edu/cremona/INDEX.html
44 * William Stein's database of interesting curves
45 '';
46 license = licenses.gpl2;
47 platforms = platforms.all;
48 maintainers = teams.sage.members;
49 };
50}