git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #43563 from timokau/eclib-20180710

eclib: 20171219 -> 20180710

commit10ffc3c791798fef9c7384025ea73cebb2168f2b authorMichael Raskin <7c6f434c@mail.ru> dateSun 15 Jul 2018, 13:56 (8 years ago) parente82de57c77d1e5
3 files changed+62−6
pkgs/applications/science/math/sage/patches/eclib-20180710.patch+40 pkgs/applications/science/math/sage/sage-src.nix+3 pkgs/development/libraries/eclib/default.nix+19−6
pkgs/applications/science/math/sage/patches/eclib-20180710.patchnew file+40
@@ -0,0 +1,40 @@
1+diff --git a/src/sage/interfaces/mwrank.py b/src/sage/interfaces/mwrank.py
2+index 4417b59276..ae57ca2991 100644
3+--- a/src/sage/interfaces/mwrank.py
4++++ b/src/sage/interfaces/mwrank.py
5+@@ -54,8 +54,9 @@ def Mwrank(options="", server=None, server_tmpdir=None):
6+ sage: M = Mwrank('-v 0 -l')
7+ sage: print(M('0 0 1 -1 0'))
8+ Curve [0,0,1,-1,0] : Rank = 1
9+- Generator 1 is [0:-1:1]; height 0.0511114082399688
10+- Regulator = 0.0511114082399688
11++ Generator 1 is [0:-1:1]; height 0.051111408239969
12++ Regulator = 0.051111408239969
13++
14+ """
15+ global instances
16+ try:
17+diff --git a/src/sage/libs/eclib/wrap.cpp b/src/sage/libs/eclib/wrap.cpp
18+index 5fd5693b53..d12468faa8 100644
19+--- a/src/sage/libs/eclib/wrap.cpp
20++++ b/src/sage/libs/eclib/wrap.cpp
21+@@ -133,8 +133,8 @@ char* Curvedata_isogeny_class(struct Curvedata* E, int verbose)
22+
23+
24+ int mw_process(struct Curvedata* curve, struct mw* m,
25+- const struct bigint* x, const struct bigint* y,
26+- const struct bigint* z, int sat)
27++ const bigint* x, const bigint* y,
28++ const bigint* z, int sat)
29+ {
30+ Point P(*curve, *x, *y, *z);
31+ if (!P.isvalid())
32+@@ -188,7 +188,7 @@ int mw_rank(struct mw* m)
33+ }
34+
35+ /* Returns index and unsat long array, which user must deallocate */
36+-int mw_saturate(struct mw* m, struct bigint* index, char** unsat,
37++int mw_saturate(struct mw* m, bigint* index, char** unsat,
38+ long sat_bd, int odd_primes_only)
39+ {
40+ vector<long> v;
pkgs/applications/science/math/sage/sage-src.nix+3
@@ -176,6 +176,9 @@ stdenv.mkDerivation rec {
176176
177177 # https://trac.sagemath.org/ticket/24838 rebased
178178 ./patches/pynac-0.7.22.patch
179+
180+ # https://trac.sagemath.org/ticket/25862
181+ ./patches/eclib-20180710.patch
179182 ];
180183
181184 patches = nixPatches ++ packageUpgradePatches;
pkgs/development/libraries/eclib/default.nix+19−6
@@ -1,5 +1,6 @@
11{ stdenv
22, fetchFromGitHub
3+, fetchpatch
34, autoreconfHook
45, libtool
56, gettext
@@ -17,13 +18,25 @@ assert withFlint -> flint != null;
1718stdenv.mkDerivation rec {
1819 name = "${pname}-${version}";
1920 pname = "eclib";
20− version = "20171219";
21+ version = "20180710"; # upgrade might break the sage interface
22+ # sage tests to run:
23+ # src/sage/interfaces/mwrank.py
24+ # src/sage/libs/eclib
25+ # ping @timokau for more info
2126 src = fetchFromGitHub {
2227 owner = "JohnCremona";
2328 repo = "${pname}";
2429 rev = "v${version}";
25− sha256 = "1yw488ng0labpxqqpxq0710qnndxl8plvcaqklpbwwd62a47knlr";
30+ sha256 = "1kmwpw971sipb4499c9b35q5pz6sms5qndqrvq7396d8hhwjg1i2";
2631 };
32+ patches = [
33+ # One of the headers doesn't get installed.
34+ # See https://github.com/NixOS/nixpkgs/pull/43476.
35+ (fetchpatch {
36+ url = "https://github.com/JohnCremona/eclib/pull/42/commits/c9b96429815e31a6e3372c106e31eef2a96431f9.patch";
37+ sha256 = "0cw26h94m66rbh8jjsfnb1bvc6z7ybh8zcp8xl5nhxjxiawhcl73";
38+ })
39+ ];
2740 buildInputs = [
2841 pari
2942 ntl
@@ -35,12 +48,12 @@ stdenv.mkDerivation rec {
3548 autoreconfHook
3649 ];
3750 doCheck = true;
38− meta = {
51+ meta = with stdenv.lib; {
3952 inherit version;
4053 description = ''Elliptic curve tools'';
4154 homepage = https://github.com/JohnCremona/eclib;
42− license = stdenv.lib.licenses.gpl2Plus;
43− maintainers = [stdenv.lib.maintainers.raskin];
44− platforms = stdenv.lib.platforms.linux;
55+ license = licenses.gpl2Plus;
56+ maintainers = with maintainers; [ raskin timokau ];
57+ platforms = platforms.all;
4558 };
4659}