From 79046fb4f82cf32414a17b31d8290bf76cd28c1f Mon Sep 17 00:00:00 2001 From: Mauricio Collares Date: Sat, 3 Apr 2021 15:29:01 -0300 Subject: [PATCH 01/40] gap: 4.10.2 -> 4.11.0 --- .../applications/science/math/gap/default.nix | 31 ++++++------------- 1 file changed, 10 insertions(+), 21 deletions(-) diff --git a/pkgs/applications/science/math/gap/default.nix b/pkgs/applications/science/math/gap/default.nix index ce93c14b334..3b3d8a58b56 100644 --- a/pkgs/applications/science/math/gap/default.nix +++ b/pkgs/applications/science/math/gap/default.nix @@ -5,6 +5,7 @@ , makeWrapper , readline , gmp +, zlib # one of # - "minimal" (~400M): # Install the bare minimum of packages required by gap to start. @@ -61,11 +62,11 @@ in stdenv.mkDerivation rec { pname = "gap"; # https://www.gap-system.org/Releases/ - version = "4.10.2"; + version = "4.11.0"; src = fetchurl { url = "https://files.gap-system.org/gap-${lib.versions.major version}.${lib.versions.minor version}/tar.bz2/gap-${version}.tar.bz2"; - sha256 = "0cp6ddk0469zzv1m1vair6gm27ic6c5m77ri8rn0znq3gaps6x94"; + sha256 = "sha256-vwcKENwqxgWT/mXfD4c9ctTWdQHobrJipva9SPyGhgI="; }; # remove all non-essential packages (which take up a lot of space) @@ -76,6 +77,7 @@ stdenv.mkDerivation rec { buildInputs = [ readline gmp + zlib ]; nativeBuildInputs = [ @@ -83,34 +85,22 @@ stdenv.mkDerivation rec { ]; patches = [ - # https://github.com/gap-system/gap/pull/3294 - (fetchpatch { - name = "add-make-install-targets.patch"; - url = "https://github.com/gap-system/gap/commit/3361c172e6c5ff3bb3f01ba9d6f1dd4ad42cea80.patch"; - sha256 = "1kwp9qnfvmlbpf1c3rs6j5m2jz22rj7a4hb5x1gj9vkpiyn5pdyj"; - }) - # Fix for locale specific tests causing issues. Already upstream. # Backport of https://github.com/gap-system/gap/pull/4022 - # WHEN REMOVING: also remove the`rm tst/testinstall/strings.tst` line in - # `postPatch` below. That line is necessary since the patch is not intended - # for gap 4.10. (fetchpatch { name = "remove-locale-specific-tests.patch"; url = "https://github.com/gap-system/gap/commit/c18b0c4215b5212a2cc4f305e2d5b94ba716bee8.patch"; - excludes = ["tst/testinstall/stringobj.tst"]; - sha256 = "1mz5b4mbw2jdd1ypp5s0dy6pp0jsvwsxr2dm4kbkls20r1r192sc"; + sha256 = "sha256-De+T9Y7ewRT6plJrj2VR8axRvD/JCTYKOBWB7Bw0oq0="; }) # fixes aarch64 gc crashes: https://github.com/gap-system/gap/pull/3965 - ./mark-genstackfuncbags-as-noinline.patch + (fetchpatch { + name = "mark-genstackfuncbags-as-noinline.patch"; + url = "https://github.com/gap-system/gap/commit/f0a8f49ff8dad0a5fa77253d45457c6f40f96778.patch"; + sha256 = "sha256-GU9tOP1stX2vn8m8kXOBupEpxIYArA76ibKL8eLn0MY="; + }) ]; - postPatch = '' - # File not covered by the remove-locale-specific-tests.patch patch above. - rm tst/testinstall/strings.tst - ''; - # "teststandard" is a superset of testinstall. It takes ~1h instead of ~1min. # tests are run twice, once with all packages loaded and once without # checkTarget = "teststandard"; @@ -155,7 +145,6 @@ stdenv.mkDerivation rec { mkdir -p "$out/bin" "$out/share/gap/" - mkdir -p "$out/share/gap" echo "Copying files to target directory" cp -ar . "$out/share/gap/build-dir" From cd215e793a0d78ae35b4a5feacaea54af178d037 Mon Sep 17 00:00:00 2001 From: Mauricio Collares Date: Sat, 3 Apr 2021 19:10:27 -0300 Subject: [PATCH 02/40] pynac: 0.7.26 -> 0.7.27 --- .../science/math/pynac/default.nix | 34 +++++++++++++------ 1 file changed, 23 insertions(+), 11 deletions(-) diff --git a/pkgs/applications/science/math/pynac/default.nix b/pkgs/applications/science/math/pynac/default.nix index 00d35b491d6..9cdcd2b9ea3 100644 --- a/pkgs/applications/science/math/pynac/default.nix +++ b/pkgs/applications/science/math/pynac/default.nix @@ -1,6 +1,6 @@ { lib, stdenv , fetchFromGitHub -, fetchurl +, fetchpatch , autoreconfHook , pkg-config , flint @@ -11,16 +11,36 @@ }: stdenv.mkDerivation rec { - version = "0.7.26"; + version = "0.7.27"; pname = "pynac"; src = fetchFromGitHub { owner = "pynac"; repo = "pynac"; rev = "pynac-${version}"; - sha256 = "09d2p74x1arkydlxy6pw4p4byi7r8q7f29w373h4d8a215kadc6d"; + sha256 = "sha256-1HHCIeaNE2UsJNX92UlDGLJS8I4nC/8FnwX7Y4F9HpU="; }; + patches = [ + (fetchpatch { + name = "handle_factor.patch"; + url = "https://git.sagemath.org/sage.git/plain/build/pkgs/pynac/patches/handle_factor.patch?h=9.3.rc3"; + sha256 = "sha256-U1lb5qwBqZZgklfDMhBX4K5u8bz5x42O4w7hyNy2YVw="; + }) + + (fetchpatch { + name = "power_inf_loop.patch"; + url = "https://git.sagemath.org/sage.git/plain/build/pkgs/pynac/patches/power_inf_loop.patch?h=9.3.rc3"; + sha256 = "sha256-VYeaJl8u2wl7FQ/6xnpZv1KpdNYEmJoPhuMrBADyTRs="; + }) + + (fetchpatch { + name = "too_much_sub.patch"; + url = "https://git.sagemath.org/sage.git/plain/build/pkgs/pynac/patches/too_much_sub.patch?h=9.3.rc3"; + sha256 = "sha256-lw7xSQ/l+rzPu+ghWF4omYF0mKksGGPuuHJTktvbdis="; + }) + ]; + buildInputs = [ flint gmp @@ -34,14 +54,6 @@ stdenv.mkDerivation rec { pkg-config ]; - patches = [ - (fetchurl { - name = "py_ssize_t_clean.patch"; - url = "https://git.sagemath.org/sage.git/plain/build/pkgs/pynac/patches/py_ssize_t_clean.patch?h=9.2"; - sha256 = "0l3gbg9hc4v671zf4w376krnk3wh8hj3649610nlvzzxckcryzab"; - }) - ]; - meta = with lib; { description = "Python is Not a CAS -- modified version of Ginac"; longDescription = '' From 4d56f7c18ad3303c4a6e7021228a4d2df9954a00 Mon Sep 17 00:00:00 2001 From: Mauricio Collares Date: Fri, 16 Apr 2021 10:25:33 -0300 Subject: [PATCH 03/40] graphs: 20161026 -> 20210214 --- pkgs/data/misc/graphs/default.nix | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pkgs/data/misc/graphs/default.nix b/pkgs/data/misc/graphs/default.nix index 54b6c16613e..19438d83566 100644 --- a/pkgs/data/misc/graphs/default.nix +++ b/pkgs/data/misc/graphs/default.nix @@ -4,11 +4,13 @@ stdenv.mkDerivation rec { pname = "graphs"; - version = "20161026"; + version = "20210214"; src = fetchurl { - url = "mirror://sageupstream/${pname}/${pname}-${version}.tar.bz2"; - sha256 = "0a2b5lly9nifphvknz88rrhfbbc8vqnlqcv19zdpfq8h8nnyjbb2"; + url = "https://mirrors.mit.edu/sage/spkg/upstream/${pname}/${pname}-${version}.tar.bz2"; + # TODO: switch to the url below once Sage 9.3 is released + # url = "mirror://sageupstream/${pname}/${pname}-${version}.tar.bz2"; + sha256 = "sha256-ByN8DZhTYRUFw4n9e7klAMh0P1YxurtND0Xf2DMvN0E="; }; installPhase = '' From ceaf48fdb215b131a4c9deeafcdaaa1370238ea2 Mon Sep 17 00:00:00 2001 From: Timo Kaufmann Date: Fri, 3 Aug 2018 15:03:55 +0200 Subject: [PATCH 04/40] singular: 4.1.1p2 -> 4.2.0p2 Adds proper tests. Also removes the "enableFactory" option because singular actually enables factory by default and explicitly disabling it breaks the build. So the option was never really available. --- .../science/math/singular/default.nix | 139 ++++++++++++++---- ...le-docs-for-optional-unpackaged-deps.patch | 112 ++++++++++++++ 2 files changed, 219 insertions(+), 32 deletions(-) create mode 100644 pkgs/applications/science/math/singular/disable-docs-for-optional-unpackaged-deps.patch diff --git a/pkgs/applications/science/math/singular/default.nix b/pkgs/applications/science/math/singular/default.nix index fad05099a73..add89c95a0c 100644 --- a/pkgs/applications/science/math/singular/default.nix +++ b/pkgs/applications/science/math/singular/default.nix @@ -1,57 +1,84 @@ -{ stdenv, fetchurl, gmp, bison, perl, ncurses, readline, coreutils, pkg-config +{ stdenv, fetchFromGitHub, gmp, bison, perl, ncurses, readline, coreutils, pkg-config , lib , fetchpatch -, autoreconfHook +, autoreconfHook269 +, sharutils , file , flint , ntl , cddlib -, enableFactory ? true +, gfan +, lrcalc +, doxygen +, graphviz +# upstream generates docs with texinfo 4. later versions of texinfo +# use letters instead of numbers for post-appendix chapters, and we +# want it to match the upstream format because sage depends on it. +, texinfo4 +, texlive +, enableDocs ? true , enableGfanlib ? true }: stdenv.mkDerivation rec { pname = "singular"; - version = "4.1.1p2"; + version = "4.2.0p2"; - src = let - # singular sorts its tarballs in directories by base release (without patch version) - # for example 4.1.1p1 will be in the directory 4-1-1 - baseVersion = builtins.head (lib.splitString "p" version); - urlVersion = builtins.replaceStrings [ "." ] [ "-" ] baseVersion; - in - fetchurl { - url = "http://www.mathematik.uni-kl.de/ftp/pub/Math/Singular/SOURCES/${urlVersion}/singular-${version}.tar.gz"; - sha256 = "07x9kri8vl4galik7lr6pscq3c51n8570pyw64i7gbj0m706f7wf"; + # since the tarball does not contain tests or documentation (and + # there is no separate tests tarball for 4.2.0), we fetch from + # GitHub. + src = fetchFromGitHub { + owner = "Singular"; + repo = "Singular"; + + # 4.2.0p2 is not tagged, but the tarball matches commit + # 6f68939ddf612d96e3caaaaa8275f77613ac1da8. the commit below has + # two extra fixes. + rev = "3cda50c00a849455efa2502e56596955491a353a"; + sha256 = "sha256-OizPhGE6L2LTOrKfeDdDB6BSdvYkDVXvbbYjV14hnHM="; + + # if a release is tagged it will be in the format below. + # rev = "Release${lib.replaceStrings ["."] ["-"] version}"; + + # the repository's .gitattributes file contains the lines "/Tst/ + # export-ignore" and "/doc/ export-ignore" so some directories are + # not included in the tarball downloaded by fetchzip. setting + # fetchSubmodules works around this by using fetchgit instead of + # fetchzip. + fetchSubmodules = true; }; + patches = lib.optionals enableDocs [ + # singular supports building without 4ti2, bertini, normaliz or + # topcom just fine, but the docbuilding does not skip manual pages + # tagged as depending on those binaries (probably a bug in + # doc2tex.pl::HandleLib, since it seems to ignore "-exclude" + # argumens). skip them manually. + ./disable-docs-for-optional-unpackaged-deps.patch + ]; + configureFlags = [ "--with-ntl=${ntl}" - ] ++ lib.optionals enableFactory [ - "--enable-factory" + "--disable-pyobject-module" + ] ++ lib.optionals enableDocs [ + "--enable-doc-build" ] ++ lib.optionals enableGfanlib [ "--enable-gfanlib" ]; - postUnpack = '' + prePatch = '' + # don't let the tests depend on `hostname` + substituteInPlace Tst/regress.cmd --replace 'mysystem_catch("hostname")' 'nix_test_runner' + patchShebangs . + '' + lib.optionalString enableDocs '' + # work around encoding problem + sed -i -e 's/\xb7/@cdot{}/g' doc/decodegb.doc ''; - patches = [ - # NTL error handler was introduced in the library part, preventing users of - # the library from implementing their own error handling - # https://www.singular.uni-kl.de/forum/viewtopic.php?t=2769 - (fetchpatch { - name = "move_error_handler_out_of_libsingular.patch"; - # rebased version of https://github.com/Singular/Sources/commit/502cf86d0bb2a96715be6764774b64a69c1ca34c.patch - url = "https://git.sagemath.org/sage.git/plain/build/pkgs/singular/patches/singular-ntl-error-handler.patch?h=50b9ae2fd233c30860e1cbb3e63a26f2cc10560a"; - sha256 = "0vgh4m9zn1kjl0br68n04j4nmn5i1igfn28cph0chnwf7dvr9194"; - }) - ]; - # For reference (last checked on commit 75f460d): - # https://github.com/Singular/Sources/blob/spielwiese/doc/Building-Singular-from-source.md - # https://github.com/Singular/Sources/blob/spielwiese/doc/external-packages-dynamic-modules.md + # https://github.com/Singular/Singular/blob/spielwiese/doc/Building-Singular-from-source.md + # https://github.com/Singular/Singular/blob/spielwiese/doc/external-packages-dynamic-modules.md buildInputs = [ # necessary gmp @@ -60,6 +87,8 @@ stdenv.mkDerivation rec { readline ntl flint + lrcalc + gfan ] ++ lib.optionals enableGfanlib [ cddlib ]; @@ -67,7 +96,13 @@ stdenv.mkDerivation rec { bison perl pkg-config - autoreconfHook + autoreconfHook269 + sharutils # needed for regress.cmd install checks + ] ++ lib.optionals enableDocs [ + doxygen + graphviz + texinfo4 + texlive.combined.scheme-small ]; preAutoreconf = '' @@ -85,23 +120,62 @@ stdenv.mkDerivation rec { # do nothing ''; + doCheck = true; # very basic checks, does not test any libraries + installPhase = '' mkdir -p "$out" cp -r Singular/LIB "$out/lib" make install - + '' + lib.optionalString enableDocs '' + # Sage uses singular.hlp (which is not in the tarball) + mkdir -p $out/share/info + cp doc/singular.hlp $out/share/info + '' + '' # Make sure patchelf picks up the right libraries rm -rf libpolys factory resources omalloc Singular ''; + # singular tests are a bit complicated, see + # https://github.com/Singular/Singular/tree/spielwiese/Tst + # https://www.singular.uni-kl.de/forum/viewtopic.php&t=2773 + testsToRun = [ + "Old/universal.lst" + "Buch/buch.lst" + "Plural/short.lst" + "Old/factor.tst" + ] ++ lib.optionals enableGfanlib [ + # tests that require gfanlib + "Short/ok_s.lst" + ]; + # simple test to make sure singular starts and finds its libraries doInstallCheck = true; installCheckPhase = '' + # Very basic sanity check to make sure singular starts and finds its libraries. + # This is redundant with the below tests. It is only kept because the singular test + # runner is a bit complicated. In case we decide to give up those tests in the future, + # this will still be useful. It takes barely any time. "$out/bin/Singular" -c 'LIB "freegb.lib"; exit;' if [ $? -ne 0 ]; then echo >&2 "Error loading the freegb library in Singular." exit 1 fi + + # Run the test suite + cd Tst + perl ./regress.cmd \ + -s "$out/bin/Singular" \ + ${lib.concatStringsSep " " (map lib.escapeShellArg testsToRun)} \ + 2>"$TMPDIR/out-err.log" + + # unfortunately regress.cmd always returns exit code 0, so check stderr + # https://www.singular.uni-kl.de/forum/viewtopic.php&t=2773 + if [[ -s "$TMPDIR/out-err.log" ]]; then + cat "$TMPDIR/out-err.log" + exit 1 + fi + + echo "Exit status $?" ''; enableParallelBuilding = true; @@ -110,6 +184,7 @@ stdenv.mkDerivation rec { description = "A CAS for polynomial computations"; maintainers = teams.sage.members; # 32 bit x86 fails with some link error: `undefined reference to `__divmoddi4@GCC_7.0.0'` + # https://www.singular.uni-kl.de:8002/trac/ticket/837 platforms = subtractLists platforms.i686 platforms.unix; license = licenses.gpl3; # Or GPLv2 at your option - but not GPLv4 homepage = "http://www.singular.uni-kl.de"; diff --git a/pkgs/applications/science/math/singular/disable-docs-for-optional-unpackaged-deps.patch b/pkgs/applications/science/math/singular/disable-docs-for-optional-unpackaged-deps.patch new file mode 100644 index 00000000000..46d92922f3c --- /dev/null +++ b/pkgs/applications/science/math/singular/disable-docs-for-optional-unpackaged-deps.patch @@ -0,0 +1,112 @@ +commit 9e8b044d982e132cf35a106a1cc0cf7e77b27f7c +Author: Mauricio Collares +Date: Thu Apr 15 20:33:21 2021 -0300 + + Disable manual sections using optional packages not yet in Nixpkgs + + * normaliz.lib depends on normaliz. + * polymake.lib depends on topcom. + * recover.lib depends on bertini. + * sing4ti2.lib depends on 4ti2. + * tateProdCplxNegGrad.lib uses multigrading.lib, which depends on 4ti2. + +diff --git a/doc/singular.doc b/doc/singular.doc +index 64b969d39..e704f95f0 100644 +--- a/doc/singular.doc ++++ b/doc/singular.doc +@@ -407,7 +407,6 @@ LIB "all.lib"; + * nfmodsyz_lib:: Syzygy modules of submodules of free modules over algebraic number fields + * noether_lib:: Noether normalization of an ideal + * normal_lib:: procedure for normalization +-* normaliz_lib:: integral closure, normalization for monomial ideals, toric ideals + * pointid_lib:: factorized lex GB of the vanishing ideal of a set of points + * primdec_lib:: procedures for primary decomposition + * primdecint_lib:: primary decomposition over the integers +@@ -416,7 +415,6 @@ LIB "all.lib"; + * reesclos_lib:: Rees Algebra and integral closure of an ideal + * rstandard_lib:: Janet bases and border bases for ideals + * sagbi_lib:: Subalgebras bases Analogous to Groebner bases for ideals +-* sing4ti2_lib:: interface to program 4ti2 + * symodstd_lib:: Groebner bases for symmetric ideals + * toric_lib:: toric ideals + @end menu +@@ -521,10 +519,6 @@ LIB "all.lib"; + @node normal_lib + @subsection normal_lib + @c lib normal.lib +-@c --------------------------------------------------------- +-@node normaliz_lib +-@subsection normaliz_lib +-@c lib normaliz.lib tag:normaliz + @c ---------------------------------------------------------- + @node pointid_lib + @subsection pointid_lib +@@ -558,10 +552,6 @@ LIB "all.lib"; + @subsection sagbi_lib + @c lib sagbi.lib + @c --------------------------------------------------------- +-@node sing4ti2_lib +-@subsection sing4ti2_lib +-@c lib sing4ti2.lib tag:sing4ti2 +-@c ---------------------------------------------------------- + @node symodstd_lib + @subsection symodstd_lib + @c lib symodstd.lib +@@ -873,7 +863,6 @@ iniD, reslist, sumlist, dividelist, createlist + * solve_lib:: procedures to solve polynomial systems + * triang_lib:: procedures for decomposing zero-dimensional ideals + * ntsolve_lib:: one real solution of polynomial systems (Newton iteration) +-* recover_lib:: Hybrid numerical/symbolical algorithms + * rootisolation_lib:: real root isolation with intervals + * signcond_lib:: computing realizable sign conditions + * zeroset_lib:: procedures for roots and factorization +@@ -904,10 +893,6 @@ iniD, reslist, sumlist, dividelist, createlist + @subsection ntsolve_lib + @c lib ntsolve.lib + @c --------------------------------------------------------- +-@node recover_lib +-@subsection recover_lib +-@c lib recover.lib tag:bertini +-@c ---------------------------------------------------------- + @node rootisolation_lib + @subsection rootisolation_lib + @c lib rootisolation.lib +@@ -1108,7 +1093,6 @@ but not for serious computations. + * cimonom_lib:: complete intersection for toric ideals + * gfan_lib:: A gfanlib interface for Singular + * gitfan_lib:: Compute GIT-fans +-* polymake_lib:: interface to TOPCOM + * realizationMatroids_lib:: Realizability for Tropical Fan Curves + * tropical_lib:: interface to gfan + * tropicalNewton_lib:: Newton polygons in tropical geometry +@@ -1125,10 +1109,7 @@ but not for serious computations. + @node gitfan_lib + @subsection gitfan_lib + @c lib gitfan.lib +-@c ---------------------------------------------------------- +-@node polymake_lib +-@subsection polymake_lib +-@c lib polymake.lib tag:topcom ++ + @c ---------------------------------------------------------- + @node realizationMatroids_lib + @subsection realizationMatroids_lib +@@ -1219,7 +1200,6 @@ Comments should be send to the author of the library directly. + * stanleyreisner_lib:: T1 and T2 for a general Stanley-Reiser ring + * swalk_lib:: Sagbi Walk Conversion Algorithm + * systhreads_lib:: multi-threaded objects +-* tateProdCplxNegGrad_lib:: sheaf cohomology on product of projective spaces + * VecField_lib:: vector fields + @end menu + @c ---------------------------------------------------------- +@@ -1310,10 +1290,6 @@ Todos/Issues: + @subsection systhreads_lib + @c lib systhreads.lib + @c --------------------------------------------------------- +-@node tateProdCplxNegGrad_lib +-@subsection tateProdCplxNegGrad_lib +-@c lib tateProdCplxNegGrad.lib +-@c --------------------------------------------------------- + @node VecField_lib + @subsection VecField_lib + @c lib VecField.lib From aebef1703fafa705282df3ece34121f18b9a1b1f Mon Sep 17 00:00:00 2001 From: Mauricio Collares Date: Wed, 21 Apr 2021 13:34:32 -0300 Subject: [PATCH 05/40] singular: import aarch64 support patch --- .../science/math/singular/default.nix | 9 +++-- .../math/singular/redhat-aarch64.patch | 38 +++++++++++++++++++ 2 files changed, 44 insertions(+), 3 deletions(-) create mode 100644 pkgs/applications/science/math/singular/redhat-aarch64.patch diff --git a/pkgs/applications/science/math/singular/default.nix b/pkgs/applications/science/math/singular/default.nix index add89c95a0c..172004b9e09 100644 --- a/pkgs/applications/science/math/singular/default.nix +++ b/pkgs/applications/science/math/singular/default.nix @@ -1,7 +1,7 @@ { stdenv, fetchFromGitHub, gmp, bison, perl, ncurses, readline, coreutils, pkg-config , lib , fetchpatch -, autoreconfHook269 +, autoreconfHook , sharutils , file , flint @@ -48,7 +48,10 @@ stdenv.mkDerivation rec { fetchSubmodules = true; }; - patches = lib.optionals enableDocs [ + patches = [ + # add aarch64 support to cpu-check.m4. copied from redhat. + ./redhat-aarch64.patch + ] ++ lib.optionals enableDocs [ # singular supports building without 4ti2, bertini, normaliz or # topcom just fine, but the docbuilding does not skip manual pages # tagged as depending on those binaries (probably a bug in @@ -96,7 +99,7 @@ stdenv.mkDerivation rec { bison perl pkg-config - autoreconfHook269 + autoreconfHook sharutils # needed for regress.cmd install checks ] ++ lib.optionals enableDocs [ doxygen diff --git a/pkgs/applications/science/math/singular/redhat-aarch64.patch b/pkgs/applications/science/math/singular/redhat-aarch64.patch new file mode 100644 index 00000000000..e0db6e87f99 --- /dev/null +++ b/pkgs/applications/science/math/singular/redhat-aarch64.patch @@ -0,0 +1,38 @@ +diff --git a/m4/cpu-check.m4 b/m4/cpu-check.m4 +index 3cf0a7f08..12bb926ac 100644 +--- a/m4/cpu-check.m4 ++++ b/m4/cpu-check.m4 +@@ -37,6 +37,18 @@ if test "$ac_cv_singcpuname" = ppc; then + AC_DEFINE(SI_CPU_PPC,1,"PPC") + AC_SUBST(SI_CPU_PPC) + fi ++if test "$ac_cv_singcpuname" = arm -o "$ac_cv_singcpuname" = armel; then ++ AC_DEFINE(SI_CPU_ARM,1,"ARM") ++ AC_SUBST(SI_CPU_ARM) ++fi ++if test "$ac_cv_singcpuname" = aarch64; then ++ AC_DEFINE(SI_CPU_AARCH64,1,"AARCH64") ++ AC_SUBST(SI_CPU_AARCH64) ++fi ++if test "$ac_cv_singcpuname" = s390; then ++ AC_DEFINE(SI_CPU_S390,1,"S390") ++ AC_SUBST(SI_CPU_S390) ++fi + + # UNAME and PATH + AC_MSG_CHECKING(uname for Singular) +@@ -65,6 +77,14 @@ dnl testet on: ppc_Linux, 740/750 PowerMac G3, 512k L2 cache + [powerpc*|ppc*], [AC_DEFINE(HAVE_GENERIC_MULT,1,multiplication is fast on the cpu: a*b is with mod otherwise using tables of logartihms)], + dnl the following settings seems to be better on arm processors + [arm*], [], ++dnl FIXME: need to run some tests ++ [aarch64*], [ ++ AC_DEFINE(HAVE_MULT_MOD,1,multiplication is fast on the cpu: a*b is with mod otherwise using tables of logartihms) ++ AC_DEFINE(HAVE_GENERIC_ADD,1,use branch for addition in Z/p otherwise it uses a generic add) ++ AC_DEFINE(HAVE_DIV_MOD,1,division using extend euclidian algorithm otherwise using tables of logartihms) ++ ], ++dnl FIXME: need to run some tests ++ [s390*], [AC_DEFINE(HAVE_GENERIC_ADD,1,use branch for addition in Z/p otherwise it uses a generic add)], + [] + ) + From cd7cf5942b4e366f9058affeb90178dcc4dde858 Mon Sep 17 00:00:00 2001 From: Mauricio Collares Date: Wed, 21 Apr 2021 20:05:48 -0300 Subject: [PATCH 06/40] singular: use older autoconf macro to unbreak aarch64 --- .../science/math/singular/default.nix | 6 + .../use-older-ax-prog-cc-for-build.patch | 194 ++++++++++++++++++ 2 files changed, 200 insertions(+) create mode 100644 pkgs/applications/science/math/singular/use-older-ax-prog-cc-for-build.patch diff --git a/pkgs/applications/science/math/singular/default.nix b/pkgs/applications/science/math/singular/default.nix index 172004b9e09..9a1d6316921 100644 --- a/pkgs/applications/science/math/singular/default.nix +++ b/pkgs/applications/science/math/singular/default.nix @@ -51,6 +51,12 @@ stdenv.mkDerivation rec { patches = [ # add aarch64 support to cpu-check.m4. copied from redhat. ./redhat-aarch64.patch + + # the newest version of ax-prog-cc-for-build.m4 seems to trigger + # linker errors. see + # https://github.com/alsa-project/alsa-firmware/issues/3 for a + # related issue. + ./use-older-ax-prog-cc-for-build.patch ] ++ lib.optionals enableDocs [ # singular supports building without 4ti2, bertini, normaliz or # topcom just fine, but the docbuilding does not skip manual pages diff --git a/pkgs/applications/science/math/singular/use-older-ax-prog-cc-for-build.patch b/pkgs/applications/science/math/singular/use-older-ax-prog-cc-for-build.patch new file mode 100644 index 00000000000..f664378617c --- /dev/null +++ b/pkgs/applications/science/math/singular/use-older-ax-prog-cc-for-build.patch @@ -0,0 +1,194 @@ +diff --git a/m4/ax_prog_cc_for_build.m4 b/m4/ax_prog_cc_for_build.m4 +index f7410d74b..12cb005a5 100644 +--- a/m4/ax_prog_cc_for_build.m4 ++++ b/m4/ax_prog_cc_for_build.m4 +@@ -32,35 +32,31 @@ + # and this notice are preserved. This file is offered as-is, without any + # warranty. + +-#serial 18 ++#serial 9 + + AU_ALIAS([AC_PROG_CC_FOR_BUILD], [AX_PROG_CC_FOR_BUILD]) + AC_DEFUN([AX_PROG_CC_FOR_BUILD], [dnl + AC_REQUIRE([AC_PROG_CC])dnl + AC_REQUIRE([AC_PROG_CPP])dnl +-AC_REQUIRE([AC_CANONICAL_BUILD])dnl ++AC_REQUIRE([AC_EXEEXT])dnl ++AC_REQUIRE([AC_CANONICAL_HOST])dnl + + dnl Use the standard macros, but make them use other variable names + dnl + pushdef([ac_cv_prog_CPP], ac_cv_build_prog_CPP)dnl +-pushdef([ac_cv_prog_cc_c89], ac_cv_build_prog_cc_c89)dnl + pushdef([ac_cv_prog_gcc], ac_cv_build_prog_gcc)dnl + pushdef([ac_cv_prog_cc_works], ac_cv_build_prog_cc_works)dnl + pushdef([ac_cv_prog_cc_cross], ac_cv_build_prog_cc_cross)dnl + pushdef([ac_cv_prog_cc_g], ac_cv_build_prog_cc_g)dnl +-pushdef([ac_cv_c_compiler_gnu], ac_cv_build_c_compiler_gnu)dnl + pushdef([ac_cv_exeext], ac_cv_build_exeext)dnl + pushdef([ac_cv_objext], ac_cv_build_objext)dnl + pushdef([ac_exeext], ac_build_exeext)dnl + pushdef([ac_objext], ac_build_objext)dnl + pushdef([CC], CC_FOR_BUILD)dnl + pushdef([CPP], CPP_FOR_BUILD)dnl +-pushdef([GCC], GCC_FOR_BUILD)dnl + pushdef([CFLAGS], CFLAGS_FOR_BUILD)dnl + pushdef([CPPFLAGS], CPPFLAGS_FOR_BUILD)dnl +-pushdef([EXEEXT], BUILD_EXEEXT)dnl + pushdef([LDFLAGS], LDFLAGS_FOR_BUILD)dnl +-pushdef([OBJEXT], BUILD_OBJEXT)dnl + pushdef([host], build)dnl + pushdef([host_alias], build_alias)dnl + pushdef([host_cpu], build_cpu)dnl +@@ -71,29 +67,27 @@ pushdef([ac_cv_host_alias], ac_cv_build_alias)dnl + pushdef([ac_cv_host_cpu], ac_cv_build_cpu)dnl + pushdef([ac_cv_host_vendor], ac_cv_build_vendor)dnl + pushdef([ac_cv_host_os], ac_cv_build_os)dnl +-pushdef([ac_tool_prefix], ac_build_tool_prefix)dnl +-pushdef([am_cv_CC_dependencies_compiler_type], am_cv_build_CC_dependencies_compiler_type)dnl +-pushdef([am_cv_prog_cc_c_o], am_cv_build_prog_cc_c_o)dnl +-pushdef([cross_compiling], cross_compiling_build)dnl ++pushdef([ac_cpp], ac_build_cpp)dnl ++pushdef([ac_compile], ac_build_compile)dnl ++pushdef([ac_link], ac_build_link)dnl + +-cross_compiling_build=no ++save_cross_compiling=$cross_compiling ++save_ac_tool_prefix=$ac_tool_prefix ++cross_compiling=no ++ac_tool_prefix= + +-ac_build_tool_prefix= +-AS_IF([test -n "$build"], [ac_build_tool_prefix="$build-"], +- [test -n "$build_alias"],[ac_build_tool_prefix="$build_alias-"]) +- +-AC_LANG_PUSH([C]) + AC_PROG_CC +-_AC_COMPILER_EXEEXT +-_AC_COMPILER_OBJEXT + AC_PROG_CPP ++AC_EXEEXT ++ ++ac_tool_prefix=$save_ac_tool_prefix ++cross_compiling=$save_cross_compiling + + dnl Restore the old definitions + dnl +-popdef([cross_compiling])dnl +-popdef([am_cv_prog_cc_c_o])dnl +-popdef([am_cv_CC_dependencies_compiler_type])dnl +-popdef([ac_tool_prefix])dnl ++popdef([ac_link])dnl ++popdef([ac_compile])dnl ++popdef([ac_cpp])dnl + popdef([ac_cv_host_os])dnl + popdef([ac_cv_host_vendor])dnl + popdef([ac_cv_host_cpu])dnl +@@ -104,33 +98,25 @@ popdef([host_vendor])dnl + popdef([host_cpu])dnl + popdef([host_alias])dnl + popdef([host])dnl +-popdef([OBJEXT])dnl + popdef([LDFLAGS])dnl +-popdef([EXEEXT])dnl + popdef([CPPFLAGS])dnl + popdef([CFLAGS])dnl +-popdef([GCC])dnl + popdef([CPP])dnl + popdef([CC])dnl + popdef([ac_objext])dnl + popdef([ac_exeext])dnl + popdef([ac_cv_objext])dnl + popdef([ac_cv_exeext])dnl +-popdef([ac_cv_c_compiler_gnu])dnl + popdef([ac_cv_prog_cc_g])dnl + popdef([ac_cv_prog_cc_cross])dnl + popdef([ac_cv_prog_cc_works])dnl +-popdef([ac_cv_prog_cc_c89])dnl + popdef([ac_cv_prog_gcc])dnl + popdef([ac_cv_prog_CPP])dnl + +-dnl restore global variables ac_ext, ac_cpp, ac_compile, +-dnl ac_link, ac_compiler_gnu (dependant on the current +-dnl language after popping): +-AC_LANG_POP([C]) +- + dnl Finally, set Makefile variables + dnl ++BUILD_EXEEXT=$ac_build_exeext ++BUILD_OBJEXT=$ac_build_objext + AC_SUBST(BUILD_EXEEXT)dnl + AC_SUBST(BUILD_OBJEXT)dnl + AC_SUBST([CFLAGS_FOR_BUILD])dnl +diff --git a/m4/ax_prog_cxx_for_build.m4 b/m4/ax_prog_cxx_for_build.m4 +index 4d976769f..17c19a89f 100644 +--- a/m4/ax_prog_cxx_for_build.m4 ++++ b/m4/ax_prog_cxx_for_build.m4 +@@ -31,7 +31,7 @@ + # and this notice are preserved. This file is offered as-is, without any + # warranty. + +-#serial 4 ++#serial 3 + + AU_ALIAS([AC_PROG_CXX_FOR_BUILD], [AX_PROG_CXX_FOR_BUILD]) + AC_DEFUN([AX_PROG_CXX_FOR_BUILD], [dnl +@@ -49,7 +49,6 @@ pushdef([ac_cv_prog_cxx_cross], ac_cv_build_prog_cxx_cross)dnl + pushdef([ac_cv_prog_cxx_g], ac_cv_build_prog_cxx_g)dnl + pushdef([CXX], CXX_FOR_BUILD)dnl + pushdef([CXXCPP], CXXCPP_FOR_BUILD)dnl +-pushdef([GXX], GXX_FOR_BUILD)dnl + pushdef([CXXFLAGS], CXXFLAGS_FOR_BUILD)dnl + pushdef([CPPFLAGS], CPPFLAGS_FOR_BUILD)dnl + pushdef([CXXCPPFLAGS], CXXCPPFLAGS_FOR_BUILD)dnl +@@ -63,25 +62,26 @@ pushdef([ac_cv_host_alias], ac_cv_build_alias)dnl + pushdef([ac_cv_host_cpu], ac_cv_build_cpu)dnl + pushdef([ac_cv_host_vendor], ac_cv_build_vendor)dnl + pushdef([ac_cv_host_os], ac_cv_build_os)dnl +-pushdef([ac_tool_prefix], ac_build_tool_prefix)dnl +-pushdef([am_cv_CXX_dependencies_compiler_type], am_cv_build_CXX_dependencies_compiler_type)dnl +-pushdef([cross_compiling], cross_compiling_build)dnl ++pushdef([ac_cxxcpp], ac_build_cxxcpp)dnl ++pushdef([ac_compile], ac_build_compile)dnl ++pushdef([ac_link], ac_build_link)dnl + +-cross_compiling_build=no ++save_cross_compiling=$cross_compiling ++save_ac_tool_prefix=$ac_tool_prefix ++cross_compiling=no ++ac_tool_prefix= + +-ac_build_tool_prefix= +-AS_IF([test -n "$build"], [ac_build_tool_prefix="$build-"], +- [test -n "$build_alias"],[ac_build_tool_prefix="$build_alias-"]) +- +-AC_LANG_PUSH([C++]) + AC_PROG_CXX + AC_PROG_CXXCPP + ++ac_tool_prefix=$save_ac_tool_prefix ++cross_compiling=$save_cross_compiling ++ + dnl Restore the old definitions + dnl +-popdef([cross_compiling])dnl +-popdef([am_cv_CXX_dependencies_compiler_type])dnl +-popdef([ac_tool_prefix])dnl ++popdef([ac_link])dnl ++popdef([ac_compile])dnl ++popdef([ac_cxxcpp])dnl + popdef([ac_cv_host_os])dnl + popdef([ac_cv_host_vendor])dnl + popdef([ac_cv_host_cpu])dnl +@@ -103,10 +103,6 @@ popdef([ac_cv_prog_cxx_works])dnl + popdef([ac_cv_prog_gxx])dnl + popdef([ac_cv_prog_CXXCPP])dnl + +-dnl restore global variables (dependant on the current +-dnl language after popping): +-AC_LANG_POP([C++]) +- + dnl Finally, set Makefile variables + dnl + AC_SUBST([CXXFLAGS_FOR_BUILD])dnl From 090165d7c17f814cfe458b22026fda026888f78b Mon Sep 17 00:00:00 2001 From: Mauricio Collares Date: Wed, 21 Apr 2021 23:53:20 -0300 Subject: [PATCH 07/40] singular: disable vspace on aarch64 --- .../science/math/singular/default.nix | 3 +++ .../math/singular/disable-vspace-on-aarch64.patch | 15 +++++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 pkgs/applications/science/math/singular/disable-vspace-on-aarch64.patch diff --git a/pkgs/applications/science/math/singular/default.nix b/pkgs/applications/science/math/singular/default.nix index 9a1d6316921..695af3d1744 100644 --- a/pkgs/applications/science/math/singular/default.nix +++ b/pkgs/applications/science/math/singular/default.nix @@ -52,6 +52,9 @@ stdenv.mkDerivation rec { # add aarch64 support to cpu-check.m4. copied from redhat. ./redhat-aarch64.patch + # vspace causes hangs in modstd and other libraries on aarch64 + ./disable-vspace-on-aarch64.patch + # the newest version of ax-prog-cc-for-build.m4 seems to trigger # linker errors. see # https://github.com/alsa-project/alsa-firmware/issues/3 for a diff --git a/pkgs/applications/science/math/singular/disable-vspace-on-aarch64.patch b/pkgs/applications/science/math/singular/disable-vspace-on-aarch64.patch new file mode 100644 index 00000000000..3e51b7fb2ce --- /dev/null +++ b/pkgs/applications/science/math/singular/disable-vspace-on-aarch64.patch @@ -0,0 +1,15 @@ +diff --git a/kernel/mod2.h b/kernel/mod2.h +index 867fcae47..2abd84f23 100644 +--- a/kernel/mod2.h ++++ b/kernel/mod2.h +@@ -60,8 +60,10 @@ + + /* define for parallel processes with shared memory */ + #ifndef __CCYGWIN__ ++#ifndef SI_CPU_AARCH64 + #define HAVE_VSPACE 1 + #endif ++#endif + + /*#define PROFILING*/ + #ifdef PROFILING From a0f410646c54c19f7bc239f25178cb1ffe7608d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Garaba=20Fl=C3=B3ri=C3=A1n?= Date: Sat, 17 Apr 2021 10:23:29 -0300 Subject: [PATCH 08/40] sage: use threejs fork --- .../applications/science/math/sage/default.nix | 6 ++++-- ...grep-threejs-version-from-minified-js.patch | 16 ---------------- .../science/math/sage/sage-src.nix | 3 --- .../science/math/sage/threejs-sage.nix | 18 ++++++++++++++++++ 4 files changed, 22 insertions(+), 21 deletions(-) delete mode 100644 pkgs/applications/science/math/sage/patches/dont-grep-threejs-version-from-minified-js.patch create mode 100644 pkgs/applications/science/math/sage/threejs-sage.nix diff --git a/pkgs/applications/science/math/sage/default.nix b/pkgs/applications/science/math/sage/default.nix index 8ef1f5189e5..4a18d1e88a6 100644 --- a/pkgs/applications/science/math/sage/default.nix +++ b/pkgs/applications/science/math/sage/default.nix @@ -38,14 +38,16 @@ let logo64 = "${sage-src}/doc/common/themes/sage/static/sageicon.png"; }; + three = callPackage ./threejs-sage.nix { }; + # A bash script setting various environment variables to tell sage where # the files its looking fore are located. Also see `sage-env`. env-locations = callPackage ./env-locations.nix { inherit pari_data; inherit singular maxima-ecl; + inherit three; ecl = maxima-ecl.ecl; cysignals = python3.pkgs.cysignals; - three = nodePackages.three; mathjax = nodePackages.mathjax; }; @@ -70,8 +72,8 @@ let inherit python3 pythonEnv; inherit sage-env; inherit pynac singular maxima-ecl; + inherit three; pkg-config = pkgs.pkg-config; # not to confuse with pythonPackages.pkg-config - three = nodePackages.three; }; # Doesn't actually build anything, just runs sages testsuite. This is a diff --git a/pkgs/applications/science/math/sage/patches/dont-grep-threejs-version-from-minified-js.patch b/pkgs/applications/science/math/sage/patches/dont-grep-threejs-version-from-minified-js.patch deleted file mode 100644 index 88cb66506b1..00000000000 --- a/pkgs/applications/science/math/sage/patches/dont-grep-threejs-version-from-minified-js.patch +++ /dev/null @@ -1,16 +0,0 @@ -diff --git a/src/sage/repl/rich_output/display_manager.py b/src/sage/repl/rich_output/display_manager.py -index fb21f7a9c9..f39470777d 100644 ---- a/src/sage/repl/rich_output/display_manager.py -+++ b/src/sage/repl/rich_output/display_manager.py -@@ -749,9 +749,9 @@ class DisplayManager(SageObject): - import sage.env - import re - import os -- with open(os.path.join(sage.env.THREEJS_DIR, 'build', 'three.min.js')) as f: -+ with open(os.path.join(sage.env.THREEJS_DIR, 'build', 'three.js')) as f: - text = f.read().replace('\n','') -- version = re.search(r'REVISION="(\d+)"', text).group(1) -+ version = re.search(r"REVISION = '(\d+)'", text).group(1) - return """ - - diff --git a/pkgs/applications/science/math/sage/sage-src.nix b/pkgs/applications/science/math/sage/sage-src.nix index 1fb605b3599..8ac5143f443 100644 --- a/pkgs/applications/science/math/sage/sage-src.nix +++ b/pkgs/applications/science/math/sage/sage-src.nix @@ -131,9 +131,6 @@ stdenv.mkDerivation rec { # fix test output with sympy 1.7 (https://trac.sagemath.org/ticket/30985) ./patches/sympy-1.7-update.patch - # workaround until we use sage's fork of threejs, which contains a "version" file - ./patches/dont-grep-threejs-version-from-minified-js.patch - # updated eclib output has punctuation changes and tidier whitespace ./patches/eclib-20210223-test-formatting.patch diff --git a/pkgs/applications/science/math/sage/threejs-sage.nix b/pkgs/applications/science/math/sage/threejs-sage.nix new file mode 100644 index 00000000000..0e4ad4dee95 --- /dev/null +++ b/pkgs/applications/science/math/sage/threejs-sage.nix @@ -0,0 +1,18 @@ +{ stdenv, fetchFromGitHub }: + +stdenv.mkDerivation rec { + pname = "threejs-sage"; + version = "r122"; + + src = fetchFromGitHub { + owner = "sagemath"; + repo = "threejs-sage"; + rev = version; + sha256 = "sha256-xPAPt36Fon3hYQq6SOmGkIyUzAII2LMl10nqYG4UPI0="; + }; + + installPhase = '' + mkdir -p $out/lib/node_modules/three + cp -r build version $out/lib/node_modules/three + ''; +} From 00d2e243952dd582c34a2324509b6a0dc64dd1c7 Mon Sep 17 00:00:00 2001 From: Mauricio Collares Date: Fri, 16 Apr 2021 18:38:14 -0300 Subject: [PATCH 09/40] eclib: 20210223 -> 20190909 This reverts commits 003705ef0835d9b0db805a384b749172dfdca022 and ef615b5a61c049317da5ed5637e4561b224dd66d. --- .../eclib-20210223-test-formatting.patch | 131 ------------------ .../science/math/sage/sage-src.nix | 3 - pkgs/development/libraries/eclib/default.nix | 4 +- 3 files changed, 2 insertions(+), 136 deletions(-) delete mode 100644 pkgs/applications/science/math/sage/patches/eclib-20210223-test-formatting.patch diff --git a/pkgs/applications/science/math/sage/patches/eclib-20210223-test-formatting.patch b/pkgs/applications/science/math/sage/patches/eclib-20210223-test-formatting.patch deleted file mode 100644 index 3fdb8f768e9..00000000000 --- a/pkgs/applications/science/math/sage/patches/eclib-20210223-test-formatting.patch +++ /dev/null @@ -1,131 +0,0 @@ -diff --git a/src/sage/libs/eclib/interface.py b/src/sage/libs/eclib/interface.py -index e898456720..6b98c12328 100644 ---- a/src/sage/libs/eclib/interface.py -+++ b/src/sage/libs/eclib/interface.py -@@ -758,78 +758,78 @@ class mwrank_MordellWeil(SageObject): - - sage: EQ = mwrank_MordellWeil(E, verbose=True) - sage: EQ.search(1) -- P1 = [0:1:0] is torsion point, order 1 -- P1 = [-3:0:1] is generator number 1 -- saturating up to 20...Checking 2-saturation -+ P1 = [0:1:0] is torsion point, order 1 -+ P1 = [-3:0:1] is generator number 1 -+ saturating up to 20...Checking 2-saturation... - Points have successfully been 2-saturated (max q used = 7) -- Checking 3-saturation -+ Checking 3-saturation... - Points have successfully been 3-saturated (max q used = 7) -- Checking 5-saturation -+ Checking 5-saturation... - Points have successfully been 5-saturated (max q used = 23) -- Checking 7-saturation -+ Checking 7-saturation... - Points have successfully been 7-saturated (max q used = 41) -- Checking 11-saturation -+ Checking 11-saturation... - Points have successfully been 11-saturated (max q used = 17) -- Checking 13-saturation -+ Checking 13-saturation... - Points have successfully been 13-saturated (max q used = 43) -- Checking 17-saturation -+ Checking 17-saturation... - Points have successfully been 17-saturated (max q used = 31) -- Checking 19-saturation -+ Checking 19-saturation... - Points have successfully been 19-saturated (max q used = 37) - done -- P2 = [-2:3:1] is generator number 2 -- saturating up to 20...Checking 2-saturation -+ P2 = [-2:3:1] is generator number 2 -+ saturating up to 20...Checking 2-saturation... - possible kernel vector = [1,1] - This point may be in 2E(Q): [14:-52:1] - ...and it is! - Replacing old generator #1 with new generator [1:-1:1] - Points have successfully been 2-saturated (max q used = 7) - Index gain = 2^1 -- Checking 3-saturation -+ Checking 3-saturation... - Points have successfully been 3-saturated (max q used = 13) -- Checking 5-saturation -+ Checking 5-saturation... - Points have successfully been 5-saturated (max q used = 67) -- Checking 7-saturation -+ Checking 7-saturation... - Points have successfully been 7-saturated (max q used = 53) -- Checking 11-saturation -+ Checking 11-saturation... - Points have successfully been 11-saturated (max q used = 73) -- Checking 13-saturation -+ Checking 13-saturation... - Points have successfully been 13-saturated (max q used = 103) -- Checking 17-saturation -+ Checking 17-saturation... - Points have successfully been 17-saturated (max q used = 113) -- Checking 19-saturation -+ Checking 19-saturation... - Points have successfully been 19-saturated (max q used = 47) - done (index = 2). - Gained index 2, new generators = [ [1:-1:1] [-2:3:1] ] -- P3 = [-14:25:8] is generator number 3 -- saturating up to 20...Checking 2-saturation -+ P3 = [-14:25:8] is generator number 3 -+ saturating up to 20...Checking 2-saturation... - Points have successfully been 2-saturated (max q used = 11) -- Checking 3-saturation -+ Checking 3-saturation... - Points have successfully been 3-saturated (max q used = 13) -- Checking 5-saturation -+ Checking 5-saturation... - Points have successfully been 5-saturated (max q used = 71) -- Checking 7-saturation -+ Checking 7-saturation... - Points have successfully been 7-saturated (max q used = 101) -- Checking 11-saturation -+ Checking 11-saturation... - Points have successfully been 11-saturated (max q used = 127) -- Checking 13-saturation -+ Checking 13-saturation... - Points have successfully been 13-saturated (max q used = 151) -- Checking 17-saturation -+ Checking 17-saturation... - Points have successfully been 17-saturated (max q used = 139) -- Checking 19-saturation -+ Checking 19-saturation... - Points have successfully been 19-saturated (max q used = 179) - done (index = 1). -- P4 = [-1:3:1] = -1*P1 + -1*P2 + -1*P3 (mod torsion) -- P4 = [0:2:1] = 2*P1 + 0*P2 + 1*P3 (mod torsion) -- P4 = [2:13:8] = -3*P1 + 1*P2 + -1*P3 (mod torsion) -- P4 = [1:0:1] = -1*P1 + 0*P2 + 0*P3 (mod torsion) -- P4 = [2:0:1] = -1*P1 + 1*P2 + 0*P3 (mod torsion) -- P4 = [18:7:8] = -2*P1 + -1*P2 + -1*P3 (mod torsion) -- P4 = [3:3:1] = 1*P1 + 0*P2 + 1*P3 (mod torsion) -- P4 = [4:6:1] = 0*P1 + -1*P2 + -1*P3 (mod torsion) -- P4 = [36:69:64] = 1*P1 + -2*P2 + 0*P3 (mod torsion) -- P4 = [68:-25:64] = -2*P1 + -1*P2 + -2*P3 (mod torsion) -- P4 = [12:35:27] = 1*P1 + -1*P2 + -1*P3 (mod torsion) -+ P4 = [-1:3:1] = -1*P1 + -1*P2 + -1*P3 (mod torsion) -+ P4 = [0:2:1] = 2*P1 + 0*P2 + 1*P3 (mod torsion) -+ P4 = [2:13:8] = -3*P1 + 1*P2 + -1*P3 (mod torsion) -+ P4 = [1:0:1] = -1*P1 + 0*P2 + 0*P3 (mod torsion) -+ P4 = [2:0:1] = -1*P1 + 1*P2 + 0*P3 (mod torsion) -+ P4 = [18:7:8] = -2*P1 + -1*P2 + -1*P3 (mod torsion) -+ P4 = [3:3:1] = 1*P1 + 0*P2 + 1*P3 (mod torsion) -+ P4 = [4:6:1] = 0*P1 + -1*P2 + -1*P3 (mod torsion) -+ P4 = [36:69:64] = 1*P1 + -2*P2 + 0*P3 (mod torsion) -+ P4 = [68:-25:64] = -2*P1 + -1*P2 + -2*P3 (mod torsion) -+ P4 = [12:35:27] = 1*P1 + -1*P2 + -1*P3 (mod torsion) - sage: EQ - Subgroup of Mordell-Weil group: [[1:-1:1], [-2:3:1], [-14:25:8]] - -@@ -1076,7 +1076,7 @@ class mwrank_MordellWeil(SageObject): - sage: EQ.search(1) - P1 = [0:1:0] is torsion point, order 1 - P1 = [-3:0:1] is generator number 1 -- saturating up to 20...Checking 2-saturation -+ saturating up to 20...Checking 2-saturation... - ... - P4 = [12:35:27] = 1*P1 + -1*P2 + -1*P3 (mod torsion) - sage: EQ diff --git a/pkgs/applications/science/math/sage/sage-src.nix b/pkgs/applications/science/math/sage/sage-src.nix index 8ac5143f443..e9069725737 100644 --- a/pkgs/applications/science/math/sage/sage-src.nix +++ b/pkgs/applications/science/math/sage/sage-src.nix @@ -131,9 +131,6 @@ stdenv.mkDerivation rec { # fix test output with sympy 1.7 (https://trac.sagemath.org/ticket/30985) ./patches/sympy-1.7-update.patch - # updated eclib output has punctuation changes and tidier whitespace - ./patches/eclib-20210223-test-formatting.patch - # upgrade arb to 2.18.1 (https://trac.sagemath.org/ticket/28623) (fetchSageDiff { base = "9.3.beta3"; diff --git a/pkgs/development/libraries/eclib/default.nix b/pkgs/development/libraries/eclib/default.nix index a8697207ed1..4709441a101 100644 --- a/pkgs/development/libraries/eclib/default.nix +++ b/pkgs/development/libraries/eclib/default.nix @@ -14,7 +14,7 @@ assert withFlint -> flint != null; stdenv.mkDerivation rec { pname = "eclib"; - version = "20210223"; # upgrade might break the sage interface + version = "20190909"; # upgrade might break the sage interface # sage tests to run: # src/sage/interfaces/mwrank.py # src/sage/libs/eclib @@ -23,7 +23,7 @@ stdenv.mkDerivation rec { owner = "JohnCremona"; repo = pname; rev = "v${version}"; - sha256 = "sha256-xnSw5cdg4PLa0GT/blCYDz/IG5aj+HG2NHSlyCiH9g0="; + sha256 = "0y1vdi4120gdw56gg2dn3wh625yr9wpyk3wpbsd25w4lv83qq5da"; }; buildInputs = [ pari From 9bcbff30c3b8a6ec7e0c526043f23c58ebc7af54 Mon Sep 17 00:00:00 2001 From: Mauricio Collares Date: Mon, 19 Apr 2021 22:44:54 -0300 Subject: [PATCH 10/40] flint: add sage team to maintainers --- pkgs/development/libraries/flint/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/libraries/flint/default.nix b/pkgs/development/libraries/flint/default.nix index 2c540d13008..0adaa2fe5e7 100644 --- a/pkgs/development/libraries/flint/default.nix +++ b/pkgs/development/libraries/flint/default.nix @@ -45,7 +45,7 @@ stdenv.mkDerivation rec { inherit version; description = "Fast Library for Number Theory"; license = lib.licenses.gpl2Plus; - maintainers = [lib.maintainers.raskin]; + maintainers = lib.teams.sage.members; platforms = lib.platforms.unix; homepage = "http://www.flintlib.org/"; downloadPage = "http://www.flintlib.org/downloads.html"; From 090b71f62766f953a0c57409df2789291d47ce18 Mon Sep 17 00:00:00 2001 From: Masanori Ogino Date: Fri, 2 Apr 2021 18:10:36 -0300 Subject: [PATCH 11/40] sage: 9.2 -> 9.3.rc4 Co-authored-by: Mauricio Collares --- .../science/math/sage/default.nix | 6 + .../patches/do-not-test-find-library.patch | 92 ++++++----- .../sphinx-docbuild-subprocesses.patch | 34 ++-- .../math/sage/patches/sympy-1.7-update.patch | 25 --- .../science/math/sage/sage-env.nix | 6 +- .../science/math/sage/sage-src.nix | 146 ++---------------- .../science/math/sage/sage_docbuild.nix | 20 +++ .../science/math/sage/sagedoc.nix | 12 +- .../science/math/sage/sagelib.nix | 16 +- 9 files changed, 115 insertions(+), 242 deletions(-) delete mode 100644 pkgs/applications/science/math/sage/patches/sympy-1.7-update.patch create mode 100644 pkgs/applications/science/math/sage/sage_docbuild.nix diff --git a/pkgs/applications/science/math/sage/default.nix b/pkgs/applications/science/math/sage/default.nix index 4a18d1e88a6..e39db4b1ac2 100644 --- a/pkgs/applications/science/math/sage/default.nix +++ b/pkgs/applications/science/math/sage/default.nix @@ -19,6 +19,10 @@ let linbox = pkgs.linbox.override { withSage = true; }; pkg-config = pkgs.pkg-config; # not to confuse with pythonPackages.pkg-config }; + + sage_docbuild = self.callPackage ./sage_docbuild.nix { + inherit sage-src; + }; }; }; @@ -55,6 +59,7 @@ let # the env-locations file. sage-env = callPackage ./sage-env.nix { sagelib = python3.pkgs.sagelib; + sage_docbuild = python3.pkgs.sage_docbuild; inherit env-locations; inherit python3 singular palp flint pynac pythonEnv maxima-ecl; ecl = maxima-ecl.ecl; @@ -88,6 +93,7 @@ let pythonRuntimeDeps = with python3.pkgs; [ sagelib + sage_docbuild cvxopt networkx service-identity diff --git a/pkgs/applications/science/math/sage/patches/do-not-test-find-library.patch b/pkgs/applications/science/math/sage/patches/do-not-test-find-library.patch index 98175920238..0dbfba642e8 100644 --- a/pkgs/applications/science/math/sage/patches/do-not-test-find-library.patch +++ b/pkgs/applications/science/math/sage/patches/do-not-test-find-library.patch @@ -1,13 +1,13 @@ diff --git a/src/sage/env.py b/src/sage/env.py -index 1ddfc7cfb9..45033d6328 100644 +index 2908f5d04f..81dfd75c0d 100644 --- a/src/sage/env.py +++ b/src/sage/env.py -@@ -203,97 +203,13 @@ var('ARB_LIBRARY', 'arb') - var('SAGE_BANNER', '') - var('SAGE_IMPORTALL', 'yes') +@@ -218,93 +218,12 @@ NTL_LIBDIR = var("NTL_LIBDIR") + SAGE_BANNER = var("SAGE_BANNER", "") + SAGE_IMPORTALL = var("SAGE_IMPORTALL", "yes") - --def _get_shared_lib_filename(libname, *additional_libnames): +-def _get_shared_lib_path(*libnames: str) -> Optional[str]: - """ - Return the full path to a shared library file installed in - ``$SAGE_LOCAL/lib`` or the directories associated with the @@ -25,80 +25,76 @@ index 1ddfc7cfb9..45033d6328 100644 - For distributions like Debian that use a multiarch layout, we also try the - multiarch lib paths (i.e. ``/usr/lib//``). - -- This returns ``None`` if the file does not exist. +- This returns ``None`` if no matching library file could be found. - - EXAMPLES:: - - sage: import sys - sage: from fnmatch import fnmatch -- sage: from sage.env import _get_shared_lib_filename -- sage: lib_filename = _get_shared_lib_filename("Singular", -- ....: "singular-Singular") +- sage: from sage.env import _get_shared_lib_path +- sage: lib_filename = _get_shared_lib_path("Singular", "singular-Singular") - sage: if sys.platform == 'cygwin': - ....: pattern = "*/cygSingular-*.dll" - ....: elif sys.platform == 'darwin': -- ....: pattern = "*/libSingular.dylib" +- ....: pattern = "*/libSingular-*.dylib" - ....: else: -- ....: pattern = "*/lib*Singular.so" -- sage: fnmatch(lib_filename, pattern) +- ....: pattern = "*/lib*Singular-*.so" +- sage: fnmatch(str(lib_filename), pattern) - True -- sage: _get_shared_lib_filename("an_absurd_lib") is None +- sage: _get_shared_lib_path("an_absurd_lib") is None - True - """ - -- for libname in (libname,) + additional_libnames: +- for libname in libnames: +- search_directories: List[Path] = [] +- patterns: List[str] = [] - if sys.platform == 'cygwin': -- # Later down we take the last matching DLL found, so search -- # SAGE_LOCAL second so that it takes precedence -- bindirs = [ -- sysconfig.get_config_var('BINDIR'), -- os.path.join(SAGE_LOCAL, 'bin') +- # Later down we take the first matching DLL found, so search +- # SAGE_LOCAL first so that it takes precedence +- search_directories = [ +- Path(SAGE_LOCAL) / 'bin', +- Path(sysconfig.get_config_var('BINDIR')), - ] -- pats = ['cyg{}.dll'.format(libname), 'cyg{}-*.dll'.format(libname)] -- filenames = [] -- for bindir in bindirs: -- for pat in pats: -- filenames += glob.glob(os.path.join(bindir, pat)) -- -- # Note: This is not very robust, since if there are multi DLL +- # Note: The following is not very robust, since if there are multible - # versions for the same library this just selects one more or less -- # at arbitrary. However, practically speaking, on Cygwin, there +- # at arbitrary. However, practically speaking, on Cygwin, there - # will only ever be one version -- if filenames: -- return filenames[-1] +- patterns = [f'cyg{libname}.dll', f'cyg{libname}-*.dll'] - else: - if sys.platform == 'darwin': - ext = 'dylib' - else: - ext = 'so' - -- libdirs = [ -- os.path.join(SAGE_LOCAL, 'lib'), -- sysconfig.get_config_var('LIBDIR') -- ] -- multilib = sysconfig.get_config_var('MULTILIB') -- if multilib: -- libdirs.insert(1, os.path.join(libdirs[0], multilib)) +- search_directories = [Path(SAGE_LOCAL) / 'lib'] +- libdir = sysconfig.get_config_var('LIBDIR') +- if libdir is not None: +- libdir = Path(libdir) +- search_directories.append(libdir) - -- for libdir in libdirs: -- basename = 'lib{}.{}'.format(libname, ext) -- filename = os.path.join(libdir, basename) -- if os.path.exists(filename): -- return filename +- multiarchlib = sysconfig.get_config_var('MULTIARCH') +- if multiarchlib is not None: +- search_directories.append(libdir / multiarchlib), +- +- patterns = [f'lib{libname}.{ext}'] +- +- for directory in search_directories: +- for pattern in patterns: +- path = next(directory.glob(pattern), None) +- if path is not None: +- return str(path.resolve()) - - # Just return None if no files were found - return None -- - # locate singular shared object # On Debian it's libsingular-Singular so try that as well --SINGULAR_SO = _get_shared_lib_filename('Singular', 'singular-Singular') -+SINGULAR_SO = '/default' - var('SINGULAR_SO', SINGULAR_SO) +-SINGULAR_SO = var("SINGULAR_SO", _get_shared_lib_path("Singular", "singular-Singular")) ++SINGULAR_SO = var("SINGULAR_SO", '/default') # locate libgap shared object --GAP_SO= _get_shared_lib_filename('gap','') -+GAP_SO = '/default' - var('GAP_SO', GAP_SO) +-GAP_SO = var("GAP_SO", _get_shared_lib_path("gap", "")) ++GAP_SO = var("GAP_SO", '/default') # post process + if ' ' in DOT_SAGE: diff --git a/pkgs/applications/science/math/sage/patches/sphinx-docbuild-subprocesses.patch b/pkgs/applications/science/math/sage/patches/sphinx-docbuild-subprocesses.patch index 661077cfa8c..3c64be100d2 100644 --- a/pkgs/applications/science/math/sage/patches/sphinx-docbuild-subprocesses.patch +++ b/pkgs/applications/science/math/sage/patches/sphinx-docbuild-subprocesses.patch @@ -1,8 +1,8 @@ -diff --git a/src/sage_setup/docbuild/__init__.py b/src/sage_setup/docbuild/__init__.py -index 73a078e619..059125c59f 100644 ---- a/src/sage_setup/docbuild/__init__.py -+++ b/src/sage_setup/docbuild/__init__.py -@@ -86,27 +86,6 @@ def builder_helper(type): +diff --git a/src/sage_docbuild/__init__.py b/src/sage_docbuild/__init__.py +index 79005b903a..fbe6fe2595 100644 +--- a/src/sage_docbuild/__init__.py ++++ b/src/sage_docbuild/__init__.py +@@ -85,27 +85,6 @@ def builder_helper(type): """ Returns a function which builds the documentation for output type ``type``. @@ -11,16 +11,16 @@ index 73a078e619..059125c59f 100644 - - Check that :trac:`25161` has been resolved:: - -- sage: from sage_setup.docbuild import DocBuilder, setup_parser +- sage: from sage_docbuild import DocBuilder, setup_parser - sage: DocBuilder._options = setup_parser().parse_args([])[0] # builder_helper needs _options to be set - -- sage: import sage_setup.docbuild.sphinxbuild +- sage: import sage_docbuild.sphinxbuild - sage: def raiseBaseException(): - ....: raise BaseException("abort pool operation") -- sage: original_runsphinx, sage_setup.docbuild.sphinxbuild.runsphinx = sage_setup.docbuild.sphinxbuild.runsphinx, raiseBaseException +- sage: original_runsphinx, sage_docbuild.sphinxbuild.runsphinx = sage_docbuild.sphinxbuild.runsphinx, raiseBaseException - -- sage: from sage_setup.docbuild import builder_helper, build_ref_doc -- sage: from sage_setup.docbuild import _build_many as build_many +- sage: from sage_docbuild import builder_helper, build_ref_doc +- sage: from sage_docbuild import _build_many as build_many - sage: helper = builder_helper("html") - sage: try: - ....: build_many(build_ref_doc, [("docname", "en", "html", {})]) @@ -30,24 +30,24 @@ index 73a078e619..059125c59f 100644 """ def f(self, *args, **kwds): output_dir = self._output_dir(type) -@@ -128,10 +107,9 @@ def builder_helper(type): +@@ -127,10 +106,9 @@ def builder_helper(type): logger.debug(build_command) # Run Sphinx with Sage's special logger - sys.argv = ["sphinx-build"] + build_command.split() - from .sphinxbuild import runsphinx -+ args = "python3 -um sage_setup.docbuild.sphinxbuild -N".split() + build_command.split() ++ args = "python3 -um sage_docbuild.sphinxbuild -N".split() + build_command.split() try: - runsphinx() + subprocess.check_call(args) except Exception: if ABORT_ON_ERROR: raise -diff --git a/src/sage_setup/docbuild/sphinxbuild.py b/src/sage_setup/docbuild/sphinxbuild.py -index fe7eba43b2..463790965c 100644 ---- a/src/sage_setup/docbuild/sphinxbuild.py -+++ b/src/sage_setup/docbuild/sphinxbuild.py -@@ -321,3 +321,8 @@ def runsphinx(): +diff --git a/src/sage_docbuild/sphinxbuild.py b/src/sage_docbuild/sphinxbuild.py +index f58f6c61d7..ef51a55411 100644 +--- a/src/sage_docbuild/sphinxbuild.py ++++ b/src/sage_docbuild/sphinxbuild.py +@@ -326,3 +326,8 @@ def runsphinx(): sys.stderr = saved_stderr sys.stdout.flush() sys.stderr.flush() diff --git a/pkgs/applications/science/math/sage/patches/sympy-1.7-update.patch b/pkgs/applications/science/math/sage/patches/sympy-1.7-update.patch deleted file mode 100644 index 1d21622a235..00000000000 --- a/pkgs/applications/science/math/sage/patches/sympy-1.7-update.patch +++ /dev/null @@ -1,25 +0,0 @@ -diff --git a/src/sage/interfaces/sympy.py b/src/sage/interfaces/sympy.py -index cc35a42a9f..6e577d5d8d 100644 ---- a/src/sage/interfaces/sympy.py -+++ b/src/sage/interfaces/sympy.py -@@ -397,7 +397,7 @@ def _sympysage_rf(self): - sage: from sympy import Symbol, rf - sage: _ = var('x, y') - sage: rfxy = rf(Symbol('x'), Symbol('y')) -- sage: assert rising_factorial(x,y)._sympy_() == rfxy.rewrite('gamma') -+ sage: assert rising_factorial(x,y)._sympy_() == rfxy.rewrite('gamma', piecewise=False) - sage: assert rising_factorial(x,y) == rfxy._sage_() - """ - from sage.arith.all import rising_factorial -diff --git a/src/sage/symbolic/expression.pyx b/src/sage/symbolic/expression.pyx -index 7c18ec1efa..c2619ac42d 100644 ---- a/src/sage/symbolic/expression.pyx -+++ b/src/sage/symbolic/expression.pyx -@@ -955,6 +955,6 @@ cdef class Expression(CommutativeRingElement): - sage: unicode_art(13 - I) - 13 - ⅈ - sage: unicode_art(1.3 - I) -- 1.3 - 1.0⋅ⅈ -+ 1.3 - ⅈ - sage: unicode_art(cos(I)) - cosh(1) diff --git a/pkgs/applications/science/math/sage/sage-env.nix b/pkgs/applications/science/math/sage/sage-env.nix index 568a4a39f39..fd67076c97d 100644 --- a/pkgs/applications/science/math/sage/sage-env.nix +++ b/pkgs/applications/science/math/sage/sage-env.nix @@ -2,6 +2,7 @@ , lib , writeTextFile , sagelib +, sage_docbuild , env-locations , gfortran , bash @@ -191,6 +192,7 @@ writeTextFile rec { # for find_library export DYLD_LIBRARY_PATH="${lib.makeLibraryPath [stdenv.cc.libc singular]}''${DYLD_LIBRARY_PATH:+:}$DYLD_LIBRARY_PATH" ''; -} // { - lib = sagelib; # equivalent of `passthru`, which `writeTextFile` doesn't support +} // { # equivalent of `passthru`, which `writeTextFile` doesn't support + lib = sagelib; + docbuild = sage_docbuild; } diff --git a/pkgs/applications/science/math/sage/sage-src.nix b/pkgs/applications/science/math/sage/sage-src.nix index e9069725737..91e855777f0 100644 --- a/pkgs/applications/science/math/sage/sage-src.nix +++ b/pkgs/applications/science/math/sage/sage-src.nix @@ -24,14 +24,14 @@ let ); in stdenv.mkDerivation rec { - version = "9.2"; + version = "9.3.rc4"; pname = "sage-src"; src = fetchFromGitHub { owner = "sagemath"; repo = "sage"; rev = version; - sha256 = "103j8d5x6szl9fxaz0dvdi4y47q1af9h9y5hmjh2xayi62qmp5ql"; + sha256 = "sha256-LDY07By2j6JagkgT9zeDJ93+m2/oXXEnDRTDzmR8ftk="; }; # Patches needed because of particularities of nix or the way this is packaged. @@ -53,14 +53,6 @@ stdenv.mkDerivation rec { # Parallelize docubuild using subprocesses, fixing an isolation issue. See # https://groups.google.com/forum/#!topic/sage-packaging/YGOm8tkADrE ./patches/sphinx-docbuild-subprocesses.patch - - # Register sorted dict pprinter earlier (https://trac.sagemath.org/ticket/31053) - (fetchSageDiff { - base = "9.3.beta4"; - name = "register-pretty-printer-earlier.patch"; - rev = "d658230ce06ca19f4a3b3a4576297ee82f2d2151"; - sha256 = "sha256-9mPUV7K5PoLDH2vVaYaOfvDLDpmxU0Aj7m/eaXYotDs="; - }) ]; # Since sage unfortunately does not release bugfix releases, packagers must @@ -70,31 +62,6 @@ stdenv.mkDerivation rec { # To help debug the transient error in # https://trac.sagemath.org/ticket/23087 when it next occurs. ./patches/configurationpy-error-verbose.patch - - # fix intermittent errors in Sage 9.2's psage.py (this patch is - # already included in Sage 9.3): https://trac.sagemath.org/ticket/30730 - (fetchSageDiff { - base = "9.2.rc2"; - name = "fix-psage-is-locked.patch"; - rev = "75df605f216ddc7b6ca719be942d666b241520e9"; - sha256 = "0g9pl1wbb3sgs26d3bvv70cpa77sfskylv4kd255y1794f1fgk4q"; - }) - - # fix intermittent errors in sagespawn.pyx: https://trac.sagemath.org/ticket/31052 - (fetchSageDiff { - base = "9.2"; - name = "sagespawn-implicit-casting.patch"; - rev = "2959ac792ebd6107fe87c9af1541083de5ba02d6"; - sha256 = "sha256-bWIpEGir9Kawak5CJegBMNcHm/CqhWmdru+emeSsvO0="; - }) - - # fix intermittent errors in doctest/test.py: https://trac.sagemath.org/ticket/26912 - (fetchSageDiff { - base = "9.3.beta8"; - name = "set-cysignals-crash-ndebug.patch"; - rev = "ca5257a5d0f32efc9f8f07e126020856270b1a18"; - sha256 = "sha256-KViw63xE3O0eUiOYzoxNrr4NL+csql9GPJLDJCf/EZs="; - }) ]; # Patches needed because of package updates. We could just pin the versions of @@ -111,114 +78,29 @@ stdenv.mkDerivation rec { # ignore a deprecation warning for usage of `cmp` in the attrs library in the doctests ./patches/ignore-cmp-deprecation.patch - - # adapt sage's Image class to pillow 8.0.1 (https://trac.sagemath.org/ticket/30971) - (fetchSageDiff { - base = "9.3.beta2"; - name = "pillow-8.0.1-update.patch"; - rev = "f05f2d0aac9c4b5abe68105cee2cc7f2c8461847"; - sha256 = "sha256-uY2UlgSd5hhOUUukB4Xc3Gjy0/e7p/qyq9jdvz10IOs="; - }) - - # don't use deprecated numpy type aliases (https://trac.sagemath.org/ticket/31364) - (fetchSageDiff { - base = "9.3.beta7"; - name = "dont-use-deprecated-numpy-type-aliases.patch"; - rev = "dfdef60515d4a4269e82d91280f76a7fdf10bf97"; - sha256 = "sha256-77/3LkT5J7DQN8IPlGJKB6ZcJPaF7xwje06JNns+0AE="; - }) - - # fix test output with sympy 1.7 (https://trac.sagemath.org/ticket/30985) - ./patches/sympy-1.7-update.patch - - # upgrade arb to 2.18.1 (https://trac.sagemath.org/ticket/28623) - (fetchSageDiff { - base = "9.3.beta3"; - name = "arb-2.18.1-update.patch"; - rev = "0c9c4ed35c2eaf34ae0d19387c07b7f460e4abce"; - sha256 = "sha256-CjOJIsyyVCziAfvE6pWSihPO35IZMcY2/taXAsqhPLY="; - }) - - # giac 1.6.0-47 update (https://trac.sagemath.org/ticket/30537) - (fetchSageDiff { - base = "9.3.beta7"; - name = "giac-1.6.0-47-update.patch"; - rev = "f05720bf63dfaf33a4e3b6d3ed2c2c0ec46b5d31"; - sha256 = "sha256-gDUq+84eXd5GxLBWUSI61GMJpBF2KX4LBVOt3mS1NF8="; - }) - - # Make gcd/lcm interact better with pari and gmpy2 (https://trac.sagemath.org/ticket/30849) - # needed for pari 2.13.1 update, which we will do in the future - (fetchSageDiff { - base = "9.3.beta0"; - name = "make-gcd-lcm-interact-better-with-pari-and-gmpy2.patch"; - rev = "75c1516f0abb9e6f8c335e38e4031f6ef674ed30"; - sha256 = "sha256-RukkieIZcXNrju904H2oyGKdtpdE+9vNzvyjN2IBNg0="; - }) - - # cypari 2.1.2 update (https://trac.sagemath.org/ticket/31029) - (fetchSageDiff { - base = "9.3.beta3"; - name = "cypari-2.1.2-update.patch"; - rev = "b9aadfd08e81d74ca7c229bb80eb853b592887d0"; - sha256 = "sha256-eKaMy7kpu+YKdL8bPStgocxBCTfc2Z/10RrGy2LENFw="; - }) ]; patches = nixPatches ++ bugfixPatches ++ packageUpgradePatches; postPatch = '' - # make sure shebangs etc are fixed, but sage-python23 still works - find . -type f -exec sed \ - -e 's/sage-python23/python3/g' \ - -i {} \; - - echo '#!${runtimeShell} - python3 "$@"' > build/bin/sage-python23 - # Make sure sage can at least be imported without setting any environment # variables. It won't be close to feature complete though. sed -i \ - "s|var('SAGE_ROOT'.*|var('SAGE_ROOT', '$out')|" \ + "s|var(\"SAGE_ROOT\".*|var(\"SAGE_ROOT\", \"$out\")|" \ src/sage/env.py - # Do not use sage-env-config (generated by ./configure). - # Instead variables are set manually. - echo '# do nothing' > src/bin/sage-env-config - ''; + # src/doc/en/reference/spkg/conf.py expects index.rst in its directory, + # a list of external packages in the sage distribution (build/pkgs) + # generated by the bootstrap script (which we don't run). this is not + # relevant for other distributions, so remove it. + rm src/doc/en/reference/spkg/conf.py + sed -i "/spkg/d" src/doc/en/reference/index.rst - # Test src/doc/en/reference/spkg/conf.py will fail if - # src/doc/en/reference/spkg/index.rst is not generated. It is - # generated by src/doc/bootstrap, so I've copied the relevant part - # here. An alternative would be to create an empty - # src/doc/en/reference/spkg/index.rst file. - configurePhase = '' - OUTPUT_DIR="src/doc/en/reference/spkg" - mkdir -p "$OUTPUT_DIR" - OUTPUT_INDEX="$OUTPUT_DIR"/index.rst - cat > "$OUTPUT_INDEX" <> "$OUTPUT_INDEX" " $PKG_BASE" - fi - fi - done - cat >> "$OUTPUT_INDEX" < "$OUTPUT" - ${sage-with-env}/bin/sage -python -m sage_setup.docbuild \ + ${sage-with-env}/bin/sage --docbuild \ --mathjax \ --no-pdf-links \ all html diff --git a/pkgs/applications/science/math/sage/sagelib.nix b/pkgs/applications/science/math/sage/sagelib.nix index 245ddcedeee..f60cb64d2e8 100644 --- a/pkgs/applications/science/math/sage/sagelib.nix +++ b/pkgs/applications/science/math/sage/sagelib.nix @@ -63,7 +63,6 @@ assert (!blas.isILP64) && (!lapack.isILP64); # `sage-tests` and will not have html docs without `sagedoc`. buildPythonPackage rec { - format = "other"; version = src.version; pname = "sagelib"; src = sage-src; @@ -74,6 +73,7 @@ buildPythonPackage rec { jupyter_core pkg-config pip # needed to query installed packages + ecl ]; buildInputs = [ @@ -130,7 +130,7 @@ buildPythonPackage rec { sqlite ]; - buildPhase = '' + preBuild = '' export SAGE_ROOT="$PWD" export SAGE_LOCAL="$SAGE_ROOT" export SAGE_SHARE="$SAGE_LOCAL/share" @@ -146,15 +146,13 @@ buildPythonPackage rec { mkdir -p "$SAGE_SHARE/sage/ext/notebook-ipython" mkdir -p "var/lib/sage/installed" - source build/bin/sage-dist-helpers - cd src - - ${python.interpreter} -u setup.py --no-user-cfg build + # src/setup.py should not be used, see https://trac.sagemath.org/ticket/31377#comment:124 + cd build/pkgs/sagelib/src ''; - installPhase = '' - ${python.interpreter} -u setup.py --no-user-cfg install --prefix=$out - + postInstall = '' rm -r "$out/${python.sitePackages}/sage/cython_debug" ''; + + doCheck = false; # we will run tests in sage-tests.nix } From 603707a13707435f130f15bd0265e03fed20734f Mon Sep 17 00:00:00 2001 From: Attila Lendvai Date: Tue, 20 Apr 2021 12:50:08 +0200 Subject: [PATCH 12/40] nixos/doc/manual: refine extraLayouts, add warnings an test commands --- nixos/doc/manual/configuration/x-windows.xml | 43 ++++++++++++++------ 1 file changed, 30 insertions(+), 13 deletions(-) diff --git a/nixos/doc/manual/configuration/x-windows.xml b/nixos/doc/manual/configuration/x-windows.xml index a499f0080d7..757174c5263 100644 --- a/nixos/doc/manual/configuration/x-windows.xml +++ b/nixos/doc/manual/configuration/x-windows.xml @@ -204,18 +204,18 @@ XKB keyboard layouts using the option - . + . + + As a first example, we are going to create a layout based on the basic US layout, with an additional layer to type some greek symbols by pressing the right-alt key. - To do this we are going to create a us-greek file - with a xkb_symbols section. + Create a file called us-greek with the following + content (under a directory called symbols; it's + an XKB peculiarity that will help with testing): xkb_symbols "us-greek" @@ -231,14 +231,13 @@ xkb_symbols "us-greek" }; - To install the layout, the filepath, a description and the list of - languages must be given: + A minimal layout specification must include the following: .us-greek = { description = "US layout with alt-gr greek"; languages = [ "eng" ]; - symbolsFile = /path/to/us-greek; + symbolsFile = /yourpath/symbols/us-greek; } @@ -248,9 +247,27 @@ xkb_symbols "us-greek" - The layout should now be installed and ready to use: try it by - running setxkbmap us-greek and type - <alt>+a. To change the default the usual + Applying this customization requires rebuilding several packages, + and a broken XKB file can lead to the X session crashing at login. + Therefore, you're strongly advised to test + your layout before applying it: + +$ nix-shell -p xorg.xkbcomp +$ setxkbmap -I/yourpath us-greek -print | xkbcomp -I/yourpath - $DISPLAY + + + + You can inspect the predefined XKB files for examples: + +$ echo "$(nix-build --no-out-link '<nixpkgs>' -A xorg.xkeyboardconfig)/etc/X11/xkb/" + + + + Once the configuration is applied, and you did a logout/login + cycle, the layout should be ready to use. You can try it by e.g. + running setxkbmap us-greek and then type + <alt>+a (it may not get applied in your + terminal straight away). To change the default, the usual