summaryrefslogtreecommitdiff
path: root/libre/sagemath
diff options
context:
space:
mode:
Diffstat (limited to 'libre/sagemath')
-rw-r--r--libre/sagemath/PKGBUILD31
-rw-r--r--libre/sagemath/c_lib.patch17
-rw-r--r--libre/sagemath/cython-0.23.patch16
-rw-r--r--libre/sagemath/ipython-4.patch35
-rw-r--r--libre/sagemath/kernel.json1
5 files changed, 76 insertions, 24 deletions
diff --git a/libre/sagemath/PKGBUILD b/libre/sagemath/PKGBUILD
index e121efc5f..872ceceb7 100644
--- a/libre/sagemath/PKGBUILD
+++ b/libre/sagemath/PKGBUILD
@@ -11,34 +11,35 @@
pkgname=sagemath
pkgver=6.8
-pkgrel=1.parabola1
+pkgrel=3.parabola1
pkgdesc="Free Mathematics Software, free software replacement of Magma, Maple, Mathematica, and Matlab, without nonfree nauty recommendation"
arch=(i686 x86_64)
url="http://www.sagemath.org"
license=(GPL)
-depends=(ipython2 ppl glpk mpfi palp polybori singular libcliquer maxima-ecl gfan sympow tachyon python2-rpy2
+depends=(ipython2 ppl mpfi palp polybori singular libcliquer maxima-ecl gfan sympow tachyon python2-rpy2
python2-matplotlib python2-scipy python2-sympy python2-networkx libgap gap flintqs lcalc lrcalc
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)
optdepends=('cython2: to compile cython code' 'jmol: 3D plots' 'sage-notebook: Browser-based (flask) notebook interface'
- 'sagemath-doc: Documentation and inline help' 'ipython2-notebook: IPython notebook interface' 'mathjax: IPython notebook interface'
+ 'sagemath-doc: Documentation and inline help' 'ipython2-notebook: Jupyter notebook interface' 'mathjax: Jupyter notebook interface'
'coin-or-cbc: COIN backend for numerical computations'
'buckygen: for generating fullerene graphs' 'plantri: for generating some classes of graphs' 'benzene: for generating fusenes and benzenoids'
'modular_decomposition: modular decomposition of graphs'
'lrs: Algorithms for linear reverse search used in game theory and for computing volume of polytopes' 'imagemagick: to show animations'
'coxeter3: Coxeter groups implementation' 'cryptominisat: SAT solver' 'arb: floating-point ball arithmetic')
-makedepends=(cython2-devel boost ratpoints symmetrica fflas-ffpack python2-jinja coin-or-cbc
+makedepends=(cython2 boost ratpoints symmetrica fflas-ffpack python2-jinja coin-or-cbc
mcqd coxeter3 cryptominisat arb modular_decomposition bliss-graphs) # libfes
conflicts=(sage-mathematics)
replaces=(sage-mathematics)
provides=(sage-mathematics)
source=("$pkgname-$pkgver.tar.gz::https://github.com/sagemath/sage/archive/$pkgver.tar.gz"
# "http://www.sagemath.org/packages/upstream/pexpect/pexpect-2.0.tar.bz2"
-"http://mirrors.mit.edu/sage/spkg/upstream/pexpect/pexpect-2.0.tar.bz2"
+"http://mirrors.mit.edu/sage/spkg/upstream/pexpect/pexpect-2.0.tar.bz2" 'kernel.json'
'anal.h' 'package.patch' 'env.patch' 'paths.patch' 'clean.patch' 'skip-check.patch'
-'pexpect-env.patch' 'pexpect-del.patch' 'disable-fes.patch')
+'pexpect-env.patch' 'pexpect-del.patch' 'disable-fes.patch' 'cython-0.23.patch' 'ipython-4.patch')
md5sums=('943780ef4460e38f28fefe95e3138981'
'd9a3e113ed147dcee8f89962a8dccd43'
+ '4cee4f96bcd877587e7efc40c20adba7'
'a906a180d198186a39820b0a2f9a9c63'
'f72e544032b1a3f952b7ddafc3a49d63'
'843a6cc3b17a1850604593813321418e'
@@ -47,7 +48,9 @@ md5sums=('943780ef4460e38f28fefe95e3138981'
'5947a420a0b1483f0cbc74c76895789b'
'a83a3b1bc7fcb7cbf752a83a8311fc42'
'f333939ea6c41377b66407c81016cee4'
- '4eb23a3c7363258bc9ba764d6e5512ba')
+ '4eb23a3c7363258bc9ba764d6e5512ba'
+ '1b8dfa047115180aa0afbeaf19d97762'
+ '41aa997ad9f00afdc3357b37fc70f0e6')
prepare(){
cd sage-$pkgver
@@ -78,12 +81,16 @@ prepare(){
sed -e "s|os.path.join(SAGE_ROOT, 'sage')|'/usr/bin/sage'|" -i src/sage/repl/ipython_kernel/install.py
# find bliss headers
sed -e 's|graph.hh|bliss/graph.hh|' -i src/sage/graphs/bliss.pyx
+# fix IPython 4 compatibility
+ patch -p0 -i ../ipython-4.patch
# Upstream patches
# fix build against libfes 0.2 http://trac.sagemath.org/ticket/15209
# patch -p0 -i "$srcdir"/fes02.patch
# disable fes module, fails to compile
patch -p0 -i ../disable-fes.patch
+# fix build with cython 0.23
+ patch -p1 -i "$srcdir"/cython-0.23.patch
# use python2
sed -e 's|#!/usr/bin/env python|#!/usr/bin/env python2|' -e 's|exec python|exec python2|' -i src/bin/*
@@ -155,4 +162,14 @@ package() {
python2 setup.py install --root="$pkgdir" --optimize=1
mkdir -p "$pkgdir"/usr/lib/sage/site-packages/
mv "$pkgdir"/usr/lib/python2.7/site-packages/pexpect* "$pkgdir"/usr/lib/sage/site-packages/
+
+# Install Jupyter kernel
+ install -Dm644 "$srcdir"/kernel.json "$pkgdir"/usr/share/jupyter/kernels/sagemath/kernel.json
+ cd "$pkgdir"/usr/share/jupyter/kernels/sagemath
+ ln -s /usr/share/doc/sage/output/html/en doc
+ ln -s /usr/share/sage/ext/notebook-ipython/logo.svg .
+ ln -s /usr/share/sage/ext/notebook-ipython/logo-64x64.png .
+
+ mkdir "$pkgdir"/usr/share/jupyter/nbextensions
+ ln -s /usr/share/{jsmol,mathjax} "$pkgdir"/usr/share/jupyter/nbextensions
}
diff --git a/libre/sagemath/c_lib.patch b/libre/sagemath/c_lib.patch
deleted file mode 100644
index 6df7b8efa..000000000
--- a/libre/sagemath/c_lib.patch
+++ /dev/null
@@ -1,17 +0,0 @@
---- src/setup.py.orig 2014-11-01 23:49:10.000000000 +0100
-+++ src/setup.py 2014-11-07 00:40:58.414838636 +0100
-@@ -171,10 +171,12 @@
- m.libraries = ['csage'] + m.libraries
- if m.language == 'c++':
- m.libraries.append('stdc++')
-+ m.libraries.append('ntl')
-+ m.libraries = m.libraries + ['gmp', 'm', 'dl']
-
- m.extra_compile_args = m.extra_compile_args + extra_compile_args
- m.extra_link_args = m.extra_link_args + extra_link_args
-- m.library_dirs = m.library_dirs + [os.path.join(SAGE_LOCAL, "lib")]
-+ m.library_dirs += ['c_lib', '%s/lib' % SAGE_LOCAL]
- m.include_dirs = m.include_dirs + include_dirs
-
-
-
diff --git a/libre/sagemath/cython-0.23.patch b/libre/sagemath/cython-0.23.patch
new file mode 100644
index 000000000..2ae14ad57
--- /dev/null
+++ b/libre/sagemath/cython-0.23.patch
@@ -0,0 +1,16 @@
+diff --git a/src/sage/libs/polybori/decl.pxd b/src/sage/libs/polybori/decl.pxd
+index b8fcc6e..6ec4bce 100644
+--- a/src/sage/libs/polybori/decl.pxd
++++ b/src/sage/libs/polybori/decl.pxd
+@@ -10,8 +10,8 @@ cdef extern from "sage/libs/polybori/pb_wrap.h":
+ pbdp_asc "CTypes::dp_asc"
+ pbblock_dlex "CTypes::block_dlex"
+ pbblock_dp_asc "CTypes::block_dp_asc"
+- pbdp "17"
+- pbblock_dp "19"
++ pbdp "static_cast<COrderEnums::ordercodes>(17)"
++ pbblock_dp "static_cast<COrderEnums::ordercodes>(19)"
+
+ cdef enum comparecodes "CCompareEnums::comparecodes":
+ less_than "CTypes::less_than"
+
diff --git a/libre/sagemath/ipython-4.patch b/libre/sagemath/ipython-4.patch
new file mode 100644
index 000000000..a3b17563d
--- /dev/null
+++ b/libre/sagemath/ipython-4.patch
@@ -0,0 +1,35 @@
+--- src/sage/repl/interpreter.py.orig 2015-08-16 14:57:55.571128473 +0200
++++ src/sage/repl/interpreter.py 2015-08-16 14:58:06.647849803 +0200
+@@ -104,8 +104,8 @@
+ import sys
+ from sage.repl.preparse import preparse
+
+-from IPython import Config
+-from IPython.utils.traitlets import Bool, Type
++from traitlets.config.loader import Config
++from traitlets import Bool, Type
+
+ from sage.env import SAGE_LOCAL
+
+--- src/sage/repl/ipython_kernel/__main__.py.orig 2015-08-22 12:32:58.595605714 +0200
++++ src/sage/repl/ipython_kernel/__main__.py 2015-08-22 12:33:36.065900491 +0200
+@@ -1,3 +1,3 @@
+-from IPython.kernel.zmq.kernelapp import IPKernelApp
++from ipykernel.kernelapp import IPKernelApp
+ from sage.repl.ipython_kernel.kernel import SageKernel
+ IPKernelApp.launch_instance(kernel_class=SageKernel)
+--- src/sage/repl/ipython_kernel/kernel.py.orig 2015-08-22 12:35:08.709928354 +0200
++++ src/sage/repl/ipython_kernel/kernel.py 2015-08-22 12:35:31.983429208 +0200
+@@ -15,9 +15,9 @@
+ #*****************************************************************************
+
+ import sys
+-from IPython.kernel.zmq.ipkernel import IPythonKernel
+-from IPython.kernel.zmq.zmqshell import ZMQInteractiveShell
+-from IPython.utils.traitlets import Type
++from ipykernel.ipkernel import IPythonKernel
++from ipykernel.zmqshell import ZMQInteractiveShell
++from traitlets import Type
+
+ from sage.env import SAGE_VERSION, SAGE_EXTCODE, SAGE_DOC
+ from sage.repl.interpreter import SageNotebookInteractiveShell
diff --git a/libre/sagemath/kernel.json b/libre/sagemath/kernel.json
new file mode 100644
index 000000000..19b0f197b
--- /dev/null
+++ b/libre/sagemath/kernel.json
@@ -0,0 +1 @@
+{"display_name": "SageMath", "argv": ["/usr/bin/sage", "-python", "-m", "sage.repl.ipython_kernel", "-f", "{connection_file}"]}