···57 );
58in
59stdenv.mkDerivation rec {
60- version = "9.4";
61 pname = "sage-src";
6263 src = fetchFromGitHub {
64 owner = "sagemath";
65 repo = "sage";
66 rev = version;
67- sha256 = "sha256-jqkr4meG02KbTCMsGvyr1UbosS4ZuUJhPXU/InuS+9A=";
68 };
6970 # Patches needed because of particularities of nix or the way this is packaged.
71 # The goal is to upstream all of them and get rid of this list.
72 nixPatches = [
73- # Make sure py2/py3 tests are only run when their expected context (all "sage"
74- # tests) are also run. That is necessary to test dochtml individually. See
75- # https://trac.sagemath.org/ticket/26110 for an upstream discussion.
76- # TODO: Determine if it is still necessary.
77- ./patches/Only-test-py2-py3-optional-tests-when-all-of-sage-is.patch
000007879 # Fixes a potential race condition which can lead to transient doctest failures.
80 ./patches/fix-ecl-race.patch
···117 # Let's just assume warnings are expected until we update to 4.27.0.
118 ./patches/fonttools-deprecation-warnings.patch
119120- # https://trac.sagemath.org/ticket/32305
121- (fetchSageDiff {
122- base = "9.4";
123- name = "networkx-2.6-upgrade.patch";
124- rev = "9808325853ba9eb035115e5b056305a1c9d362a0";
125- sha256 = "sha256-gJSqycCtbAVr5qnVEbHFUvIuTOvaxFIeffpzd6nH4DE=";
126- })
127-128- # https://trac.sagemath.org/ticket/32420
129- (fetchSageDiff {
130- base = "9.5.beta2";
131- name = "sympy-1.9-update.patch";
132- rev = "beed4e16aff32e47d0c3b1c58cb1e2f4c38590f8";
133- sha256 = "sha256-3eJPfWfCrCAQ5filIn7FbzjRQeO9QyTIVl/HyRuqFtE=";
134- })
135-136- # https://trac.sagemath.org/ticket/32567
137- (fetchSageDiff {
138- base = "9.5.beta2";
139- name = "arb-2.21.0-update.patch";
140- rev = "eb3304dd521a3d5a9334e747a08e234bbf16b4eb";
141- sha256 = "sha256-XDkaY4VQGyESXI6zuD7nCNzyQOl/fmBFvAESH9+RRvk=";
142- })
143-144- # https://trac.sagemath.org/ticket/32797
145- (fetchSageDiff {
146- base = "9.5.beta7";
147- name = "pari-2.13.3-update.patch";
148- rev = "f5f7a86908daf60b25e66e6a189c51ada7e0a732";
149- sha256 = "sha256-H/caGx3q4KcdsyGe+ojV9bUTQ5y0siqM+QHgDbeEnbw=";
150- })
151-152- # https://trac.sagemath.org/ticket/32909
153- (fetchSageDiff {
154- base = "9.5.beta7";
155- name = "matplotlib-3.5-deprecation-warnings.patch";
156- rev = "a5127dc56fdf5c2e82f6bc781cfe78dbd04e97b7";
157- sha256 = "sha256-p23qUu9mgEUbdbX6cy7ArxZAtpcFjCKbgyxN4jWvj1o=";
158- })
159-160 # https://trac.sagemath.org/ticket/32968
161 (fetchSageDiff {
162 base = "9.5.beta8";
···164 rev = "fc84f82f52b6f05f512cb359ec7c100f93cf8841";
165 sha256 = "sha256-bBbfdcnw/9LUOlY8rHJRbFJEdMXK4shosqTNaobTS1Q=";
166 })
00000167 ];
168169 patches = nixPatches ++ bugfixPatches ++ packageUpgradePatches;
···57 );
58in
59stdenv.mkDerivation rec {
60+ version = "9.5";
61 pname = "sage-src";
6263 src = fetchFromGitHub {
64 owner = "sagemath";
65 repo = "sage";
66 rev = version;
67+ sha256 = "sha256-uOsLpsGpcIGs8Xr82X82MElnTB2E908gytyNJ8WVD5w=";
68 };
6970 # Patches needed because of particularities of nix or the way this is packaged.
71 # The goal is to upstream all of them and get rid of this list.
72 nixPatches = [
73+ # Since https://trac.sagemath.org/ticket/32174, some external features are
74+ # marked as "safe" and get auto-detected, in which case the corresponding
75+ # optional tests are executed. We disable auto-detection of safe features if
76+ # we are doctesting with an "--optional" argument which does not include
77+ # "sage", because tests from autodetected features expect context provided
78+ # by running basic sage tests. This is necessary to test sagemath_doc_html
79+ # separately. See https://trac.sagemath.org/ticket/26110 for a related
80+ # upstream discussion (from the time when Sage still had optional py2/py3
81+ # tags).
82+ ./patches/Only-test-external-software-when-all-of-sage-is.patch
8384 # Fixes a potential race condition which can lead to transient doctest failures.
85 ./patches/fix-ecl-race.patch
···122 # Let's just assume warnings are expected until we update to 4.27.0.
123 ./patches/fonttools-deprecation-warnings.patch
1240000000000000000000000000000000000000000125 # https://trac.sagemath.org/ticket/32968
126 (fetchSageDiff {
127 base = "9.5.beta8";
···129 rev = "fc84f82f52b6f05f512cb359ec7c100f93cf8841";
130 sha256 = "sha256-bBbfdcnw/9LUOlY8rHJRbFJEdMXK4shosqTNaobTS1Q=";
131 })
132+133+ # Upstream has not upgraded to linbox 1.7 yet because it conflicts with
134+ # pre-4.2.1p3 versions of Singular, but we don't have this problem.
135+ # https://trac.sagemath.org/ticket/32959
136+ ./patches/linbox-1.7-upgrade.patch
137 ];
138139 patches = nixPatches ++ bugfixPatches ++ packageUpgradePatches;
···18, eclib
19, ntl
20, ecm
21-, pynac
22, pythonEnv
23}:
24···36 blas lapack
37 singular
38 three
39- pynac
40 giac
41 gap
42 pari
···125 # the scripts in src/bin will find the actual sage source files using environment variables set in `sage-env`
126 cp -r src/bin "$out/bin"
127 cp -r build/bin "$out/build/bin"
0000128129 cp -f '${sage-env}/sage-env' "$out/bin/sage-env"
130 substituteInPlace "$out/bin/sage-env" \
···18, eclib
19, ntl
20, ecm
021, pythonEnv
22}:
23···35 blas lapack
36 singular
37 three
038 giac
39 gap
40 pari
···123 # the scripts in src/bin will find the actual sage source files using environment variables set in `sage-env`
124 cp -r src/bin "$out/bin"
125 cp -r build/bin "$out/build/bin"
126+127+ # sage assumes the existence of sage-src-env-config.in means it's being executed in-tree. in this case, it
128+ # adds SAGE_SRC/bin to PATH, breaking our wrappers
129+ rm "$out/bin"/*.in "$out/build/bin"/*.in
130131 cp -f '${sage-env}/sage-env' "$out/bin/sage-env"
132 substituteInPlace "$out/bin/sage-env" \
+2-1
pkgs/applications/science/math/sage/sage.nix
···6263 meta = with lib; {
64 description = "Open Source Mathematics Software, free alternative to Magma, Maple, Mathematica, and Matlab";
65- license = licenses.gpl2;
066 maintainers = teams.sage.members;
67 };
68}
···6263 meta = with lib; {
64 description = "Open Source Mathematics Software, free alternative to Magma, Maple, Mathematica, and Matlab";
65+ homepage = "https://www.sagemath.org";
66+ license = licenses.gpl2Plus;
67 maintainers = teams.sage.members;
68 };
69}
···1{ stdenv, fetchFromGitHub, gmp, bison, perl, ncurses, readline, coreutils, pkg-config
2, lib
3-, fetchpatch
4, autoreconfHook
05, sharutils
6, file
7, flint
···11, lrcalc
12, doxygen
13, graphviz
014# upstream generates docs with texinfo 4. later versions of texinfo
15# use letters instead of numbers for post-appendix chapters, and we
16# want it to match the upstream format because sage depends on it.
···2223stdenv.mkDerivation rec {
24 pname = "singular";
25- version = "4.2.0p2";
2627- # since the tarball does not contain tests or documentation (and
28- # there is no separate tests tarball for 4.2.0), we fetch from
29- # GitHub.
30 src = fetchFromGitHub {
31 owner = "Singular";
32 repo = "Singular";
3334- # 4.2.0p2 is not tagged, but the tarball matches the commit below.
35- rev = "6f68939ddf612d96e3caaaaa8275f77613ac1da8";
36- sha256 = "sha256-BJNzYylzDqD/5YjzjxPRb/c96tYiuGy9Y+A7qf3ZSG8=";
37-38- # if a release is tagged it will be in the format below.
39- # rev = "Release${lib.replaceStrings ["."] ["-"] version}";
4041 # the repository's .gitattributes file contains the lines "/Tst/
42 # export-ignore" and "/doc/ export-ignore" so some directories are
43- # not included in the tarball downloaded by fetchzip. setting
44- # fetchSubmodules works around this by using fetchgit instead of
45- # fetchzip.
46- fetchSubmodules = true;
47 };
4849- patches = [
50- # fix timeouts when docbuilding with >= 64 cpus
51- # https://github.com/Singular/Singular/issues/1117
52- ./vspace-MAX_PROCESS.patch
53-54- # add aarch64 support to cpu-check.m4. copied from redhat.
55- ./redhat-aarch64.patch
56-57- # the newest version of ax-prog-cc-for-build.m4 seems to trigger
58- # linker errors. see
59- # https://github.com/alsa-project/alsa-firmware/issues/3 for a
60- # related issue.
61- ./use-older-ax-prog-cc-for-build.patch
62-63- # https://github.com/Singular/Singular/issues/1086
64- (fetchpatch {
65- name = "schubert-lib-fails-with-too-many-cpus.patch";
66- url = "https://github.com/Singular/Singular/commit/3cda50c00a849455efa2502e56596955491a353a.patch";
67- sha256 = "sha256-fgYd+2vT32w5Ki8kKx6PfZn2e4QSJcYWOwEFXtc+lSA=";
68- })
69- ] ++ lib.optionals enableDocs [
70- # singular supports building without 4ti2, bertini, normaliz or
71- # topcom just fine, but the docbuilding does not skip manual pages
72- # tagged as depending on those binaries (probably a bug in
73- # doc2tex.pl::HandleLib, since it seems to ignore "-exclude"
74- # argumens). skip them manually.
75- ./disable-docs-for-optional-unpackaged-deps.patch
76-77- # fix some non-ascii characters in doc/decodegb.doc
78- (fetchpatch {
79- name = "decodegb-ascii.patch";
80- url = "https://github.com/Singular/Singular/commit/36966d9009de572ee4dbc487f3e5744098fe91be.patch";
81- sha256 = "sha256-9WcEov/oOQRC584ag6WVHFwY2aCjbM75HWyvZoEwppw=";
82- })
83- ];
84-85 configureFlags = [
86 "--with-ntl=${ntl}"
87 "--disable-pyobject-module"
···114 ] ++ lib.optionals enableGfanlib [
115 cddlib
116 ];
0117 nativeBuildInputs = [
118 bison
119 perl
···123 ] ++ lib.optionals enableDocs [
124 doxygen
125 graphviz
0126 texinfo4
127 texlive.combined.scheme-small
128 ];
0129130 preAutoreconf = ''
131 find . -type f -readable -writable -exec sed \
···137138 hardeningDisable = lib.optional stdenv.isi686 "stackprotector";
139140- # The Makefile actually defaults to `make install` anyway
141- buildPhase = ''
142- # do nothing
143- '';
144-145 doCheck = true; # very basic checks, does not test any libraries
146147 installPhase = ''
148- mkdir -p "$out"
149- cp -r Singular/LIB "$out/lib"
150 make install
151 '' + lib.optionalString enableDocs ''
152- # Sage uses singular.hlp (which is not in the tarball)
153 mkdir -p $out/share/info
154- cp doc/singular.hlp $out/share/info
155 '' + ''
156 # Make sure patchelf picks up the right libraries
157 rm -rf libpolys factory resources omalloc Singular
···211 license = licenses.gpl3; # Or GPLv2 at your option - but not GPLv4
212 homepage = "http://www.singular.uni-kl.de";
213 downloadPage = "http://www.mathematik.uni-kl.de/ftp/pub/Math/Singular/SOURCES/";
0214 };
215}
···1{ stdenv, fetchFromGitHub, gmp, bison, perl, ncurses, readline, coreutils, pkg-config
2, lib
03, autoreconfHook
4+, buildPackages
5, sharutils
6, file
7, flint
···11, lrcalc
12, doxygen
13, graphviz
14+, latex2html
15# upstream generates docs with texinfo 4. later versions of texinfo
16# use letters instead of numbers for post-appendix chapters, and we
17# want it to match the upstream format because sage depends on it.
···2324stdenv.mkDerivation rec {
25 pname = "singular";
26+ version = "4.3.0";
2728+ # since the tarball does not contain tests, we fetch from GitHub.
0029 src = fetchFromGitHub {
30 owner = "Singular";
31 repo = "Singular";
3233+ # if a release is tagged (which sometimes does not happen), it will
34+ # be in the format below.
35+ # rev = "Release-${lib.replaceStrings ["."] ["-"] version}";
36+ rev = "d895b0f1f543c61eb03adddad20f08655a419d4e";
37+ sha256 = "sha256-c5Qr6VUuPKjfw8fowjJJz3oGAyUwo/K0WeMvU5djzVA=";
03839 # the repository's .gitattributes file contains the lines "/Tst/
40 # export-ignore" and "/doc/ export-ignore" so some directories are
41+ # not included in the tarball downloaded by fetchzip.
42+ forceFetchGit = true;
0043 };
4400000000000000000000000000000000000045 configureFlags = [
46 "--with-ntl=${ntl}"
47 "--disable-pyobject-module"
···74 ] ++ lib.optionals enableGfanlib [
75 cddlib
76 ];
77+78 nativeBuildInputs = [
79 bison
80 perl
···84 ] ++ lib.optionals enableDocs [
85 doxygen
86 graphviz
87+ latex2html
88 texinfo4
89 texlive.combined.scheme-small
90 ];
91+ depsBuildBuild = [ buildPackages.stdenv.cc ];
9293 preAutoreconf = ''
94 find . -type f -readable -writable -exec sed \
···100101 hardeningDisable = lib.optional stdenv.isi686 "stackprotector";
10200000103 doCheck = true; # very basic checks, does not test any libraries
104105 installPhase = ''
00106 make install
107 '' + lib.optionalString enableDocs ''
108+ # Sage uses singular.info, which is not installed by default
109 mkdir -p $out/share/info
110+ cp doc/singular.info $out/share/info
111 '' + ''
112 # Make sure patchelf picks up the right libraries
113 rm -rf libpolys factory resources omalloc Singular
···167 license = licenses.gpl3; # Or GPLv2 at your option - but not GPLv4
168 homepage = "http://www.singular.uni-kl.de";
169 downloadPage = "http://www.mathematik.uni-kl.de/ftp/pub/Math/Singular/SOURCES/";
170+ mainProgram = "Singular";
171 };
172}
···1-diff --git a/m4/cpu-check.m4 b/m4/cpu-check.m4
2-index 3cf0a7f08..12bb926ac 100644
3---- a/m4/cpu-check.m4
4-+++ b/m4/cpu-check.m4
5-@@ -37,6 +37,18 @@ if test "$ac_cv_singcpuname" = ppc; then
6- AC_DEFINE(SI_CPU_PPC,1,"PPC")
7- AC_SUBST(SI_CPU_PPC)
8- fi
9-+if test "$ac_cv_singcpuname" = arm -o "$ac_cv_singcpuname" = armel; then
10-+ AC_DEFINE(SI_CPU_ARM,1,"ARM")
11-+ AC_SUBST(SI_CPU_ARM)
12-+fi
13-+if test "$ac_cv_singcpuname" = aarch64; then
14-+ AC_DEFINE(SI_CPU_AARCH64,1,"AARCH64")
15-+ AC_SUBST(SI_CPU_AARCH64)
16-+fi
17-+if test "$ac_cv_singcpuname" = s390; then
18-+ AC_DEFINE(SI_CPU_S390,1,"S390")
19-+ AC_SUBST(SI_CPU_S390)
20-+fi
21-22- # UNAME and PATH
23- AC_MSG_CHECKING(uname for Singular)
24-@@ -65,6 +77,14 @@ dnl testet on: ppc_Linux, 740/750 PowerMac G3, 512k L2 cache
25- [powerpc*|ppc*], [AC_DEFINE(HAVE_GENERIC_MULT,1,multiplication is fast on the cpu: a*b is with mod otherwise using tables of logartihms)],
26- dnl the following settings seems to be better on arm processors
27- [arm*], [],
28-+dnl FIXME: need to run some tests
29-+ [aarch64*], [
30-+ AC_DEFINE(HAVE_MULT_MOD,1,multiplication is fast on the cpu: a*b is with mod otherwise using tables of logartihms)
31-+ AC_DEFINE(HAVE_GENERIC_ADD,1,use branch for addition in Z/p otherwise it uses a generic add)
32-+ AC_DEFINE(HAVE_DIV_MOD,1,division using extend euclidian algorithm otherwise using tables of logartihms)
33-+ ],
34-+dnl FIXME: need to run some tests
35-+ [s390*], [AC_DEFINE(HAVE_GENERIC_ADD,1,use branch for addition in Z/p otherwise it uses a generic add)],
36- []
37- )
38-
···1-diff --git a/kernel/GBEngine/kChinese.cc b/kernel/GBEngine/kChinese.cc
2-index 829a66609..84655caf2 100644
3---- a/kernel/GBEngine/kChinese.cc
4-+++ b/kernel/GBEngine/kChinese.cc
5-@@ -209,6 +209,8 @@ ideal id_ChineseRemainder_0(ideal *xx, number *q, int rl, const ring r)
6- return NULL;
7- }
8- int cpus=(int)(long)feOptValue(FE_OPT_CPUS);
9-+ if (cpus>=vspace::internals::MAX_PROCESS)
10-+ cpus=vspace::internals::MAX_PROCESS-1;
11- if ((cpus==1) || (2*cpus>=cnt))
12- /* at least 2 polys for each process, or switch to seriell version */
13- return id_ChineseRemainder(xx,q,rl,r);
14-@@ -295,6 +297,8 @@ ideal id_Farey_0(ideal x, number N, const ring r)
15- {
16- int cnt=IDELEMS(x)*x->nrows;
17- int cpus=(int)(long)feOptValue(FE_OPT_CPUS);
18-+ if (cpus>=vspace::internals::MAX_PROCESS)
19-+ cpus=vspace::internals::MAX_PROCESS-1;
20- if (2*cpus>=cnt) /* at least 2 polys for each process,
21- or switch to seriell version */
22- return id_Farey(x,N,r);
23-diff --git a/kernel/GBEngine/kverify.cc b/kernel/GBEngine/kverify.cc
24-index 909d84994..aa06d6624 100644
25---- a/kernel/GBEngine/kverify.cc
26-+++ b/kernel/GBEngine/kverify.cc
27-@@ -176,6 +176,8 @@ BOOLEAN kVerify2(ideal F, ideal Q)
28- /*---------------------------------------------------------------------*/
29- BOOLEAN all_okay=TRUE;
30- int cpus=(int)(long)feOptValue(FE_OPT_CPUS);
31-+ if (cpus>=vspace::internals::MAX_PROCESS)
32-+ cpus=vspace::internals::MAX_PROCESS-1;
33- int parent_pid=getpid();
34- using namespace vspace;
35- vmem_init();
···53 description = "Applies STAT information from a Stylespace to a variable font";
54 homepage = "https://github.com/daltonmaag/statmake";
55 license = licenses.mit;
056 };
57}
···53 description = "Applies STAT information from a Stylespace to a variable font";
54 homepage = "https://github.com/daltonmaag/statmake";
55 license = licenses.mit;
56+ maintainers = with maintainers; [ jtojnar ];
57 };
58}
···4 pname = "statix";
5 # also update version of the vim plugin in pkgs/misc/vim-plugins/overrides.nix
6 # the version can be found in flake.nix of the source code
7- version = "0.4.2";
89 src = fetchFromGitHub {
10 owner = "nerdypepper";
11 repo = pname;
12 rev = "v${version}";
13- sha256 = "sha256-4hVEwm2xuuHFy38/EJLKjGuxTYCAcKRHHfFKLvqp+M0=";
14 };
1516- cargoSha256 = "sha256-15C/ye8nYLtriBlqbf1ul41IFtShGY2LTX10z1/08Po=";
1718 buildFeatures = lib.optional withJson "json";
19
···4 pname = "statix";
5 # also update version of the vim plugin in pkgs/misc/vim-plugins/overrides.nix
6 # the version can be found in flake.nix of the source code
7+ version = "0.5.2";
89 src = fetchFromGitHub {
10 owner = "nerdypepper";
11 repo = pname;
12 rev = "v${version}";
13+ sha256 = "sha256-68ejROWcDqc4SnivFIrbsSZDqCXEo0sXSiwpro7AmgU=";
14 };
1516+ cargoSha256 = "sha256-YHA97bnGHYRwSZYZ3ZViUlRQskwLPUC26FBWQyBG5Uc=";
1718 buildFeatures = lib.optional withJson "json";
19