Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 4 additions & 29 deletions pkgs/applications/science/math/sage/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,30 +9,11 @@
let
inherit (pkgs) symlinkJoin callPackage nodePackages;

# https://trac.sagemath.org/ticket/15980 for tracking of python3 support
python = pkgs.python2.override {
python = pkgs.python3.override {
packageOverrides = self: super: {
# python packages that appear unmaintained and were not accepted into the nixpkgs
# tree because of that. These packages are only dependencies of the more-or-less
# deprecated sagenb. However sagenb is still a default dependency and the doctests
# depend on it.
# See https://github.com/NixOS/nixpkgs/pull/38787 for a discussion.
# The dependency on the sage notebook (and therefore these packages) will be
# removed in the future:
# https://trac.sagemath.org/ticket/25837
flask-oldsessions = self.callPackage ./flask-oldsessions.nix {};
flask-openid = self.callPackage ./flask-openid.nix {};
python-openid = self.callPackage ./python-openid.nix {};
sagenb = self.callPackage ./sagenb.nix {
mathjax = nodePackages.mathjax;
};

# Package with a cyclic dependency with sage
pybrial = self.callPackage ./pybrial.nix {};

# `sagelib`, i.e. all of sage except some wrappers and runtime dependencies
sagelib = self.callPackage ./sagelib.nix {
inherit flint ecl arb;
inherit flint arb;
inherit sage-src env-locations pynac singular;
linbox = pkgs.linbox.override { withSage = true; };
pkg-config = pkgs.pkgconfig; # not to confuse with pythonPackages.pkgconfig
Expand All @@ -59,7 +40,7 @@ let
# 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 ecl;
inherit pari_data;
inherit singular maxima-ecl;
cysignals = python.pkgs.cysignals;
three = nodePackages.three;
Expand All @@ -71,7 +52,7 @@ let
sage-env = callPackage ./sage-env.nix {
sagelib = python.pkgs.sagelib;
inherit env-locations;
inherit python ecl singular palp flint pynac pythonEnv maxima-ecl;
inherit python singular palp flint pynac pythonEnv maxima-ecl;
pkg-config = pkgs.pkgconfig; # not to confuse with pythonPackages.pkgconfig
};

Expand Down Expand Up @@ -102,8 +83,6 @@ let

pythonRuntimeDeps = with python.pkgs; [
sagelib
pybrial
sagenb
cvxopt
networkx
service-identity
Expand All @@ -129,7 +108,6 @@ let

singular = pkgs.singular.override { inherit flint; };

# https://trac.sagemath.org/ticket/26625
maxima-ecl = pkgs.maxima-ecl;

# *not* to confuse with the python package "pynac"
Expand Down Expand Up @@ -161,9 +139,6 @@ let
pari-seadata-small
];
};

# https://trac.sagemath.org/ticket/22191
ecl = pkgs.ecl_16_1_2;
in
# A wrapper around sage that makes sure sage finds its docs (if they were build).
callPackage ./sage.nix {
Expand Down
36 changes: 0 additions & 36 deletions pkgs/applications/science/math/sage/flask-oldsessions.nix

This file was deleted.

28 changes: 0 additions & 28 deletions pkgs/applications/science/math/sage/flask-openid.nix

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
From 8218bd4fdeb4c92de8af0d3aabec55980fc4fb3d Mon Sep 17 00:00:00 2001
From f5ea42a7aaed7611fb55b65897b9fcf2b7bcf97e Mon Sep 17 00:00:00 2001
From: Timo Kaufmann <timokau@zoho.com>
Date: Sun, 21 Oct 2018 17:52:40 +0200
Subject: [PATCH] Only test py2/py3 optional tests when all of sage is tested

---
src/sage/doctest/control.py | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
src/sage/doctest/control.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/sage/doctest/control.py b/src/sage/doctest/control.py
index bf18df8b2b..935c67abf7 100644
index 2d93841e50..6d156e29a1 100644
--- a/src/sage/doctest/control.py
+++ b/src/sage/doctest/control.py
@@ -362,7 +362,8 @@ class DocTestController(SageObject):
@@ -375,7 +375,8 @@ class DocTestController(SageObject):
if not optionaltag_regex.search(o):
raise ValueError('invalid optional tag {!r}'.format(o))

Expand All @@ -21,15 +21,6 @@ index bf18df8b2b..935c67abf7 100644

self.options = options

@@ -765,7 +766,7 @@ class DocTestController(SageObject):
sage: DC = DocTestController(DD, [dirname])
sage: DC.expand_files_into_sources()
sage: sorted(DC.sources[0].options.optional) # abs tol 1
- ['guava', 'magma', 'py2']
+ ['guava', 'magma']

We check that files are skipped appropriately::

--
2.18.1
2.28.0

Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
diff --git a/src/sage/env.py b/src/sage/env.py
index 061b94f3f1..67cd091540 100644
index 1ddfc7cfb9..45033d6328 100644
--- a/src/sage/env.py
+++ b/src/sage/env.py
@@ -189,88 +189,13 @@ var('MAXIMA_FAS')
@@ -203,97 +203,13 @@ var('ARB_LIBRARY', 'arb')
var('SAGE_BANNER', '')
var('SAGE_IMPORTALL', 'yes')

-
-def _get_shared_lib_filename(libname, *additional_libnames):
- """
- Return the full path to a shared library file installed in the standard
- location for the system within the ``LIBDIR`` prefix (or
- ``$SAGE_LOCAL/lib`` in the case of manual build of Sage).
- Return the full path to a shared library file installed in
- ``$SAGE_LOCAL/lib`` or the directories associated with the
- Python sysconfig.
-
- This can also be passed more than one library name (e.g. for cases where
- some library may have multiple names depending on the platform) in which
Expand All @@ -25,7 +25,7 @@ index 061b94f3f1..67cd091540 100644
- For distributions like Debian that use a multiarch layout, we also try the
- multiarch lib paths (i.e. ``/usr/lib/<arch>/``).
-
- Returns ``None`` if the file does not exist.
- This returns ``None`` if the file does not exist.
-
- EXAMPLES::
-
Expand All @@ -48,11 +48,17 @@ index 061b94f3f1..67cd091540 100644
-
- for libname in (libname,) + additional_libnames:
- if sys.platform == 'cygwin':
- bindir = sysconfig.get_config_var('BINDIR')
- # 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')
- ]
- pats = ['cyg{}.dll'.format(libname), 'cyg{}-*.dll'.format(libname)]
- filenames = []
- for pat in pats:
- filenames += glob.glob(os.path.join(bindir, pat))
- 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
- # versions for the same library this just selects one more or less
Expand All @@ -66,10 +72,13 @@ index 061b94f3f1..67cd091540 100644
- else:
- ext = 'so'
-
- libdirs = [sysconfig.get_config_var('LIBDIR')]
- libdirs = [
- os.path.join(SAGE_LOCAL, 'lib'),
- sysconfig.get_config_var('LIBDIR')
- ]
- multilib = sysconfig.get_config_var('MULTILIB')
- if multilib:
- libdirs.insert(0, os.path.join(libdirs[0], multilib))
- libdirs.insert(1, os.path.join(libdirs[0], multilib))
-
- for libdir in libdirs:
- basename = 'lib{}.{}'.format(libname, ext)
Expand All @@ -89,7 +98,7 @@ index 061b94f3f1..67cd091540 100644

# locate libgap shared object
-GAP_SO= _get_shared_lib_filename('gap','')
+GAP_SO= '/default'
+GAP_SO = '/default'
var('GAP_SO', GAP_SO)

# post process
24 changes: 0 additions & 24 deletions pkgs/applications/science/math/sage/patches/docutils-0.15.patch

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
diff --git a/src/sage/tests/cmdline.py b/src/sage/tests/cmdline.py
index bd6b76ab82..ccf1203dec 100644
index 6e034dcb5a..8ec60ec72b 100644
--- a/src/sage/tests/cmdline.py
+++ b/src/sage/tests/cmdline.py
@@ -837,8 +837,6 @@ def test_executable(args, input="", timeout=100.0, **kwds):
@@ -660,8 +660,8 @@ def test_executable(args, input="", timeout=100.0, pydebug_ignore_warnings=False
sage: with open(input, 'w') as F:
....: _ = F.write(s)
sage: L = ["sage", "--rst2ipynb", input, output]
- sage: test_executable(L) # optional - rst2ipynb
- ('', '', 0)
+ sage: test_executable(L)[2] # optional - rst2ipynb
+ 0
sage: import json # optional - rst2ipynb
sage: d = json.load(open(output,'r')) # optional - rst2ipynb
sage: type(d) # optional - rst2ipynb
@@ -757,8 +757,6 @@ def test_executable(args, input="", timeout=100.0, pydebug_ignore_warnings=False
///
4
}}}
- sage: err # py2
- sage: err # py2 # optional -- sagenb
- ''
sage: ret
sage: ret # py2 # optional -- sagenb
0

@@ -871,8 +869,8 @@ def test_executable(args, input="", timeout=100.0, **kwds):
sage: output = tmp_filename(ext='.sws')
sage: with open(input, 'w') as F:
....: _ = F.write(s)
- sage: test_executable(["sage", "--rst2sws", input, output]) # py2
- ('', '', 0)
+ sage: test_executable(["sage", "--rst2sws", input, output])[2] # py2
+ 0
sage: import tarfile # py2
sage: f = tarfile.open(output, 'r') # py2
sage: print(f.extractfile('sage_worksheet/worksheet.html').read()) # py2

This file was deleted.

20 changes: 0 additions & 20 deletions pkgs/applications/science/math/sage/patches/pari-stackwarn.patch

This file was deleted.

This file was deleted.

Loading