···5757 );
5858in
5959stdenv.mkDerivation rec {
6060- version = "9.4";
6060+ version = "9.5";
6161 pname = "sage-src";
62626363 src = fetchFromGitHub {
6464 owner = "sagemath";
6565 repo = "sage";
6666 rev = version;
6767- sha256 = "sha256-jqkr4meG02KbTCMsGvyr1UbosS4ZuUJhPXU/InuS+9A=";
6767+ sha256 = "sha256-uOsLpsGpcIGs8Xr82X82MElnTB2E908gytyNJ8WVD5w=";
6868 };
69697070 # Patches needed because of particularities of nix or the way this is packaged.
7171 # The goal is to upstream all of them and get rid of this list.
7272 nixPatches = [
7373- # Make sure py2/py3 tests are only run when their expected context (all "sage"
7474- # tests) are also run. That is necessary to test dochtml individually. See
7575- # https://trac.sagemath.org/ticket/26110 for an upstream discussion.
7676- # TODO: Determine if it is still necessary.
7777- ./patches/Only-test-py2-py3-optional-tests-when-all-of-sage-is.patch
7373+ # Since https://trac.sagemath.org/ticket/32174, some external features are
7474+ # marked as "safe" and get auto-detected, in which case the corresponding
7575+ # optional tests are executed. We disable auto-detection of safe features if
7676+ # we are doctesting with an "--optional" argument which does not include
7777+ # "sage", because tests from autodetected features expect context provided
7878+ # by running basic sage tests. This is necessary to test sagemath_doc_html
7979+ # separately. See https://trac.sagemath.org/ticket/26110 for a related
8080+ # upstream discussion (from the time when Sage still had optional py2/py3
8181+ # tags).
8282+ ./patches/Only-test-external-software-when-all-of-sage-is.patch
78837984 # Fixes a potential race condition which can lead to transient doctest failures.
8085 ./patches/fix-ecl-race.patch
···117122 # Let's just assume warnings are expected until we update to 4.27.0.
118123 ./patches/fonttools-deprecation-warnings.patch
119124120120- # https://trac.sagemath.org/ticket/32305
121121- (fetchSageDiff {
122122- base = "9.4";
123123- name = "networkx-2.6-upgrade.patch";
124124- rev = "9808325853ba9eb035115e5b056305a1c9d362a0";
125125- sha256 = "sha256-gJSqycCtbAVr5qnVEbHFUvIuTOvaxFIeffpzd6nH4DE=";
126126- })
127127-128128- # https://trac.sagemath.org/ticket/32420
129129- (fetchSageDiff {
130130- base = "9.5.beta2";
131131- name = "sympy-1.9-update.patch";
132132- rev = "beed4e16aff32e47d0c3b1c58cb1e2f4c38590f8";
133133- sha256 = "sha256-3eJPfWfCrCAQ5filIn7FbzjRQeO9QyTIVl/HyRuqFtE=";
134134- })
135135-136136- # https://trac.sagemath.org/ticket/32567
137137- (fetchSageDiff {
138138- base = "9.5.beta2";
139139- name = "arb-2.21.0-update.patch";
140140- rev = "eb3304dd521a3d5a9334e747a08e234bbf16b4eb";
141141- sha256 = "sha256-XDkaY4VQGyESXI6zuD7nCNzyQOl/fmBFvAESH9+RRvk=";
142142- })
143143-144144- # https://trac.sagemath.org/ticket/32797
145145- (fetchSageDiff {
146146- base = "9.5.beta7";
147147- name = "pari-2.13.3-update.patch";
148148- rev = "f5f7a86908daf60b25e66e6a189c51ada7e0a732";
149149- sha256 = "sha256-H/caGx3q4KcdsyGe+ojV9bUTQ5y0siqM+QHgDbeEnbw=";
150150- })
151151-152152- # https://trac.sagemath.org/ticket/32909
153153- (fetchSageDiff {
154154- base = "9.5.beta7";
155155- name = "matplotlib-3.5-deprecation-warnings.patch";
156156- rev = "a5127dc56fdf5c2e82f6bc781cfe78dbd04e97b7";
157157- sha256 = "sha256-p23qUu9mgEUbdbX6cy7ArxZAtpcFjCKbgyxN4jWvj1o=";
158158- })
159159-160125 # https://trac.sagemath.org/ticket/32968
161126 (fetchSageDiff {
162127 base = "9.5.beta8";
···164129 rev = "fc84f82f52b6f05f512cb359ec7c100f93cf8841";
165130 sha256 = "sha256-bBbfdcnw/9LUOlY8rHJRbFJEdMXK4shosqTNaobTS1Q=";
166131 })
132132+133133+ # Upstream has not upgraded to linbox 1.7 yet because it conflicts with
134134+ # pre-4.2.1p3 versions of Singular, but we don't have this problem.
135135+ # https://trac.sagemath.org/ticket/32959
136136+ ./patches/linbox-1.7-upgrade.patch
167137 ];
168138169139 patches = nixPatches ++ bugfixPatches ++ packageUpgradePatches;
···1818, eclib
1919, ntl
2020, ecm
2121-, pynac
2221, pythonEnv
2322}:
2423···3635 blas lapack
3736 singular
3837 three
3939- pynac
4038 giac
4139 gap
4240 pari
···125123 # the scripts in src/bin will find the actual sage source files using environment variables set in `sage-env`
126124 cp -r src/bin "$out/bin"
127125 cp -r build/bin "$out/build/bin"
126126+127127+ # sage assumes the existence of sage-src-env-config.in means it's being executed in-tree. in this case, it
128128+ # adds SAGE_SRC/bin to PATH, breaking our wrappers
129129+ rm "$out/bin"/*.in "$out/build/bin"/*.in
128130129131 cp -f '${sage-env}/sage-env' "$out/bin/sage-env"
130132 substituteInPlace "$out/bin/sage-env" \
+2-1
pkgs/applications/science/math/sage/sage.nix
···62626363 meta = with lib; {
6464 description = "Open Source Mathematics Software, free alternative to Magma, Maple, Mathematica, and Matlab";
6565- license = licenses.gpl2;
6565+ homepage = "https://www.sagemath.org";
6666+ license = licenses.gpl2Plus;
6667 maintainers = teams.sage.members;
6768 };
6869}
···11{ stdenv, fetchFromGitHub, gmp, bison, perl, ncurses, readline, coreutils, pkg-config
22, lib
33-, fetchpatch
43, autoreconfHook
44+, buildPackages
55, sharutils
66, file
77, flint
···1111, lrcalc
1212, doxygen
1313, graphviz
1414+, latex2html
1415# upstream generates docs with texinfo 4. later versions of texinfo
1516# use letters instead of numbers for post-appendix chapters, and we
1617# want it to match the upstream format because sage depends on it.
···22232324stdenv.mkDerivation rec {
2425 pname = "singular";
2525- version = "4.2.0p2";
2626+ version = "4.3.0";
26272727- # since the tarball does not contain tests or documentation (and
2828- # there is no separate tests tarball for 4.2.0), we fetch from
2929- # GitHub.
2828+ # since the tarball does not contain tests, we fetch from GitHub.
3029 src = fetchFromGitHub {
3130 owner = "Singular";
3231 repo = "Singular";
33323434- # 4.2.0p2 is not tagged, but the tarball matches the commit below.
3535- rev = "6f68939ddf612d96e3caaaaa8275f77613ac1da8";
3636- sha256 = "sha256-BJNzYylzDqD/5YjzjxPRb/c96tYiuGy9Y+A7qf3ZSG8=";
3737-3838- # if a release is tagged it will be in the format below.
3939- # rev = "Release${lib.replaceStrings ["."] ["-"] version}";
3333+ # if a release is tagged (which sometimes does not happen), it will
3434+ # be in the format below.
3535+ # rev = "Release-${lib.replaceStrings ["."] ["-"] version}";
3636+ rev = "d895b0f1f543c61eb03adddad20f08655a419d4e";
3737+ sha256 = "sha256-c5Qr6VUuPKjfw8fowjJJz3oGAyUwo/K0WeMvU5djzVA=";
40384139 # the repository's .gitattributes file contains the lines "/Tst/
4240 # export-ignore" and "/doc/ export-ignore" so some directories are
4343- # not included in the tarball downloaded by fetchzip. setting
4444- # fetchSubmodules works around this by using fetchgit instead of
4545- # fetchzip.
4646- fetchSubmodules = true;
4141+ # not included in the tarball downloaded by fetchzip.
4242+ forceFetchGit = true;
4743 };
48444949- patches = [
5050- # fix timeouts when docbuilding with >= 64 cpus
5151- # https://github.com/Singular/Singular/issues/1117
5252- ./vspace-MAX_PROCESS.patch
5353-5454- # add aarch64 support to cpu-check.m4. copied from redhat.
5555- ./redhat-aarch64.patch
5656-5757- # the newest version of ax-prog-cc-for-build.m4 seems to trigger
5858- # linker errors. see
5959- # https://github.com/alsa-project/alsa-firmware/issues/3 for a
6060- # related issue.
6161- ./use-older-ax-prog-cc-for-build.patch
6262-6363- # https://github.com/Singular/Singular/issues/1086
6464- (fetchpatch {
6565- name = "schubert-lib-fails-with-too-many-cpus.patch";
6666- url = "https://github.com/Singular/Singular/commit/3cda50c00a849455efa2502e56596955491a353a.patch";
6767- sha256 = "sha256-fgYd+2vT32w5Ki8kKx6PfZn2e4QSJcYWOwEFXtc+lSA=";
6868- })
6969- ] ++ lib.optionals enableDocs [
7070- # singular supports building without 4ti2, bertini, normaliz or
7171- # topcom just fine, but the docbuilding does not skip manual pages
7272- # tagged as depending on those binaries (probably a bug in
7373- # doc2tex.pl::HandleLib, since it seems to ignore "-exclude"
7474- # argumens). skip them manually.
7575- ./disable-docs-for-optional-unpackaged-deps.patch
7676-7777- # fix some non-ascii characters in doc/decodegb.doc
7878- (fetchpatch {
7979- name = "decodegb-ascii.patch";
8080- url = "https://github.com/Singular/Singular/commit/36966d9009de572ee4dbc487f3e5744098fe91be.patch";
8181- sha256 = "sha256-9WcEov/oOQRC584ag6WVHFwY2aCjbM75HWyvZoEwppw=";
8282- })
8383- ];
8484-8545 configureFlags = [
8646 "--with-ntl=${ntl}"
8747 "--disable-pyobject-module"
···11474 ] ++ lib.optionals enableGfanlib [
11575 cddlib
11676 ];
7777+11778 nativeBuildInputs = [
11879 bison
11980 perl
···12384 ] ++ lib.optionals enableDocs [
12485 doxygen
12586 graphviz
8787+ latex2html
12688 texinfo4
12789 texlive.combined.scheme-small
12890 ];
9191+ depsBuildBuild = [ buildPackages.stdenv.cc ];
1299213093 preAutoreconf = ''
13194 find . -type f -readable -writable -exec sed \
···137100138101 hardeningDisable = lib.optional stdenv.isi686 "stackprotector";
139102140140- # The Makefile actually defaults to `make install` anyway
141141- buildPhase = ''
142142- # do nothing
143143- '';
144144-145103 doCheck = true; # very basic checks, does not test any libraries
146104147105 installPhase = ''
148148- mkdir -p "$out"
149149- cp -r Singular/LIB "$out/lib"
150106 make install
151107 '' + lib.optionalString enableDocs ''
152152- # Sage uses singular.hlp (which is not in the tarball)
108108+ # Sage uses singular.info, which is not installed by default
153109 mkdir -p $out/share/info
154154- cp doc/singular.hlp $out/share/info
110110+ cp doc/singular.info $out/share/info
155111 '' + ''
156112 # Make sure patchelf picks up the right libraries
157113 rm -rf libpolys factory resources omalloc Singular
···211167 license = licenses.gpl3; # Or GPLv2 at your option - but not GPLv4
212168 homepage = "http://www.singular.uni-kl.de";
213169 downloadPage = "http://www.mathematik.uni-kl.de/ftp/pub/Math/Singular/SOURCES/";
170170+ mainProgram = "Singular";
214171 };
215172}
···11-diff --git a/m4/cpu-check.m4 b/m4/cpu-check.m4
22-index 3cf0a7f08..12bb926ac 100644
33---- a/m4/cpu-check.m4
44-+++ b/m4/cpu-check.m4
55-@@ -37,6 +37,18 @@ if test "$ac_cv_singcpuname" = ppc; then
66- AC_DEFINE(SI_CPU_PPC,1,"PPC")
77- AC_SUBST(SI_CPU_PPC)
88- fi
99-+if test "$ac_cv_singcpuname" = arm -o "$ac_cv_singcpuname" = armel; then
1010-+ AC_DEFINE(SI_CPU_ARM,1,"ARM")
1111-+ AC_SUBST(SI_CPU_ARM)
1212-+fi
1313-+if test "$ac_cv_singcpuname" = aarch64; then
1414-+ AC_DEFINE(SI_CPU_AARCH64,1,"AARCH64")
1515-+ AC_SUBST(SI_CPU_AARCH64)
1616-+fi
1717-+if test "$ac_cv_singcpuname" = s390; then
1818-+ AC_DEFINE(SI_CPU_S390,1,"S390")
1919-+ AC_SUBST(SI_CPU_S390)
2020-+fi
2121-2222- # UNAME and PATH
2323- AC_MSG_CHECKING(uname for Singular)
2424-@@ -65,6 +77,14 @@ dnl testet on: ppc_Linux, 740/750 PowerMac G3, 512k L2 cache
2525- [powerpc*|ppc*], [AC_DEFINE(HAVE_GENERIC_MULT,1,multiplication is fast on the cpu: a*b is with mod otherwise using tables of logartihms)],
2626- dnl the following settings seems to be better on arm processors
2727- [arm*], [],
2828-+dnl FIXME: need to run some tests
2929-+ [aarch64*], [
3030-+ AC_DEFINE(HAVE_MULT_MOD,1,multiplication is fast on the cpu: a*b is with mod otherwise using tables of logartihms)
3131-+ AC_DEFINE(HAVE_GENERIC_ADD,1,use branch for addition in Z/p otherwise it uses a generic add)
3232-+ AC_DEFINE(HAVE_DIV_MOD,1,division using extend euclidian algorithm otherwise using tables of logartihms)
3333-+ ],
3434-+dnl FIXME: need to run some tests
3535-+ [s390*], [AC_DEFINE(HAVE_GENERIC_ADD,1,use branch for addition in Z/p otherwise it uses a generic add)],
3636- []
3737- )
3838-
···11-diff --git a/kernel/GBEngine/kChinese.cc b/kernel/GBEngine/kChinese.cc
22-index 829a66609..84655caf2 100644
33---- a/kernel/GBEngine/kChinese.cc
44-+++ b/kernel/GBEngine/kChinese.cc
55-@@ -209,6 +209,8 @@ ideal id_ChineseRemainder_0(ideal *xx, number *q, int rl, const ring r)
66- return NULL;
77- }
88- int cpus=(int)(long)feOptValue(FE_OPT_CPUS);
99-+ if (cpus>=vspace::internals::MAX_PROCESS)
1010-+ cpus=vspace::internals::MAX_PROCESS-1;
1111- if ((cpus==1) || (2*cpus>=cnt))
1212- /* at least 2 polys for each process, or switch to seriell version */
1313- return id_ChineseRemainder(xx,q,rl,r);
1414-@@ -295,6 +297,8 @@ ideal id_Farey_0(ideal x, number N, const ring r)
1515- {
1616- int cnt=IDELEMS(x)*x->nrows;
1717- int cpus=(int)(long)feOptValue(FE_OPT_CPUS);
1818-+ if (cpus>=vspace::internals::MAX_PROCESS)
1919-+ cpus=vspace::internals::MAX_PROCESS-1;
2020- if (2*cpus>=cnt) /* at least 2 polys for each process,
2121- or switch to seriell version */
2222- return id_Farey(x,N,r);
2323-diff --git a/kernel/GBEngine/kverify.cc b/kernel/GBEngine/kverify.cc
2424-index 909d84994..aa06d6624 100644
2525---- a/kernel/GBEngine/kverify.cc
2626-+++ b/kernel/GBEngine/kverify.cc
2727-@@ -176,6 +176,8 @@ BOOLEAN kVerify2(ideal F, ideal Q)
2828- /*---------------------------------------------------------------------*/
2929- BOOLEAN all_okay=TRUE;
3030- int cpus=(int)(long)feOptValue(FE_OPT_CPUS);
3131-+ if (cpus>=vspace::internals::MAX_PROCESS)
3232-+ cpus=vspace::internals::MAX_PROCESS-1;
3333- int parent_pid=getpid();
3434- using namespace vspace;
3535- vmem_init();
···5353 description = "Applies STAT information from a Stylespace to a variable font";
5454 homepage = "https://github.com/daltonmaag/statmake";
5555 license = licenses.mit;
5656+ maintainers = with maintainers; [ jtojnar ];
5657 };
5758}
···44 pname = "statix";
55 # also update version of the vim plugin in pkgs/misc/vim-plugins/overrides.nix
66 # the version can be found in flake.nix of the source code
77- version = "0.4.2";
77+ version = "0.5.2";
8899 src = fetchFromGitHub {
1010 owner = "nerdypepper";
1111 repo = pname;
1212 rev = "v${version}";
1313- sha256 = "sha256-4hVEwm2xuuHFy38/EJLKjGuxTYCAcKRHHfFKLvqp+M0=";
1313+ sha256 = "sha256-68ejROWcDqc4SnivFIrbsSZDqCXEo0sXSiwpro7AmgU=";
1414 };
15151616- cargoSha256 = "sha256-15C/ye8nYLtriBlqbf1ul41IFtShGY2LTX10z1/08Po=";
1616+ cargoSha256 = "sha256-YHA97bnGHYRwSZYZ3ZViUlRQskwLPUC26FBWQyBG5Uc=";
17171818 buildFeatures = lib.optional withJson "json";
1919