@@ -10,14 +10,14 @@
1010# all get the same sources with the same patches applied.
1111
1212stdenv.mkDerivation rec {
13− version = "8.6";
14− name = "sage-src-${version}";
13+ version = "8.7";
14+ pname = "sage-src";
1515
1616 src = fetchFromGitHub {
1717 owner = "sagemath";
1818 repo = "sage";
1919 rev = version;
20− sha256 = "1vs3pbgbqpg0qnwr018bqsdmm7crgjp310cx8zwh7za3mv1cw5j3";
20+ sha256 = "05vvrd6syh0hlmrk6kzjrwd0hpmvxp8vr8p3mkjb0jh5p2kjdd27";
2121 };
2222
2323 # Patches needed because of particularities of nix or the way this is packaged.
@@ -37,12 +37,6 @@ stdenv.mkDerivation rec {
3737 # https://github.com/python/cpython/pull/7476
3838 ./patches/python-5755-hotpatch.patch
3939
40− # Revert the commit that made the sphinx build fork even in the single thread
41− # case. For some yet unknown reason, that breaks the docbuild on nix and archlinux.
42− # See https://groups.google.com/forum/#!msg/sage-packaging/VU4h8IWGFLA/mrmCMocYBwAJ.
43− # https://trac.sagemath.org/ticket/26608
44− ./patches/revert-sphinx-always-fork.patch
45−
4640 # Make sure py2/py3 tests are only run when their expected context (all "sage"
4741 # tests) are also run. That is necessary to test dochtml individually. See
4842 # https://trac.sagemath.org/ticket/26110 for an upstream discussion.
@@ -59,6 +53,21 @@ stdenv.mkDerivation rec {
5953 sha256 = "07p9i0fwjgapmfvmi436yn6v60p8pvmxqjc93wsssqgh5kd8qw3n";
6054 stripLen = 1;
6155 })
56+
57+ # Part of the build system. Should become unnecessary with sage 8.8.
58+ # Upstream discussion here: https://trac.sagemath.org/ticket/27124#comment:33
59+ ./patches/do-not-test-package-manifests.patch
60+
61+ # Not necessary since library location is set explicitly
62+ # https://trac.sagemath.org/ticket/27660#ticket
63+ ./patches/do-not-test-find-library.patch
64+
65+ # https://trac.sagemath.org/ticket/27697#ticket
66+ (fetchpatch {
67+ name = "pplpy-doc-location-configurable.patch";
68+ url = "https://git.sagemath.org/sage.git/patch/?h=c4d966e7cb0c7b87c55d52dc6f46518433a2a0a2";
69+ sha256 = "0pqbbsx8mriwny422s9mp3z5d095cnam32sm62q4mxk8g8jb9vm9";
70+ })
6271 ];
6372
6473 # Since sage unfortunately does not release bugfix releases, packagers must
@@ -72,12 +81,6 @@ stdenv.mkDerivation rec {
7281 url = "https://git.sagemath.org/sage.git/patch?id2=10407524b18659e14e184114b61c043fb816f3c2&id=c9b0cc9d0b8748ab85e568f8f57f316c5e8cbe54";
7382 sha256 = "0wgp7yvn9sm1ynlhcr4l0hzmvr2n28llg4xc01p6k1zz4im64c17";
7483 })
75− # https://trac.sagemath.org/ticket/27224
76− (fetchpatch {
77− name = "sig_on_in_matrix_misc.patch";
78− url = "https://git.sagemath.org/sage.git/patch?id=85d25bf2eb73f7d3c6de4ee6222b0c399be43b07";
79− sha256 = "1ciwhh57pnb9b4i8m3vb07wfsibsay5sg0jp5giq1pzc5zc79a4p";
80− })
8184 ];
8285
8386 # Patches needed because of package updates. We could just pin the versions of
@@ -110,52 +113,12 @@ stdenv.mkDerivation rec {
110113 stripLen = 1;
111114 })
112115
113− # https://trac.sagemath.org/ticket/26315
114− ./patches/giac-1.5.0.patch
115−
116− # https://trac.sagemath.org/ticket/26442
117− (fetchSageDiff {
118− name = "cypari2-2.0.3.patch";
119− base = "8.6.rc1";
120− rev = "cd62d45bcef93fb4f7ed62609a46135e6de07051";
121− sha256 = "08l2b9w0rn1zrha6188j72f7737xs126gkgmydjd31baa6367np2";
122− })
123−
124− # https://trac.sagemath.org/ticket/26949
125− (fetchpatch {
126− name = "sphinx-1.8.3-dependency.patch";
127− url = "https://git.sagemath.org/sage.git/patch?id=d305eda0fedc73fdbe0447b5d6d2b520b8d112c4";
128− sha256 = "1x3q5j8lq35vlj893gj5gq9fhzs60szm9r9rx6ri79yiy9apabph";
129− })
130116 # https://trac.sagemath.org/ticket/26451
131− (fetchpatch {
132− name = "sphinx-1.8.3.patch";
133− url = "https://git.sagemath.org/sage.git/patch?id2=0cb494282d7b4cea50aba7f4d100e7932a4c00b1&id=62b989d5ee1d9646db85ea56053cd22e9ffde5ab";
134− sha256 = "1n5c61mvhalcr2wbp66wzsynwwk59aakvx3xqa5zw9nlkx3rd0h1";
135− })
136−
137− # https://trac.sagemath.org/ticket/27061
138− (fetchpatch {
139− name = "numpy-1.16-inline-fortran.patch";
140− url = "https://git.sagemath.org/sage.git/patch?id=a05b6b038e1571ab15464e98f76d1927c0c3fd12";
141− sha256 = "05yq97pq84xi60wb1p9skrad5h5x770gq98ll4frr7hvvmlwsf58";
142− })
143−
144− # https://trac.sagemath.org/ticket/27405
145− ./patches/ignore-pip-deprecation.patch
146−
147− # https://trac.sagemath.org/ticket/27360
148− (fetchpatch {
149− name = "eclib-20190226.patch";
150− url = "https://git.sagemath.org/sage.git/patch/?id=f570e3a7fc2965764b84c04ce301a88ded2c42df";
151− sha256 = "0l5c4giixkn15v2a06sfzq5mkxila6l67zkjbacirwprrlpcnmmp";
152− })
153−
154− # https://trac.sagemath.org/ticket/27420
155− (fetchpatch {
156− name = "cypari-2.1.patch";
157− url = "https://git.sagemath.org/sage.git/patch/?id=e351bf2f2914e683d5e2028597c45ae8d1b7f855";
158− sha256 = "00faa7fl0vaqcqbw0bidkhl78qa8l34d3a07zirbcl0vm74bdn1p";
117+ (fetchSageDiff {
118+ name = "sphinx-1.8.patch";
119+ base = "8.7";
120+ rev = "737afd8f314bd1e16feaec562bb4b5efa2effa8b";
121+ sha256 = "0n56ss88ds662bp49j23z5c2i6hsn3jynxw13wv76hyl0h7l1hjh";
159122 })
160123
161124 # https://trac.sagemath.org/ticket/27653
@@ -177,6 +140,12 @@ stdenv.mkDerivation rec {
177140 echo '#!${runtimeShell}
178141 python "$@"' > build/bin/sage-python23
179142
143+ # Make sure sage can at least be imported without setting any environment
144+ # variables. It won't be close to feature complete though.
145+ sed -i \
146+ "s|var('SAGE_LOCAL',.*|var('SAGE_LOCAL', '$out/src')|" \
147+ src/sage/env.py
148+
180149 # Do not use sage-env-config (generated by ./configure).
181150 # Instead variables are set manually.
182151 echo '# do nothing' > src/bin/sage-env-config