summaryrefslogtreecommitdiff
path: root/libre/sagemath
diff options
context:
space:
mode:
Diffstat (limited to 'libre/sagemath')
-rw-r--r--libre/sagemath/PKGBUILD45
-rw-r--r--libre/sagemath/env.patch2
-rw-r--r--libre/sagemath/jupyter-path.patch31
-rw-r--r--libre/sagemath/kernel.json1
4 files changed, 55 insertions, 24 deletions
diff --git a/libre/sagemath/PKGBUILD b/libre/sagemath/PKGBUILD
index ce369c9e8..ec9b1d19c 100644
--- a/libre/sagemath/PKGBUILD
+++ b/libre/sagemath/PKGBUILD
@@ -1,4 +1,4 @@
-# $Id: PKGBUILD 143765 2015-10-12 11:53:35Z arojas $
+# $Id: PKGBUILD 144931 2015-10-24 18:28:03Z 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>
@@ -11,7 +11,7 @@
pkgname=sagemath
pkgver=6.9
-pkgrel=2.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"
@@ -32,22 +32,27 @@ 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" 'kernel.json'
-'anal.h' 'package.patch' 'env.patch' 'paths.patch' 'clean.patch' 'skip-check.patch'
-'pexpect-env.patch' 'pexpect-del.patch' 'disable-fes.patch')
+ "http://mirrors.mit.edu/sage/spkg/upstream/pexpect/pexpect-2.0.tar.bz2"
+ 'anal.h' 'package.patch' 'env.patch' 'paths.patch' 'clean.patch' 'skip-check.patch'
+ 'pexpect-env.patch' 'pexpect-del.patch' 'disable-fes.patch' 'jupyter-path.patch'
+ pari-sage-2.8.1813.patch::"http://git.sagemath.org/sage.git/patch/?id=c1f5aa26e"
+ jupyter-kernel.patch::"http://git.sagemath.org/sage.git/patch/?id=4f06d3df"
+ relative-links.patch::"http://git.sagemath.org/sage.git/patch/src/sage/repl/ipython_kernel/kernel.py?id=52a717a7")
md5sums=('847ad447eaef17b2bc81bb4fae69c190'
'd9a3e113ed147dcee8f89962a8dccd43'
- '4cee4f96bcd877587e7efc40c20adba7'
'a906a180d198186a39820b0a2f9a9c63'
'9ba81f717ffd4e20b8b2f2a318307488'
- '5ebdb6e6ac541f040a39f8d3fd9c8ee1'
+ 'e1b1d0d2e6b187309ae2b74489356b9a'
'fd8e3e07f5b7318e6a7200a3c64f5bc2'
'23e972753be1e5d0f761a7f82a95cebf'
'5947a420a0b1483f0cbc74c76895789b'
'a83a3b1bc7fcb7cbf752a83a8311fc42'
'f333939ea6c41377b66407c81016cee4'
- '4eb23a3c7363258bc9ba764d6e5512ba')
+ '4eb23a3c7363258bc9ba764d6e5512ba'
+ '16b529194c6105c3364127bd8f1efa83'
+ '01229c3dabbb5fe13348d8c8c31da710'
+ 'f91e760a251fe1042fa9f2aad68b6b02'
+ 'fe3c5ef5b30a19c632d7fad0ee58c7c4')
prepare(){
cd sage-$pkgver
@@ -74,14 +79,19 @@ prepare(){
-i src/sage/databases/cremona.py
# find bliss headers
sed -e 's|graph.hh|bliss/graph.hh|' -i src/sage/graphs/bliss.pyx
-# fix opening docs from Jupyter notebook
- sed -e "s|SageKernelSpec.identifier()|'SageMath'|g" -i src/sage/repl/ipython_kernel/kernel.py
# 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
+# port to pari-sage 2.8.1813
+ patch -p1 -i ../pari-sage-2.8.1813.patch
+# install jupyter kernel
+ patch -p1 -i ../relative-links.patch
+ patch -p1 -i ../jupyter-kernel.patch
+# set jupyter path
+ patch -p0 -i ../jupyter-path.patch
# use python2
sed -e 's|#!/usr/bin/env python|#!/usr/bin/env python2|' -e 's|exec python|exec python2|' -i src/bin/*
@@ -129,6 +139,7 @@ package() {
export SAGE_ROOT="/usr"
export SAGE_LOCAL="$SAGE_ROOT"
export SAGE_SRC="$PWD"
+ export JUPYTER_PATH="$pkgdir"/usr/share/jupyter
python2 setup.py install --root="$pkgdir" --optimize=1 --skip-build
@@ -146,21 +157,11 @@ package() {
cp -r ext "$pkgdir"/usr/share/sage
# Create SAGE_SRC, needed for the notebook
- mkdir "$pkgdir"/usr/share/sage/src
+ mkdir "$pkgdir"/usr/share/sage/source
# Install Sage's own pexpect
cd "$srcdir"/pexpect-2.0
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/env.patch b/libre/sagemath/env.patch
index b8ca1eb4d..e4a1be329 100644
--- a/libre/sagemath/env.patch
+++ b/libre/sagemath/env.patch
@@ -65,7 +65,7 @@
+export SAGE_ETC="/etc/sage"
+export SAGE_SHARE="$SAGE_LOCAL/share/sage"
+export SAGE_EXTCODE="$SAGE_SHARE/ext"
-+export SAGE_SRC="$SAGE_SHARE/src"
++export SAGE_SRC="$SAGE_SHARE/source"
+export SAGE_DOC="/usr/share/doc/sage"
# We offer a toolchain option, so if $SAGE_LOCAL/toolchain/toolchain-env exists source it.
diff --git a/libre/sagemath/jupyter-path.patch b/libre/sagemath/jupyter-path.patch
new file mode 100644
index 000000000..3201e9a6e
--- /dev/null
+++ b/libre/sagemath/jupyter-path.patch
@@ -0,0 +1,31 @@
+--- src/sage/repl/ipython_kernel/install.py.orig 2015-10-23 19:23:39.728456590 +0000
++++ src/sage/repl/ipython_kernel/install.py 2015-10-23 19:24:00.965018978 +0000
+@@ -13,8 +13,7 @@
+ SAGE_ROOT, SAGE_DOC, SAGE_LOCAL, SAGE_EXTCODE,
+ SAGE_VERSION
+ )
+-from jupyter_core.paths import ENV_JUPYTER_PATH
+-JUPYTER_PATH = ENV_JUPYTER_PATH[0]
++JUPYTER_PATH = os.environ.get('JUPYTER_PATH')
+
+ class SageKernelSpec(object):
+
+@@ -151,7 +151,7 @@
+ '{connection_file}']
+ """
+ return [
+- os.path.join(SAGE_ROOT, 'sage'),
++ os.path.join(SAGE_ROOT, 'bin', 'sage'),
+ '--python',
+ '-m', 'sage.repl.ipython_kernel',
+ '-f', '{connection_file}',
+@@ -208,7 +208,7 @@
+ sage: spec._symlink_resources() # not tested
+ """
+ path = os.path.join(SAGE_EXTCODE, 'notebook-ipython')
+- for filename in os.listdir(path):
++ for filename in os.listdir('ext/notebook-ipython'):
+ self.symlink(
+ os.path.join(path, filename),
+ os.path.join(self.kernel_dir, filename)
+
diff --git a/libre/sagemath/kernel.json b/libre/sagemath/kernel.json
deleted file mode 100644
index 19b0f197b..000000000
--- a/libre/sagemath/kernel.json
+++ /dev/null
@@ -1 +0,0 @@
-{"display_name": "SageMath", "argv": ["/usr/bin/sage", "-python", "-m", "sage.repl.ipython_kernel", "-f", "{connection_file}"]}