summaryrefslogtreecommitdiff
path: root/libre/sagemath
diff options
context:
space:
mode:
authorAndré Fabian Silva Delgado <emulatorman@parabola.nu>2016-04-05 15:37:24 -0300
committerAndré Fabian Silva Delgado <emulatorman@parabola.nu>2016-04-05 15:37:24 -0300
commit6b9802f1813dc56e362046d5b803f044ce1db9df (patch)
treeb3309b84413a2a60dd230b2ad6c29cc28e600128 /libre/sagemath
parent2bbda84ecf7e687ca0ded5869d88d6fb9f770bd5 (diff)
sagemath-7.1-4.parabola1: updating version
Diffstat (limited to 'libre/sagemath')
-rw-r--r--libre/sagemath/PKGBUILD39
-rw-r--r--libre/sagemath/contour.patch11
-rw-r--r--libre/sagemath/env.patch29
-rw-r--r--libre/sagemath/gap-4.8.patch378
-rw-r--r--libre/sagemath/paths.patch8
5 files changed, 423 insertions, 42 deletions
diff --git a/libre/sagemath/PKGBUILD b/libre/sagemath/PKGBUILD
index f1b948ccb..cb4e7432b 100644
--- a/libre/sagemath/PKGBUILD
+++ b/libre/sagemath/PKGBUILD
@@ -1,4 +1,4 @@
-# $Id: PKGBUILD 165384 2016-03-06 15:37:18Z arojas $
+# $Id: PKGBUILD 169479 2016-04-04 18:15:22Z arojas $
# Maintainer (Arch): Evgeniy Alekseev <arcanis.arch at gmail dot com>
# Maintainer (Arch): Antonio Rojas <arojas@archlinux.org>
# Contributor (Arch): Daniel Wallace <danielwallace at gtmanfred dot com>
@@ -10,13 +10,13 @@
# Maintainer: André Silva <emulatorman@parabola.nu>
pkgname=sagemath
-pkgver=7.0
-pkgrel=6.parabola1
-pkgdesc="Free Mathematics Software, free software replacement of Magma, Maple, Mathematica, and Matlab, without nonfree nauty recommendation"
+pkgver=7.1
+pkgrel=4.parabola1
+pkgdesc="Free Mathematics Software, free software replacement of Magma, Maple, Mathematica, and Matlab, without nonfree nauty support"
arch=(i686 x86_64)
url="http://www.sagemath.org"
license=(GPL)
-depends=(ipython2 atlas-lapack ppl mpfi palp brial singular cliquer maxima-ecl gfan sympow tachyon python2-rpy2
+depends=(ipython2 cysignals ppl mpfi palp brial singular cliquer maxima-ecl gfan sympow tachyon python2-rpy2
python2-matplotlib python2-scipy python2-sympy python2-networkx python2-igraph libgap flintqs lcalc lrcalc lrs arb
eclib gmp-ecm zn_poly gd python2-cvxopt pynac linbox gsl rubiks pari-galdata pari-seadata-small planarity rankwidth
sage-data-combinatorial_designs sage-data-elliptic_curves sage-data-graphs sage-data-polytopes_db sage-data-conway_polynomials)
@@ -26,31 +26,29 @@ optdepends=('cython2: to compile cython code' 'jmol: 3D plots' 'sage-notebook: B
'buckygen: for generating fullerene graphs' 'plantri: for generating some classes of graphs' 'benzene: for generating fusenes and benzenoids'
'modular_decomposition: modular decomposition of graphs' 'ffmpeg: to export animations to video' 'imagemagick: to show animations'
'coxeter3: Coxeter groups implementation' 'cryptominisat: SAT solver' 'gap-data: for computing Galois groups'
- 'jupyter-notebook: Jupyter notebook interface')
-makedepends=(cython2 boost ratpoints symmetrica fflas-ffpack python2-jinja coin-or-cbc
- mcqd coxeter3 cryptominisat modular_decomposition bliss-graphs tdlib) # libfes
+ 'jupyter-notebook: Jupyter notebook interface' 'atlas-lapack: improved performance for some linear algebra operations')
+makedepends=(cython2-devel boost ratpoints symmetrica fflas-ffpack python2-jinja coin-or-cbc
+ mcqd coxeter3 cryptominisat modular_decomposition bliss-graphs tdlib python2-pkgconfig meataxe) # libfes
conflicts=(sage-mathematics)
replaces=(sage-mathematics)
provides=(sage-mathematics)
source=("$pkgname-$pkgver.tar.gz::https://github.com/sagemath/sage/archive/$pkgver.tar.gz"
pexpect.zip::"https://github.com/pexpect/pexpect/archive/524495960dd8898ddd30f7ba37298de51beee773.zip"
- ntl-no-legacy-mulmod.patch::"http://git.sagemath.org/sage.git/patch/?id=0d8435cdf"
anal.h package.patch env.patch paths.patch clean.patch skip-check.patch
- disable-fes.patch jupyter-path.patch test-optional.patch python-2.7.11.patch contour.patch)
-md5sums=('34807a7cf5dd79c008abd377ba1427fa'
+ disable-fes.patch jupyter-path.patch test-optional.patch python-2.7.11.patch gap-4.8.patch)
+md5sums=('c68e846444b9370fe79f43395cdc2725'
'a346bb2c0350c1cb17d5325235c5e38a'
- '8cd491caa5a574fb6348a02715151855'
'a906a180d198186a39820b0a2f9a9c63'
'9ba81f717ffd4e20b8b2f2a318307488'
- 'e1b1d0d2e6b187309ae2b74489356b9a'
- 'fd8e3e07f5b7318e6a7200a3c64f5bc2'
+ '21010618e80fc28582a84695a1fed0e5'
+ '0f746ed394fd7eb7a6b3963014976098'
'6d9ae0978ce6a05a0da2cafdfb178a09'
'5947a420a0b1483f0cbc74c76895789b'
'4eb23a3c7363258bc9ba764d6e5512ba'
'16b529194c6105c3364127bd8f1efa83'
'cdcabd475b80afe0534a5621e972736e'
'ef927896f2071b442b1d07d7e69f5f3a'
- '930cb987f63fd465a3a7123b0f5c2b85')
+ '8f631f4132d3a97dade07e4c60044aed')
prepare(){
cd sage-$pkgver
@@ -83,16 +81,14 @@ prepare(){
patch -p0 -i ../jupyter-path.patch
# fix timeit with Python 2.7.11
patch -p0 -i ../python-2.7.11.patch
-# fix contour plots with matplotlib 1.5.1
- patch -p0 -i ../contour.patch
# Upstream patches
# fix build against libfes 0.2 http://trac.sagemath.org/ticket/15209
# patch -p0 -i ../fes02.patch
# disable fes module, fails to compile
patch -p0 -i ../disable-fes.patch
-# port away from deprecated NTL API http://trac.sagemath.org/19874
- patch -p1 -i ../ntl-no-legacy-mulmod.patch
+# port to GAP 4.8 http://trac.sagemath.org/ticket/19911
+ patch -p1 -i ../gap-4.8.patch
# use python2
sed -e 's|#!/usr/bin/env python|#!/usr/bin/env python2|' -e 's|exec python|exec python2|' -i src/bin/*
@@ -139,7 +135,7 @@ package() {
mkdir -p "$pkgdir"/usr/bin
cp bin/sage "$pkgdir"/usr/bin
- for _i in arch-env banner cachegrind callgrind cleaner coverage coverageall CSI CSI-helper.py cython env eval grep grepdoc inline-fortran ipython \
+ for _i in arch-env banner cachegrind callgrind cleaner coverage coverageall cython env eval grep grepdoc inline-fortran ipython \
massif maxima.lisp native-execute notebook num-threads.py omega open preparse python rst2sws rst2txt run run-cython runtests startuptime.py \
sws2rst valgrind version.sh
do
@@ -153,6 +149,9 @@ package() {
# Create SAGE_SRC, needed for the notebook
mkdir "$pkgdir"/usr/share/sage/source
+# Remove sage_setup
+ rm -r "$pkgdir"/usr/lib/python2.7/site-packages/sage_setup
+
# install pexpect
cd "$srcdir"/pexpect-*
python2 setup.py install --root="$pkgdir" --optimize=1
diff --git a/libre/sagemath/contour.patch b/libre/sagemath/contour.patch
deleted file mode 100644
index f63955f8d..000000000
--- a/libre/sagemath/contour.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- src/sage/plot/contour_plot.py.orig 2016-01-20 15:01:00.077409793 +0100
-+++ src/sage/plot/contour_plot.py 2016-01-20 15:01:22.591370847 +0100
-@@ -568,7 +568,7 @@
- g.add_primitive(ContourPlot(xy_data_array, xrange, yrange, options))
- return g
-
--@options(plot_points=150, contours=(0,0), fill=False, cmap=["blue"])
-+@options(plot_points=150, contours=(0,1e-20), fill=False, cmap=["blue"])
- def implicit_plot(f, xrange, yrange, **options):
- r"""
- ``implicit_plot`` takes a function of two variables, `f(x,y)`
diff --git a/libre/sagemath/env.patch b/libre/sagemath/env.patch
index e4a1be329..96d080e23 100644
--- a/libre/sagemath/env.patch
+++ b/libre/sagemath/env.patch
@@ -43,7 +43,7 @@
# Don't execute the commands more than once for the same version of
# sage-env. Check this after checking the validity of SAGE_ROOT, but
-@@ -245,20 +211,12 @@
+@@ -245,21 +211,13 @@
fi
# Setting Sage-related location environment variables.
@@ -54,7 +54,8 @@
-export SAGE_SPKG_INST="$SAGE_LOCAL/var/lib/sage/installed"
-export SAGE_LOGS="$SAGE_ROOT/logs/pkgs"
-export SAGE_SRC="$SAGE_ROOT/src"
--export SAGE_DOC="$SAGE_SRC/doc"
+-export SAGE_DOC_SRC="$SAGE_SRC/doc"
+-export SAGE_DOC="$SAGE_SHARE/doc/sage"
-
-if [ -z "${SAGE_ORIG_PATH_SET}" ]; then
- SAGE_ORIG_PATH=$PATH && export SAGE_ORIG_PATH
@@ -66,6 +67,7 @@
+export SAGE_SHARE="$SAGE_LOCAL/share/sage"
+export SAGE_EXTCODE="$SAGE_SHARE/ext"
+export SAGE_SRC="$SAGE_SHARE/source"
++export SAGE_DOC_SRC="$SAGE_SRC/doc"
+export SAGE_DOC="/usr/share/doc/sage"
# We offer a toolchain option, so if $SAGE_LOCAL/toolchain/toolchain-env exists source it.
@@ -80,10 +82,13 @@
if [ -z "$SAGE_REPO_ANONYMOUS" ]; then
SAGE_REPO_ANONYMOUS="git://trac.sagemath.org/sage.git"
export SAGE_REPO_ANONYMOUS
-@@ -363,30 +318,17 @@
+@@ -363,38 +318,33 @@
export SAGE_STARTUP_FILE
fi
++export LIBMTX="$DOT_SAGE/meataxe"
++[[ -d $LIBMTX ]] || mkdir $LIBMTX # Create meataxe data dir
++
-IPYTHONDIR=`find "$SAGE_SPKG_INST" -name "ipython*"`
-if [ -n "$IPYTHONDIR" ]; then
- export IPYTHONDIR="$DOT_SAGE/${IPYTHONDIR##*/}"
@@ -95,19 +100,27 @@
export PYTHON_EGG_CACHE
fi
+ # Set PYTHONUSERBASE to avoid picking up non-Sage versions of
+ # Matplotlib, numpy, etc. See http://trac.sagemath.org/ticket/19612.
+ #
+ # For more history (it used to be PYTHONNOUSERSITE=yes which killed
+ # the ability to do "sage -pip install PACKAGE --user"), see
+ # http://trac.sagemath.org/ticket/14243 and
+ # http://trac.sagemath.org/ticket/18955.
+
+ if [ "$PYTHONUSERBASE" = "" ]; then
+ PYTHONUSERBASE="$DOT_SAGE/local"
+ export PYTHONUSERBASE
+ fi
+
-if [ -d "$SAGE_LOCAL/lib/python" ]; then
- PYTHONPATH="$SAGE_LOCAL/lib/python:$SAGE_LOCAL/lib/python/site_packages"
- if [ -n "$SAGE_PATH" ]; then
- PYTHONPATH="$SAGE_PATH:$PYTHONPATH"
- fi
- PYTHONHOME="$SAGE_LOCAL"
-- # Set PYTHONNOUSERSITE to avoid picking up non-Sage versions of
-- # Matplotlib, numpy, etc. See http://trac.sagemath.org/ticket/14243
-- # and http://trac.sagemath.org/ticket/18955.
-- PYTHONNOUSERSITE=yes
- export PYTHONPATH
- export PYTHONHOME
-- export PYTHONNOUSERSITE
-fi
+PYTHONPATH="/usr/lib/sage/site-packages:$PYTHONPATH"
+PYTHONHOME="$SAGE_ROOT"
diff --git a/libre/sagemath/gap-4.8.patch b/libre/sagemath/gap-4.8.patch
new file mode 100644
index 000000000..af8ed5027
--- /dev/null
+++ b/libre/sagemath/gap-4.8.patch
@@ -0,0 +1,378 @@
+diff --git a/src/ext/gap/console.g b/src/ext/gap/console.g
+index 57043ff..db8b925 100644
+--- a/src/ext/gap/console.g
++++ b/src/ext/gap/console.g
+@@ -1,6 +1,6 @@
+-# If we are loaded with a workspace then $SAGE will be defined and in
++# If we are loaded with a workspace then \$SAGE will be defined and in
+ # that case we need to call StartInteract so that the pager will be
+ # set correctly. See trac #5043.
+-if IsBound($SAGE) then
+- $SAGE.StartInteract();
++if IsBound(\$SAGE) then
++ \$SAGE.StartInteract();
+ fi;
+diff --git a/src/ext/gap/sage.g b/src/ext/gap/sage.g
+index 8535b7d..2216fda 100644
+--- a/src/ext/gap/sage.g
++++ b/src/ext/gap/sage.g
+@@ -2,15 +2,15 @@
+ #
+ # SAGE support utilities to read into the GAP session.
+ #
+-$SAGE := rec();
++\$SAGE := rec();
+
+-$SAGE.OldPager := Pager;
++\$SAGE.OldPager := Pager;
+
+
+-$SAGE.NewPager :=
++\$SAGE.NewPager :=
+ function( data )
+ local str, lines, line, fn, start;
+- str := OutputTextFile($SAGE.tempfile,false);
++ str := OutputTextFile(\$SAGE.tempfile,false);
+ start := 1;
+ if IsRecord(data) then
+ lines := data.lines;
+@@ -30,38 +30,38 @@ $SAGE.NewPager :=
+ Print("Page from ",start,"\n");
+ end;
+
+-$SAGE.StartInteract := function()
++\$SAGE.StartInteract := function()
+ MakeReadWriteGlobal("Pager");
+- Pager := $SAGE.OldPager;
+- HELP_VIEWER_INFO.screen.show := $SAGE.OldPager;
++ Pager := \$SAGE.OldPager;
++ HELP_VIEWER_INFO.screen.show := \$SAGE.OldPager;
+ MakeReadOnlyGlobal("Pager");
+ end;
+
+
+-$SAGE.StopInteract := function()
++\$SAGE.StopInteract := function()
+ MakeReadWriteGlobal("Pager");
+- Pager := $SAGE.NewPager;
+- HELP_VIEWER_INFO.screen.show := $SAGE.NewPager;
++ Pager := \$SAGE.NewPager;
++ HELP_VIEWER_INFO.screen.show := \$SAGE.NewPager;
+ MakeReadOnlyGlobal("Pager");
+ end;
+
+
+-$SAGE.StopInteract();
++\$SAGE.StopInteract();
+
+-#$SAGE.ErrorHandler := function(m,a,m2,mode)
++#\$SAGE.ErrorHandler := function(m,a,m2,mode)
+ # PrintTo("*errout*", m);
+ # if a <> fail then
+ # PrintTo("*errout*",a);
+ # fi;
+-# SetErrorHandler($SAGE.ErrorHandler);
++# SetErrorHandler(\$SAGE.ErrorHandler);
+ # return true;
+ #end;
+
+-#SetErrorHandler($SAGE.ErrorHandler);
++#SetErrorHandler(\$SAGE.ErrorHandler);
+
+ SetAllInfoLevels(0);
+
+-$SAGE.OperationsAdmittingFirstArgument := function(obj)
++\$SAGE.OperationsAdmittingFirstArgument := function(obj)
+ local hits, myflags, i, flagss, flags;
+ hits := [];
+ myflags := FlagsType(TypeObj(obj));
+@@ -78,7 +78,7 @@ $SAGE.OperationsAdmittingFirstArgument := function(obj)
+ end;
+
+
+-$SAGE.CleanOperationName := function(name)
++\$SAGE.CleanOperationName := function(name)
+ local lt, ls;
+ lt := Length("Tester(");
+ if Length(name) > lt and name{[1..lt]} = "Tester(" then
+@@ -91,7 +91,7 @@ $SAGE.CleanOperationName := function(name)
+ return name;
+ end;
+
+-$SAGE.HasAtLeastOneMethodAsFirstArgument := function(op,obj)
++\$SAGE.HasAtLeastOneMethodAsFirstArgument := function(op,obj)
+ local t, f, n, meths, i;
+ t := TypeObj(obj);
+ f := FlagsType(t);
+@@ -107,11 +107,11 @@ $SAGE.HasAtLeastOneMethodAsFirstArgument := function(op,obj)
+ end;
+
+
+-$SAGE.PlausibleTabCompletionsForSage := function(o)
++\$SAGE.PlausibleTabCompletionsForSage := function(o)
+ local ops, opnames;
+- ops := Filtered($SAGE.OperationsAdmittingFirstArgument(o), op ->
+- $SAGE.HasAtLeastOneMethodAsFirstArgument(op,o));
+- opnames := List(ops, op -> $SAGE.CleanOperationName(NameFunction(op)));
++ ops := Filtered(\$SAGE.OperationsAdmittingFirstArgument(o), op ->
++ \$SAGE.HasAtLeastOneMethodAsFirstArgument(op,o));
++ opnames := List(ops, op -> \$SAGE.CleanOperationName(NameFunction(op)));
+ return Concatenation(opnames, GLOBAL_FUNCTION_NAMES);
+ end;
+
+diff --git a/src/sage/groups/finitely_presented.py b/src/sage/groups/finitely_presented.py
+index 92a4393..fd856ef 100644
+--- a/src/sage/groups/finitely_presented.py
++++ b/src/sage/groups/finitely_presented.py
+@@ -1168,9 +1168,7 @@ class FinitelyPresentedGroup(GroupMixinLibGAP, UniqueRepresentation,
+ You can attempt to reduce the presentation of the output group::
+
+ sage: D = C2.semidirect_product(C8, hom); D
+- Finitely presented group < a, b, c, d |
+- a^2, b^-1*a^-1*b*a*d^-1*c^-1, c^-1*a^-1*c*a*d^-1, d^-1*a^-1*d*a,
+- b^2*c^-1, c^-1*b^-1*c*b, d^-1*b^-1*d*b, c^2*d^-1, d^-1*c^-1*d*c, d^2 >
++ Finitely presented group < a, b | a^2, b^8, a^-1*b*a*b >
+ sage: D = C2.semidirect_product(C8, hom, reduced=True); D
+ Finitely presented group < a, b | a^2, (a*b)^2, b^8 >
+
+@@ -1178,10 +1176,9 @@ class FinitelyPresentedGroup(GroupMixinLibGAP, UniqueRepresentation,
+ sage: C4 = groups.presentation.Cyclic(4)
+ sage: hom = (C3.gens(), [(C4.gens(), C4.gens())])
+ sage: C3.semidirect_product(C4, hom)
+- Finitely presented group < a, b, c |
+- a^3, b^-1*a^-1*b*a, c^-1*a^-1*c*a, b^2*c^-1, c^-1*b^-1*c*b, c^2 >
++ Finitely presented group < a, b | a^3, b^4, a^-1*b*a*b^-1 >
+ sage: D = C3.semidirect_product(C4, hom, reduced=True); D
+- Finitely presented group < a, b | a^3, b^4, b^-1*a^-1*b*a >
++ Finitely presented group < a, b | a^3, b^4, a^-1*b*a*b^-1 >
+ sage: D.as_permutation_group().is_cyclic()
+ True
+
+@@ -1193,9 +1190,7 @@ class FinitelyPresentedGroup(GroupMixinLibGAP, UniqueRepresentation,
+ sage: C12 = groups.presentation.Cyclic(12)
+ sage: hom = (C5.gens(), [(C12.gens(), C12.gens())])
+ sage: sp = C5.semidirect_product(C12, hom, check=False); sp
+- Finitely presented group < a, b, c, d |
+- a^5, b^-1*a^-1*b*a, c^-1*a^-1*c*a, d^-1*a^-1*d*a, b^2*d^-1,
+- c^-1*b^-1*c*b, d^-1*b^-1*d*b, c^3, d^-1*c^-1*d*c, d^2 >
++ Finitely presented group < a, b | a^5, b^12, a^-1*b*a*b^-1 >
+ sage: sp.as_permutation_group().is_cyclic(), sp.order()
+ (True, 60)
+
+diff --git a/src/sage/groups/matrix_gps/matrix_group.py b/src/sage/groups/matrix_gps/matrix_group.py
+index 698a587..3e200e6 100644
+--- a/src/sage/groups/matrix_gps/matrix_group.py
++++ b/src/sage/groups/matrix_gps/matrix_group.py
+@@ -584,19 +584,19 @@ class MatrixGroup_gap(GroupMixinLibGAP, MatrixGroup_generic, ParentLibGAP):
+ sage: i = iter(GL(6,5))
+ sage: [ next(i) for j in range(8) ]
+ [
+- [1 0 0 0 0 0] [4 0 0 0 0 1] [0 4 0 0 0 0] [0 4 0 0 0 0]
+- [0 1 0 0 0 0] [4 0 0 0 0 0] [0 0 4 0 0 0] [0 0 4 0 0 0]
+- [0 0 1 0 0 0] [0 4 0 0 0 0] [0 0 0 4 0 0] [0 0 0 4 0 0]
+- [0 0 0 1 0 0] [0 0 4 0 0 0] [0 0 0 0 4 0] [0 0 0 0 4 0]
+- [0 0 0 0 1 0] [0 0 0 4 0 0] [0 0 0 0 0 4] [0 0 0 0 0 4]
+- [0 0 0 0 0 1], [0 0 0 0 4 0], [1 4 0 0 0 0], [2 4 0 0 0 0],
++ [1 0 0 0 0 0] [2 0 0 0 0 0] [3 0 0 0 0 0] [3 2 0 0 0 0]
++ [0 1 0 0 0 0] [0 1 0 0 0 0] [0 1 0 0 0 0] [0 1 0 0 0 0]
++ [0 0 1 0 0 0] [0 0 1 0 0 0] [0 0 1 0 0 0] [0 0 1 0 0 0]
++ [0 0 0 1 0 0] [0 0 0 1 0 0] [0 0 0 1 0 0] [0 0 0 1 0 0]
++ [0 0 0 0 1 0] [0 0 0 0 1 0] [0 0 0 0 1 0] [0 0 0 0 1 0]
++ [0 0 0 0 0 1], [0 0 0 0 0 1], [0 0 0 0 0 1], [0 0 0 0 0 1],
+ <BLANKLINE>
+- [3 0 0 0 0 1] [4 0 0 1 3 3] [0 0 0 2 0 0] [1 0 0 0 4 4]
+- [3 0 0 0 0 0] [4 0 0 0 3 3] [0 0 0 0 4 0] [1 0 0 0 0 4]
+- [0 4 0 0 0 0] [3 0 0 0 0 1] [2 2 0 0 0 2] [1 0 0 0 0 0]
+- [0 0 4 0 0 0] [3 0 0 0 0 0] [1 4 0 0 0 0] [0 1 0 0 0 0]
+- [0 0 0 4 0 0] [0 4 0 0 0 0] [0 2 4 0 0 0] [0 0 1 0 0 0]
+- [4 0 0 0 2 3], [2 0 3 4 4 4], [0 0 1 4 0 0], [0 0 0 1 0 0]
++ [2 1 0 0 0 0] [3 3 0 2 3 0] [2 4 0 1 4 0] [1 2 4 1 0 3]
++ [0 1 0 0 0 0] [0 1 0 0 0 0] [0 1 0 0 0 0] [0 1 0 0 0 0]
++ [0 0 1 0 0 0] [0 0 1 0 0 0] [0 0 1 0 0 0] [0 0 1 0 0 0]
++ [0 0 0 1 0 0] [0 0 0 1 0 0] [0 0 0 1 0 0] [0 0 0 1 0 0]
++ [0 0 0 0 1 0] [0 0 0 0 1 0] [0 0 0 0 1 0] [0 0 0 0 1 0]
++ [0 0 0 0 0 1], [0 0 0 0 0 1], [0 0 0 0 0 1], [0 0 0 0 0 1]
+ ]
+
+ This is the direct computation in GAP, which will just run
+diff --git a/src/sage/groups/perm_gps/permgroup.py b/src/sage/groups/perm_gps/permgroup.py
+index 2a426f1..5295949 100644
+--- a/src/sage/groups/perm_gps/permgroup.py
++++ b/src/sage/groups/perm_gps/permgroup.py
+@@ -1548,18 +1548,23 @@ class PermutationGroup_generic(group.FiniteGroup):
+
+ EXAMPLES::
+
+- sage: SymmetricGroup(10).stabilizer(4)._order()
++ sage: G = SymmetricGroup(10).subgroup([(i, 10) for i in range(1, 10) if i != 4])
++ sage: G._order()
+ 362880
+- sage: SymmetricGroup(10).stabilizer(4).stabilizer(5)._order()
+- 40320
+- sage: SymmetricGroup(200).stabilizer(100)._order() == factorial(199) # this should be very fast
+- True
+
+ TESTS::
+
+ sage: [SymmetricGroup(n).stabilizer(1)._gap_().Size() for n in [4..10]]
+ [6, 24, 120, 720, 5040, 40320, 362880]
+- sage: [SymmetricGroup(n).stabilizer(1)._order() for n in [4..10]]
++ sage: special_gens = [
++ ....: [(3,4), (2,4)],
++ ....: [(4,5), (3,5), (2,5)],
++ ....: [(5,6), (4,6), (3,6), (2,6)],
++ ....: [(6,7), (5,7), (4,7), (3,7), (2,7)],
++ ....: [(7,8), (6,8), (5,8), (4,8), (3,8), (2,8)],
++ ....: [(8,9), (7,9), (6,9), (5,9), (4,9), (3,9), (2,9)],
++ ....: [(9,10), (8,10), (7,10), (6,10), (5,10), (4,10), (3,10), (2,10)]]
++ sage: [SymmetricGroup(n).subgroup(gen)._order() for gen in special_gens]
+ [6, 24, 120, 720, 5040, 40320, 362880]
+ """
+ gens = self.gens()
+diff --git a/src/sage/interfaces/expect.py b/src/sage/interfaces/expect.py
+index 756f701..88dbf82 100644
+--- a/src/sage/interfaces/expect.py
++++ b/src/sage/interfaces/expect.py
+@@ -1423,13 +1423,13 @@ class StdOutContext:
+ return self.interface
+
+ def __exit__(self, typ, value, tb):
+- """
++ r"""
+ EXAMPLE::
+
+ sage: from sage.interfaces.expect import StdOutContext
+ sage: with StdOutContext(gap):
+ ....: gap('1+1')
+- $sage...
++ \$sage...
+ """
+ if self.silent:
+ return
+diff --git a/src/sage/interfaces/gap.py b/src/sage/interfaces/gap.py
+index 1f446aa..198fe84 100644
+--- a/src/sage/interfaces/gap.py
++++ b/src/sage/interfaces/gap.py
+@@ -716,7 +716,7 @@ class Gap_generic(ExtraTabCompletion, Expect):
+ sage: gap.eval('quit;')
+ ''
+ sage: a = gap(3)
+- ** Gap crashed or quit executing '$sage...:=3;;' **
++ ** Gap crashed or quit executing '\$sage...:=3;;' **
+ Restarting Gap and trying again
+ sage: a
+ 3
+@@ -858,7 +858,7 @@ class Gap_generic(ExtraTabCompletion, Expect):
+ EXAMPLES::
+
+ sage: print gap.version()
+- 4.7...
++ 4.8...
+ """
+ return self.eval('VERSION')[1:-1]
+
+@@ -1162,25 +1162,29 @@ class Gap(Gap_generic):
+ return reduce_load_GAP, tuple([])
+
+ def _next_var_name(self):
+- """
++ r"""
+ Returns the next unused variable name.
+
++ Note that names starting with dollar signs are valid GAP
++ identifiers, but need to be escaped with a backslash starting
++ with GAP-4.8.
++
+ EXAMPLES::
+
+ sage: g = Gap()
+ sage: g._next_var_name()
+- '$sage1'
++ '\\$sage1'
+ sage: g(2)^2
+ 4
+ sage: g._next_var_name()
+- '$sage...'
++ '\\$sage...'
+ """
+ if len(self._available_vars) != 0:
+ v = self._available_vars[0]
+ del self._available_vars[0]
+ return v
+ self.__seq += 1
+- return '$sage%s'%self.__seq
++ return r'\$sage%s'%self.__seq
+
+ def _start(self):
+ """
+@@ -1324,7 +1328,7 @@ class Gap(Gap_generic):
+ else:
+ tmp_to_use = self._local_tmpfile()
+ self.eval('SetGAPDocTextTheme("none")')
+- self.eval('$SAGE.tempfile := "%s";'%tmp_to_use)
++ self.eval(r'\$SAGE.tempfile := "%s";'%tmp_to_use)
+ line = Expect.eval(self, "? %s"%s)
+ Expect.eval(self, "? 1")
+ match = re.search("Page from (\d+)", line)
+@@ -1384,7 +1388,7 @@ class Gap(Gap_generic):
+ sage: gap._pre_interact()
+ sage: gap._post_interact()
+ """
+- self._eval_line("$SAGE.StartInteract();")
++ self._eval_line(r'\$SAGE.StartInteract();')
+
+ def _post_interact(self):
+ """
+@@ -1393,7 +1397,7 @@ class Gap(Gap_generic):
+ sage: gap._pre_interact()
+ sage: gap._post_interact()
+ """
+- self._eval_line("$SAGE.StopInteract();")
++ self._eval_line(r'\$SAGE.StopInteract();')
+
+ def _eval_line_using_file(self, line):
+ i = line.find(':=')
+@@ -1641,7 +1645,7 @@ class GapElement(GapElement_generic):
+ """
+ from sage.misc.misc import uniq
+ P = self.parent()
+- v = P.eval('$SAGE.OperationsAdmittingFirstArgument(%s)'%self.name())
++ v = P.eval(r'\$SAGE.OperationsAdmittingFirstArgument(%s)'%self.name())
+ v = v.replace('Tester(','').replace('Setter(','').replace(')','').replace('\n', '')
+ v = v.split(',')
+ v = [ oper.split('"')[1] for oper in v ]
+diff --git a/src/sage/libs/gap/gap_includes.pxd b/src/sage/libs/gap/gap_includes.pxd
+index bd945c7..fa23ba5 100644
+--- a/src/sage/libs/gap/gap_includes.pxd
++++ b/src/sage/libs/gap/gap_includes.pxd
+@@ -131,7 +131,7 @@ cdef extern from "gap/objects.h":
+ cdef int libGAP_LAST_TESTING_TNUM
+
+ cdef extern from "gap/read.h":
+- void* libGAP_ReadEvalCommand(libGAP_Obj context)
++ void* libGAP_ReadEvalCommand(libGAP_Obj context, libGAP_UInt *dualSemicolon)
+ void* libGAP_ReadEvalFile()
+ void* libGAP_ReadEvalResult
+ bint libGAP_READ_ERROR()
+diff --git a/src/sage/libs/gap/util.pyx b/src/sage/libs/gap/util.pyx
+index 52a75be..d62b8e9 100644
+--- a/src/sage/libs/gap/util.pyx
++++ b/src/sage/libs/gap/util.pyx
+@@ -280,7 +280,7 @@ cdef libGAP_Obj gap_eval(str gap_string) except? NULL:
+ libgap_start_interaction(cmd)
+ try:
+ sig_on()
+- status = libGAP_ReadEvalCommand(libGAP_BottomLVars)
++ status = libGAP_ReadEvalCommand(libGAP_BottomLVars, NULL)
+ if status != libGAP_STATUS_END:
+ libgap_call_error_handler()
+ sig_off()
+@@ -464,7 +464,7 @@ def command(command_string):
+ libgap_start_interaction(cmd)
+ try:
+ sig_on()
+- status = libGAP_ReadEvalCommand(libGAP_BottomLVars)
++ status = libGAP_ReadEvalCommand(libGAP_BottomLVars, NULL)
+ if status != libGAP_STATUS_END:
+ libgap_call_error_handler()
+ sig_off()
diff --git a/libre/sagemath/paths.patch b/libre/sagemath/paths.patch
index 2426c07ff..12922dcc3 100644
--- a/libre/sagemath/paths.patch
+++ b/libre/sagemath/paths.patch
@@ -1,6 +1,6 @@
--- src/sage/env.py.orig 2014-06-25 10:47:25.827203554 +1200
+++ src/sage/env.py 2014-06-25 10:49:07.667402821 +1200
-@@ -87,24 +87,21 @@
+@@ -87,25 +87,22 @@
_add_variable_or_fallback('LOCAL_IDENTIFIER','$HOSTNAME.%s'%os.getpid())
# bunch of sage directories and files
@@ -25,11 +25,13 @@
-_add_variable_or_fallback('SAGE_EXTCODE', opj('$SAGE_SHARE', 'sage', 'ext'))
-_add_variable_or_fallback('SAGE_LOGS', opj('$SAGE_ROOT', 'logs', 'pkgs'))
-_add_variable_or_fallback('SAGE_SPKG_INST', opj('$SAGE_LOCAL', 'var', 'lib', 'sage', 'installed'))
--_add_variable_or_fallback('SAGE_DOC', opj('$SAGE_SRC', 'doc'))
+-_add_variable_or_fallback('SAGE_DOC_SRC', opj('$SAGE_SRC', 'doc'))
+-_add_variable_or_fallback('SAGE_DOC', opj('$SAGE_SHARE', 'doc', 'sage'))
-_add_variable_or_fallback('DOT_SAGE', opj(os.environ.get('HOME','$SAGE_ROOT'), '.sage'))
-_add_variable_or_fallback('SAGE_DOT_GIT', opj('$SAGE_ROOT', '.git'))
+_add_variable_or_fallback('SAGE_EXTCODE', opj('$SAGE_SHARE', 'ext'))
-+_add_variable_or_fallback('SAGE_DOC', '/usr/share/doc/sage')
++_add_variable_or_fallback('SAGE_DOC_SRC', opj('$SAGE_SRC', 'doc'))
++_add_variable_or_fallback('SAGE_DOC', opj('/usr/share', 'doc', 'sage'))
+_add_variable_or_fallback('DOT_SAGE', opj(os.environ.get('HOME'), '.sage'))
_add_variable_or_fallback('SAGE_DISTFILES', opj('$SAGE_ROOT', 'upstream'))