summary refs log tree commit diff
path: root/pkgs/applications/science
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/applications/science')
-rw-r--r--pkgs/applications/science/biology/exonerate/default.nix25
-rw-r--r--pkgs/applications/science/biology/picard-tools/default.nix4
-rw-r--r--pkgs/applications/science/biology/prodigal/default.nix26
-rw-r--r--pkgs/applications/science/electronics/verilog/default.nix12
-rw-r--r--pkgs/applications/science/logic/symbiyosys/default.nix8
-rw-r--r--pkgs/applications/science/math/gap/default.nix27
-rw-r--r--pkgs/applications/science/math/sage/env-locations.nix1
-rw-r--r--pkgs/applications/science/math/sage/patches/do-not-test-find-library.patch95
-rw-r--r--pkgs/applications/science/math/sage/patches/do-not-test-package-manifests.patch26
-rw-r--r--pkgs/applications/science/math/sage/patches/giac-1.5.0.patch14
-rw-r--r--pkgs/applications/science/math/sage/patches/ignore-pip-deprecation.patch22
-rw-r--r--pkgs/applications/science/math/sage/patches/revert-sphinx-always-fork.patch71
-rw-r--r--pkgs/applications/science/math/sage/sage-src.nix96
-rw-r--r--pkgs/applications/science/math/sage/sagedoc.nix3
-rw-r--r--pkgs/applications/science/math/sage/sagelib.nix4
-rw-r--r--pkgs/applications/science/programming/groove/default.nix54
16 files changed, 290 insertions, 198 deletions
diff --git a/pkgs/applications/science/biology/exonerate/default.nix b/pkgs/applications/science/biology/exonerate/default.nix
new file mode 100644
index 00000000000..1dd6b44692a
--- /dev/null
+++ b/pkgs/applications/science/biology/exonerate/default.nix
@@ -0,0 +1,25 @@
+{ stdenv, fetchurl, glib, pkgconfig }:
+
+stdenv.mkDerivation rec {
+  version = "2.4.0";
+  pname = "exonerate";
+
+  src = fetchurl {
+    url = "http://ftp.ebi.ac.uk/pub/software/vertebrategenomics/exonerate/${pname}-${version}.tar.gz";
+    sha256 = "0hj0m9xygiqsdxvbg79wq579kbrx1mdrabi2bzqz2zn9qwfjcjgq";
+  };
+
+  doCheck = true;
+
+  buildInputs = [ glib ];
+
+  nativeBuildInputs = [ pkgconfig ];
+
+  meta = with stdenv.lib; {
+    description = "Generic tool for sequence alignment";
+    homepage = https://www.ebi.ac.uk/about/vertebrate-genomics/software/exonerate;
+    license = licenses.gpl3;
+    maintainers = [ maintainers.bzizou ];
+    platforms = platforms.unix ;
+  };
+}
diff --git a/pkgs/applications/science/biology/picard-tools/default.nix b/pkgs/applications/science/biology/picard-tools/default.nix
index 5a17b547b87..55b01bd7ec9 100644
--- a/pkgs/applications/science/biology/picard-tools/default.nix
+++ b/pkgs/applications/science/biology/picard-tools/default.nix
@@ -2,11 +2,11 @@
 
 stdenv.mkDerivation rec {
   name = "picard-tools-${version}";
-  version = "2.18.27";
+  version = "2.19.0";
 
   src = fetchurl {
     url = "https://github.com/broadinstitute/picard/releases/download/${version}/picard.jar";
-    sha256 = "1pc9mhp35n0dl7j06c1564b797v6iqg6vhmd2xxvysc96hnsbyvc";
+    sha256 = "0l2riidd9p84axj8h7fnrbwgpcpizj74i9mnm3pcqm9vlzvw6zzr";
   };
 
   nativeBuildInputs = [ makeWrapper ];
diff --git a/pkgs/applications/science/biology/prodigal/default.nix b/pkgs/applications/science/biology/prodigal/default.nix
new file mode 100644
index 00000000000..653f4390488
--- /dev/null
+++ b/pkgs/applications/science/biology/prodigal/default.nix
@@ -0,0 +1,26 @@
+{ stdenv, fetchFromGitHub }:
+
+stdenv.mkDerivation rec {
+  pname = "prodigal";
+  version = "2.6.3";
+
+  src = fetchFromGitHub {
+    repo = "Prodigal";
+    owner = "hyattpd";
+    rev = "v${version}";
+    sha256 = "1fs1hqk83qjbjhrvhw6ni75zakx5ki1ayy3v6wwkn3xvahc9hi5s";
+  };
+
+  makeFlags = [
+    "CC=cc"
+    "INSTALLDIR=$(out)/bin"
+  ];
+  
+  meta = with stdenv.lib; {
+    description = "Fast, reliable protein-coding gene prediction for prokaryotic genomes";
+    homepage = https://github.com/hyattpd/Prodigal;
+    license = licenses.gpl3;
+    platforms = platforms.all;
+    maintainers = with maintainers; [ luispedro ];
+  };
+}
diff --git a/pkgs/applications/science/electronics/verilog/default.nix b/pkgs/applications/science/electronics/verilog/default.nix
index c4268b54c20..83352df18e6 100644
--- a/pkgs/applications/science/electronics/verilog/default.nix
+++ b/pkgs/applications/science/electronics/verilog/default.nix
@@ -2,15 +2,17 @@
 
 stdenv.mkDerivation rec {
   name = "iverilog-${version}";
-  version = "2018.12.15";
+  version = "2019.03.27";
 
   src = fetchFromGitHub {
-    owner = "steveicarus";
-    repo = "iverilog";
-    rev = "7cd078e7ab184069b3b458fe6df7e83962254816";
-    sha256 = "1zc7lsa77dbsxjfz7vdgclmg97r0kw08xss7yfs4vyv5v5gnn98d";
+    owner  = "steveicarus";
+    repo   = "iverilog";
+    rev    = "a9388a895eb85a9d7f2924b89f839f94e1b6d7c4";
+    sha256 = "01d48sy3pzg9x1xpczqrsii2ckrvgnrfj720wiz22jdn90nirhhr";
   };
 
+  enableParallelBuilding = true;
+
   patchPhase = ''
     chmod +x $PWD/autoconf.sh
     $PWD/autoconf.sh
diff --git a/pkgs/applications/science/logic/symbiyosys/default.nix b/pkgs/applications/science/logic/symbiyosys/default.nix
index 88f888ed04f..f58c820d22b 100644
--- a/pkgs/applications/science/logic/symbiyosys/default.nix
+++ b/pkgs/applications/science/logic/symbiyosys/default.nix
@@ -2,13 +2,13 @@
 
 stdenv.mkDerivation rec {
   name = "symbiyosys-${version}";
-  version = "2019.03.28";
+  version = "2019.04.18";
 
   src = fetchFromGitHub {
     owner  = "yosyshq";
     repo   = "symbiyosys";
-    rev    = "44869656b86993e7ebdc59e7b27191f3ecf119dc";
-    sha256 = "1p18yzcadn91xzmqrg5xkwfl3p9mnlps57simz7dkkxzcqzjybvn";
+    rev    = "b1de59032ef3de35e56fa420a914c2f14d2495e4";
+    sha256 = "0zci1n062csswl5xxjh9fwq09p9clv95ckag3yywxq06hnqzx0r7";
   };
 
   buildInputs = [ python3 yosys ];
@@ -30,7 +30,7 @@ stdenv.mkDerivation rec {
   meta = {
     description = "Tooling for Yosys-based verification flows";
     homepage    = https://symbiyosys.readthedocs.io/;
-    license     = stdenv.lib.licenses.mit;
+    license     = stdenv.lib.licenses.isc;
     maintainers = with stdenv.lib.maintainers; [ thoughtpolice ];
     platforms   = stdenv.lib.platforms.unix;
   };
diff --git a/pkgs/applications/science/math/gap/default.nix b/pkgs/applications/science/math/gap/default.nix
index e1235387814..6beb87e9f02 100644
--- a/pkgs/applications/science/math/gap/default.nix
+++ b/pkgs/applications/science/math/gap/default.nix
@@ -62,11 +62,11 @@ in
 stdenv.mkDerivation rec {
   pname = "gap";
   # https://www.gap-system.org/Releases/
-  version = "4.10.0";
+  version = "4.10.1";
 
   src = fetchurl {
     url = "https://www.gap-system.org/pub/gap/gap-${lib.versions.major version}.${lib.versions.minor version}/tar.bz2/gap-${version}.tar.bz2";
-    sha256 = "1dmb8v4p7j1nnf7sx8sg54b49yln36bi9acwp7w1d3a1nxj17ird";
+    sha256 = "136s0zvhcw41fshj5zgsrjcy2kd58cdh2m3ddp5rdizi4rx54f10";
   };
 
   # remove all non-essential packages (which take up a lot of space)
@@ -86,25 +86,11 @@ stdenv.mkDerivation rec {
   ];
 
   patches = [
-    # bugfix: https://github.com/gap-system/gap/pull/3102
+    # https://github.com/gap-system/gap/pull/3294
     (fetchpatch {
-      name = "fix-infinite-loop-in-writeandcheck.patch";
-      url = "https://git.sagemath.org/sage.git/plain/build/pkgs/gap/patches/0001-a-version-of-the-writeandcheck.patch-from-Sage-that-.patch?id=5e61d7b6a0da3aa53d8176fa1fb9353cc559b098";
-      sha256 = "1zkv8bbiw3jdn54sqqvfkdkfsd7jxzq0bazwsa14g4sh2265d28j";
-    })
-
-    # needed for libgap (sage): https://github.com/gap-system/gap/pull/3043
-    (fetchpatch {
-      name = "add-error-messages-helper.patch";
-      url = "https://git.sagemath.org/sage.git/plain/build/pkgs/gap/patches/0002-kernel-add-helper-function-for-writing-error-message.patch?id=5e61d7b6a0da3aa53d8176fa1fb9353cc559b098";
-      sha256 = "0c4ry5znb6hwwp8ld6k62yw8w6cqldflw3x49bbzizbmipfpidh5";
-    })
-
-    # needed for libgap (sage): https://github.com/gap-system/gap/pull/3096
-    (fetchpatch {
-      name = "gap-enter.patch";
-      url = "https://git.sagemath.org/sage.git/plain/build/pkgs/gap/patches/0003-Prototype-for-GAP_Enter-Leave-macros-to-bracket-use-.patch?id=5e61d7b6a0da3aa53d8176fa1fb9353cc559b098";
-      sha256 = "12fg8mb8rm6khsz1r4k3k26jrkx4q1rv13hcrfnlhn0m7iikvc3q";
+      name = "add-make-install-targets.patch";
+      url = "https://github.com/gap-system/gap/commit/3361c172e6c5ff3bb3f01ba9d6f1dd4ad42cea80.patch";
+      sha256 = "1kwp9qnfvmlbpf1c3rs6j5m2jz22rj7a4hb5x1gj9vkpiyn5pdyj";
     })
   ];
 
@@ -184,6 +170,7 @@ stdenv.mkDerivation rec {
       timokau
     ];
     platforms = platforms.all;
+    broken = stdenv.isDarwin;
     # keeping all packages increases the package size considerably, wchich
     # is why a local build is preferable in that situation. The timeframe
     # is reasonable and that way the binary cache doesn't get overloaded.
diff --git a/pkgs/applications/science/math/sage/env-locations.nix b/pkgs/applications/science/math/sage/env-locations.nix
index 8354629cab5..bda2d23b9e5 100644
--- a/pkgs/applications/science/math/sage/env-locations.nix
+++ b/pkgs/applications/science/math/sage/env-locations.nix
@@ -28,6 +28,7 @@ writeTextFile rec {
     export GPDOCDIR="${pari}/share/pari/doc"
     export SINGULARPATH='${singular}/share/singular'
     export SINGULAR_SO='${singular}/lib/libSingular.so'
+    export GAP_SO='${gap}/lib/libgap.so'
     export SINGULAR_EXECUTABLE='${singular}/bin/Singular'
     export MAXIMA_FAS='${maxima-ecl}/lib/maxima/${maxima-ecl.version}/binary-ecl/maxima.fas'
     export MAXIMA_PREFIX="${maxima-ecl}"
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
new file mode 100644
index 00000000000..3f844e1b1ef
--- /dev/null
+++ b/pkgs/applications/science/math/sage/patches/do-not-test-find-library.patch
@@ -0,0 +1,95 @@
+diff --git a/src/sage/env.py b/src/sage/env.py
+index 061b94f3f1..67cd091540 100644
+--- a/src/sage/env.py
++++ b/src/sage/env.py
+@@ -189,88 +189,13 @@ var('MAXIMA_FAS')
+ 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).
+-
+-    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
+-    case the first one found is returned.
+-
+-    This supports most *NIX variants (in which ``lib<libname>.so`` is found
+-    under ``$SAGE_LOCAL/lib``), macOS (same, but with the ``.dylib``
+-    extension), and Cygwin (under ``$SAGE_LOCAL/bin/cyg<libname>.dll``,
+-    or ``$SAGE_LOCAL/bin/cyg<libname>-*.dll`` for versioned DLLs).
+-
+-    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.
+-
+-    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: if sys.platform == 'cygwin':
+-        ....:     pattern = "*/cygSingular-*.dll"
+-        ....: elif sys.platform == 'darwin':
+-        ....:     pattern = "*/libSingular.dylib"
+-        ....: else:
+-        ....:     pattern = "*/lib*Singular.so"
+-        sage: fnmatch(lib_filename, pattern)
+-        True
+-        sage: _get_shared_lib_filename("an_absurd_lib") is None
+-        True
+-    """
+-
+-    for libname in (libname,) + additional_libnames:
+-        if sys.platform == 'cygwin':
+-            bindir = sysconfig.get_config_var('BINDIR')
+-            pats = ['cyg{}.dll'.format(libname), 'cyg{}-*.dll'.format(libname)]
+-            filenames = []
+-            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
+-            # at arbitrary.  However, practically speaking, on Cygwin, there
+-            # will only ever be one version
+-            if filenames:
+-                return filenames[-1]
+-        else:
+-            if sys.platform == 'darwin':
+-                ext = 'dylib'
+-            else:
+-                ext = 'so'
+-
+-            libdirs = [sysconfig.get_config_var('LIBDIR')]
+-            multilib = sysconfig.get_config_var('MULTILIB')
+-            if multilib:
+-                libdirs.insert(0, os.path.join(libdirs[0], multilib))
+-
+-            for libdir in libdirs:
+-                basename = 'lib{}.{}'.format(libname, ext)
+-                filename = os.path.join(libdir, basename)
+-                if os.path.exists(filename):
+-                    return filename
+-
+-    # 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)
+ 
+ # locate libgap shared object
+-GAP_SO= _get_shared_lib_filename('gap','')
++GAP_SO= '/default'
+ var('GAP_SO', GAP_SO)
+ 
+ # post process
diff --git a/pkgs/applications/science/math/sage/patches/do-not-test-package-manifests.patch b/pkgs/applications/science/math/sage/patches/do-not-test-package-manifests.patch
new file mode 100644
index 00000000000..9e3f0f5ae88
--- /dev/null
+++ b/pkgs/applications/science/math/sage/patches/do-not-test-package-manifests.patch
@@ -0,0 +1,26 @@
+diff --git a/src/sage/misc/package.py b/src/sage/misc/package.py
+index 3bca15d53b..7cf04ff8d1 100644
+--- a/src/sage/misc/package.py
++++ b/src/sage/misc/package.py
+@@ -478,16 +478,16 @@ def package_manifest(package):
+ 
+     EXAMPLES::
+ 
+-        sage: from sage.misc.package import package_manifest
+-        sage: sagetex_manifest = package_manifest('sagetex')
+-        sage: sagetex_manifest['package_name'] == 'sagetex'
++        sage: from sage.misc.package import package_manifest # optional - buildsystem
++        sage: sagetex_manifest = package_manifest('sagetex') # optional - buildsystem
++        sage: sagetex_manifest['package_name'] == 'sagetex' # optional - buildsystem
+         True
+-        sage: 'files' in sagetex_manifest
++        sage: 'files' in sagetex_manifest # optional - buildsystem
+         True
+ 
+     Test a nonexistent package::
+ 
+-        sage: package_manifest('dummy-package')
++        sage: package_manifest('dummy-package') # optional - buildsystem
+         Traceback (most recent call last):
+         ...
+         KeyError: 'dummy-package'
diff --git a/pkgs/applications/science/math/sage/patches/giac-1.5.0.patch b/pkgs/applications/science/math/sage/patches/giac-1.5.0.patch
deleted file mode 100644
index 58090b241d2..00000000000
--- a/pkgs/applications/science/math/sage/patches/giac-1.5.0.patch
+++ /dev/null
@@ -1,14 +0,0 @@
---- a/src/sage/interfaces/giac.py	2018-12-08 22:11:56.285500644 +0100
-+++ b/src/sage/interfaces/giac.py	2018-12-08 22:11:56.285500644 +0100
-@@ -617,10 +617,7 @@
-             '4\n3'
-             sage: s='g(x):={\nx+1;\nx+2;\n}'
-             sage: giac(s)
--            (x)->{
--            x+1;
--            x+2;
--            }
-+            (x)->[x+1,x+2]
-             sage: giac.g(5)
-             7
-         """
diff --git a/pkgs/applications/science/math/sage/patches/ignore-pip-deprecation.patch b/pkgs/applications/science/math/sage/patches/ignore-pip-deprecation.patch
deleted file mode 100644
index 95b377dc955..00000000000
--- a/pkgs/applications/science/math/sage/patches/ignore-pip-deprecation.patch
+++ /dev/null
@@ -1,22 +0,0 @@
-diff --git a/src/sage/misc/package.py b/src/sage/misc/package.py
-index 689e5a23b9..4e16fe3a8d 100644
---- a/src/sage/misc/package.py
-+++ b/src/sage/misc/package.py
-@@ -142,9 +142,14 @@ def pip_installed_packages():
-         sage: d['beautifulsoup']   # optional - beautifulsoup
-         u'...'
-     """
--    proc = subprocess.Popen(["pip", "list", "--no-index", "--format", "json"], stdout=subprocess.PIPE)
--    stdout = proc.communicate()[0].decode()
--    return {package['name'].lower():package['version'] for package in json.loads(stdout)}
-+    with open(os.devnull, 'w')  as devnull:
-+        proc = subprocess.Popen(
-+            ["pip", "list", "--no-index", "--format", "json"],
-+            stdout=subprocess.PIPE,
-+            stderr=devnull,
-+        )
-+        stdout = proc.communicate()[0].decode()
-+        return {package['name'].lower():package['version'] for package in json.loads(stdout)}
- 
- def list_packages(*pkg_types, **opts):
-     r"""
diff --git a/pkgs/applications/science/math/sage/patches/revert-sphinx-always-fork.patch b/pkgs/applications/science/math/sage/patches/revert-sphinx-always-fork.patch
deleted file mode 100644
index 64dd6fd9377..00000000000
--- a/pkgs/applications/science/math/sage/patches/revert-sphinx-always-fork.patch
+++ /dev/null
@@ -1,71 +0,0 @@
-commit f1c59929c3c180ac283334c2b3c901ac8c82f6b1
-Author: Timo Kaufmann <timokau@zoho.com>
-Date:   Sat Oct 20 20:07:41 2018 +0200
-
-    Revert "Something related to the sphinxbuild seems to be leaking memory"
-    
-    This reverts commit 7d85dc796c58c3de57401bc22d3587b94e205091.
-
-diff --git a/src/sage_setup/docbuild/__init__.py b/src/sage_setup/docbuild/__init__.py
-index 0b24b1a60b..084c3f89d7 100644
---- a/src/sage_setup/docbuild/__init__.py
-+++ b/src/sage_setup/docbuild/__init__.py
-@@ -265,29 +265,35 @@ class DocBuilder(object):
-     # import the customized builder for object.inv files
-     inventory = builder_helper('inventory')
- 
--def build_many(target, args):
--    # Pool() uses an actual fork() to run each new instance. This is important
--    # for performance reasons, i.e., don't use a forkserver when it becomes
--    # available with Python 3: Here, sage is already initialized which is quite
--    # costly, with a forkserver we would have to reinitialize it for every
--    # document we build. At the same time, don't serialize this by taking the
--    # pool (and thus the call to fork()) out completely: The call to Sphinx
--    # leaks memory, so we need to build each document in its own process to
--    # control the RAM usage.
--    from multiprocessing import Pool
--    pool = Pool(NUM_THREADS, maxtasksperchild=1)
--    # map_async handles KeyboardInterrupt correctly. Plain map and
--    # apply_async does not, so don't use it.
--    x = pool.map_async(target, args, 1)
--    try:
--        ret = x.get(99999)
--        pool.close()
--        pool.join()
--    except Exception:
--        pool.terminate()
--        if ABORT_ON_ERROR:
--            raise
--    return ret
-+if NUM_THREADS > 1:
-+    def build_many(target, args):
-+        from multiprocessing import Pool
-+        pool = Pool(NUM_THREADS, maxtasksperchild=1)
-+        # map_async handles KeyboardInterrupt correctly. Plain map and
-+        # apply_async does not, so don't use it.
-+        x = pool.map_async(target, args, 1)
-+        try:
-+            ret = x.get(99999)
-+            pool.close()
-+            pool.join()
-+        except Exception:
-+            pool.terminate()
-+            if ABORT_ON_ERROR:
-+                raise
-+        return ret
-+else:
-+    def build_many(target, args):
-+        results = []
-+
-+        for arg in args:
-+            try:
-+                results.append(target(arg))
-+            except Exception:
-+                if ABORT_ON_ERROR:
-+                    raise
-+
-+        return results
-+
- 
- ##########################################
- #      Parallel Building Ref Manual      #
diff --git a/pkgs/applications/science/math/sage/sage-src.nix b/pkgs/applications/science/math/sage/sage-src.nix
index e14d24cf70e..c729e441c1c 100644
--- a/pkgs/applications/science/math/sage/sage-src.nix
+++ b/pkgs/applications/science/math/sage/sage-src.nix
@@ -10,14 +10,14 @@
 # all get the same sources with the same patches applied.
 
 stdenv.mkDerivation rec {
-  version = "8.6";
-  name = "sage-src-${version}";
+  version = "8.7";
+  pname = "sage-src";
 
   src = fetchFromGitHub {
     owner = "sagemath";
     repo = "sage";
     rev = version;
-    sha256 = "1vs3pbgbqpg0qnwr018bqsdmm7crgjp310cx8zwh7za3mv1cw5j3";
+    sha256 = "05vvrd6syh0hlmrk6kzjrwd0hpmvxp8vr8p3mkjb0jh5p2kjdd27";
   };
 
   # Patches needed because of particularities of nix or the way this is packaged.
@@ -37,12 +37,6 @@ stdenv.mkDerivation rec {
     # https://github.com/python/cpython/pull/7476
     ./patches/python-5755-hotpatch.patch
 
-    # Revert the commit that made the sphinx build fork even in the single thread
-    # case. For some yet unknown reason, that breaks the docbuild on nix and archlinux.
-    # See https://groups.google.com/forum/#!msg/sage-packaging/VU4h8IWGFLA/mrmCMocYBwAJ.
-    # https://trac.sagemath.org/ticket/26608
-    ./patches/revert-sphinx-always-fork.patch
-
     # Make sure py2/py3 tests are only run when their expected context (all "sage"
     # tests) are also run. That is necessary to test dochtml individually. See
     # https://trac.sagemath.org/ticket/26110 for an upstream discussion.
@@ -59,6 +53,21 @@ stdenv.mkDerivation rec {
       sha256 = "07p9i0fwjgapmfvmi436yn6v60p8pvmxqjc93wsssqgh5kd8qw3n";
       stripLen = 1;
     })
+
+    # Part of the build system. Should become unnecessary with sage 8.8.
+    # Upstream discussion here: https://trac.sagemath.org/ticket/27124#comment:33
+    ./patches/do-not-test-package-manifests.patch
+
+    # Not necessary since library location is set explicitly
+    # https://trac.sagemath.org/ticket/27660#ticket
+    ./patches/do-not-test-find-library.patch
+
+    # https://trac.sagemath.org/ticket/27697#ticket
+    (fetchpatch {
+      name = "pplpy-doc-location-configurable.patch";
+      url = "https://git.sagemath.org/sage.git/patch/?h=c4d966e7cb0c7b87c55d52dc6f46518433a2a0a2";
+      sha256 = "0pqbbsx8mriwny422s9mp3z5d095cnam32sm62q4mxk8g8jb9vm9";
+    })
   ];
 
   # Since sage unfortunately does not release bugfix releases, packagers must
@@ -72,12 +81,6 @@ stdenv.mkDerivation rec {
       url = "https://git.sagemath.org/sage.git/patch?id2=10407524b18659e14e184114b61c043fb816f3c2&id=c9b0cc9d0b8748ab85e568f8f57f316c5e8cbe54";
       sha256 = "0wgp7yvn9sm1ynlhcr4l0hzmvr2n28llg4xc01p6k1zz4im64c17";
     })
-    # https://trac.sagemath.org/ticket/27224
-    (fetchpatch {
-      name = "sig_on_in_matrix_misc.patch";
-      url = "https://git.sagemath.org/sage.git/patch?id=85d25bf2eb73f7d3c6de4ee6222b0c399be43b07";
-      sha256 = "1ciwhh57pnb9b4i8m3vb07wfsibsay5sg0jp5giq1pzc5zc79a4p";
-    })
   ];
 
   # Patches needed because of package updates. We could just pin the versions of
@@ -110,52 +113,12 @@ stdenv.mkDerivation rec {
       stripLen = 1;
     })
 
-    # https://trac.sagemath.org/ticket/26315
-    ./patches/giac-1.5.0.patch
-
-    # https://trac.sagemath.org/ticket/26442
-    (fetchSageDiff {
-      name = "cypari2-2.0.3.patch";
-      base = "8.6.rc1";
-      rev = "cd62d45bcef93fb4f7ed62609a46135e6de07051";
-      sha256 = "08l2b9w0rn1zrha6188j72f7737xs126gkgmydjd31baa6367np2";
-    })
-
-    # https://trac.sagemath.org/ticket/26949
-    (fetchpatch {
-      name = "sphinx-1.8.3-dependency.patch";
-      url = "https://git.sagemath.org/sage.git/patch?id=d305eda0fedc73fdbe0447b5d6d2b520b8d112c4";
-      sha256 = "1x3q5j8lq35vlj893gj5gq9fhzs60szm9r9rx6ri79yiy9apabph";
-    })
     # https://trac.sagemath.org/ticket/26451
-    (fetchpatch {
-      name = "sphinx-1.8.3.patch";
-      url = "https://git.sagemath.org/sage.git/patch?id2=0cb494282d7b4cea50aba7f4d100e7932a4c00b1&id=62b989d5ee1d9646db85ea56053cd22e9ffde5ab";
-      sha256 = "1n5c61mvhalcr2wbp66wzsynwwk59aakvx3xqa5zw9nlkx3rd0h1";
-    })
-
-    # https://trac.sagemath.org/ticket/27061
-    (fetchpatch {
-      name = "numpy-1.16-inline-fortran.patch";
-      url = "https://git.sagemath.org/sage.git/patch?id=a05b6b038e1571ab15464e98f76d1927c0c3fd12";
-      sha256 = "05yq97pq84xi60wb1p9skrad5h5x770gq98ll4frr7hvvmlwsf58";
-    })
-
-    # https://trac.sagemath.org/ticket/27405
-    ./patches/ignore-pip-deprecation.patch
-
-    # https://trac.sagemath.org/ticket/27360
-    (fetchpatch {
-      name = "eclib-20190226.patch";
-      url = "https://git.sagemath.org/sage.git/patch/?id=f570e3a7fc2965764b84c04ce301a88ded2c42df";
-      sha256 = "0l5c4giixkn15v2a06sfzq5mkxila6l67zkjbacirwprrlpcnmmp";
-    })
-
-    # https://trac.sagemath.org/ticket/27420
-    (fetchpatch {
-      name = "cypari-2.1.patch";
-      url = "https://git.sagemath.org/sage.git/patch/?id=e351bf2f2914e683d5e2028597c45ae8d1b7f855";
-      sha256 = "00faa7fl0vaqcqbw0bidkhl78qa8l34d3a07zirbcl0vm74bdn1p";
+    (fetchSageDiff {
+      name = "sphinx-1.8.patch";
+      base = "8.7";
+      rev = "737afd8f314bd1e16feaec562bb4b5efa2effa8b";
+      sha256 = "0n56ss88ds662bp49j23z5c2i6hsn3jynxw13wv76hyl0h7l1hjh";
     })
 
     # https://trac.sagemath.org/ticket/27653
@@ -164,6 +127,13 @@ stdenv.mkDerivation rec {
       url = "https://git.sagemath.org/sage.git/patch/?h=3277ba76d0ba7174608a31a0c6623e9210c63e3d";
       sha256 = "09avaanwmdgqv14mmllbgw9z2scf4lc0y0kzdhlriiq8ss9j8iir";
     })
+
+    # https://trac.sagemath.org/ticket/27094
+    (fetchpatch {
+      name = "gap-4.10.1.patch";
+      url = "https://git.sagemath.org/sage.git/patch?id=d3483110474591ea6cc8e3210cd884f3e0018b3e";
+      sha256 = "028i6h8l8npwzx5z0ax0rcywl85gc83qw1jf93zf523msdfcsk0n";
+    })
   ];
 
   patches = nixPatches ++ bugfixPatches ++ packageUpgradePatches;
@@ -177,6 +147,12 @@ stdenv.mkDerivation rec {
     echo '#!${runtimeShell}
     python "$@"' > 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_LOCAL',.*|var('SAGE_LOCAL', '$out/src')|" \
+      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
diff --git a/pkgs/applications/science/math/sage/sagedoc.nix b/pkgs/applications/science/math/sage/sagedoc.nix
index cc1a4fc61e0..91c880673a1 100644
--- a/pkgs/applications/science/math/sage/sagedoc.nix
+++ b/pkgs/applications/science/math/sage/sagedoc.nix
@@ -52,6 +52,9 @@ stdenv.mkDerivation rec {
     export HOME="$TMPDIR/sage_home"
     mkdir -p "$HOME"
 
+    # needed to link them in the sage docs using intersphinx
+    export PPLPY_DOCS=${python.pkgs.pplpy.doc}/share/doc/pplpy
+
     ${sage-with-env}/bin/sage -python -m sage_setup.docbuild \
       --mathjax \
       --no-pdf-links \
diff --git a/pkgs/applications/science/math/sage/sagelib.nix b/pkgs/applications/science/math/sage/sagelib.nix
index d7f9cb9ee32..d745532d5d7 100644
--- a/pkgs/applications/science/math/sage/sagelib.nix
+++ b/pkgs/applications/science/math/sage/sagelib.nix
@@ -47,6 +47,8 @@
 , jupyter_core
 , libhomfly
 , libbraiding
+, gmpy2
+, pplpy
 }:
 
 # This is the core sage python package. Everything else is just wrappers gluing
@@ -115,6 +117,8 @@ buildPythonPackage rec {
     cysignals
     libhomfly
     libbraiding
+    gmpy2
+    pplpy
   ];
 
   buildPhase = ''
diff --git a/pkgs/applications/science/programming/groove/default.nix b/pkgs/applications/science/programming/groove/default.nix
new file mode 100644
index 00000000000..e854f20d39a
--- /dev/null
+++ b/pkgs/applications/science/programming/groove/default.nix
@@ -0,0 +1,54 @@
+{ stdenv, fetchurl, unzip, makeWrapper, makeDesktopItem, icoutils, jre }:
+
+let
+  desktopItem = makeDesktopItem {
+    name = "groove-simulator";
+    exec = "groove-simulator";
+    icon = "groove";
+    desktopName = "GROOVE Simulator";
+    comment = "GRaphs for Object-Oriented VErification";
+    categories = "Science;ComputerScience;";
+  };
+
+in stdenv.mkDerivation rec {
+  pname = "groove";
+  version = "5.7.4";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/groove/groove/${version}/${pname}-${builtins.replaceStrings ["."] ["_"] version}-bin.zip";
+    sha256 = "1cl3xzl3n8b9a7h5pvnv31bab9j9zaw07ppk8whk8h865dcq1d10";
+  };
+
+  nativeBuildInputs = [ unzip makeWrapper icoutils ];
+
+  dontBuild = true;
+
+  installPhase = ''
+    mkdir -p $out/share/groove
+    cp -r bin lib $out/share/groove/
+
+    mkdir -p $out/share/doc/groove
+    cp CHANGES README *.pdf $out/share/doc/groove/
+
+    mkdir -p $out/bin
+    for bin in Generator Imager ModelChecker PrologChecker Simulator Viewer; do
+      makeWrapper ${jre}/bin/java $out/bin/groove-''${bin,,} \
+        --add-flags "-jar $out/share/groove/bin/$bin.jar"
+    done
+
+    mkdir -p $out/share/applications
+    ln -s ${desktopItem}/share/applications/* $out/share/applications/
+
+    mkdir -p $out/share/icons/hicolor/{16x16,32x32}/apps
+    icotool -x -i 1 -o $out/share/icons/hicolor/32x32/apps/groove.png groove-green-g.ico
+    icotool -x -i 2 -o $out/share/icons/hicolor/16x16/apps/groove.png groove-green-g.ico
+  '';
+
+  meta = with stdenv.lib; {
+    description = "GRaphs for Object-Oriented VErification";
+    homepage = http://groove.cs.utwente.nl/;
+    license = licenses.asl20;
+    platforms = platforms.all;
+    maintainers = with maintainers; [ jfrankenau ];
+  };
+}