summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libre/sagemath/PKGBUILD27
-rw-r--r--libre/sagemath/disable-fes.patch19
-rw-r--r--libre/sagemath/fes02.patch57
-rw-r--r--libre/sagemath/sagemath-no-anal.h.patch12
-rw-r--r--libre/sagemath/sagemath-planarity3.patch113
5 files changed, 198 insertions, 30 deletions
diff --git a/libre/sagemath/PKGBUILD b/libre/sagemath/PKGBUILD
index c3a5aa6e7..47c4ff7b7 100644
--- a/libre/sagemath/PKGBUILD
+++ b/libre/sagemath/PKGBUILD
@@ -1,4 +1,4 @@
-# $Id: PKGBUILD 208152 2017-01-20 19:45:48Z arojas $
+# $Id: PKGBUILD 209349 2017-01-29 11:20:25Z 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=7.5.1
-pkgrel=3.parabola1
+pkgrel=4.parabola1
pkgdesc="Free Mathematics Software, free software replacement of Magma, Maple, Mathematica, and Matlab, without nonfree nauty support"
arch=(i686 x86_64 armv7h)
url="http://www.sagemath.org"
@@ -29,29 +29,32 @@ optdepends=('cython2: to compile cython code' 'python2-pkgconfig: to compile cyt
'coxeter3: Coxeter groups implementation' 'cryptominisat2: SAT solver' 'gap-data: for computing Galois groups'
'lrs: Algorithms for linear reverse search used in game theory and for computing volume of polytopes'
'libhomfly: for computing the homfly polynomial of links' 'libbraiding: for computing in braid groups'
- 'python2-pynormaliz: Normaliz backend for polyhedral computations'
+ 'libfes: exhaustive search of solutions for boolean equations' 'python2-pynormaliz: Normaliz backend for polyhedral computations'
'sagemath-jupyter: Jupyter kernel')
makedepends=(cython2 boost ratpoints symmetrica python2-jinja coin-or-cbc libhomfly libbraiding
- mcqd coxeter3 cryptominisat2 modular_decomposition bliss-graphs tdlib python2-pkgconfig meataxe) # libfes
+ mcqd coxeter3 cryptominisat2 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"
- env.patch skip-check.patch cython-sys-path.patch is-package-installed.patch package.patch disable-fes.patch
- jupyter-path.patch test-optional.patch ecm-7.patch increase-rtol.patch sagemath-gslcblas.patch r-no-readline.patch)
+ env.patch skip-check.patch cython-sys-path.patch is-package-installed.patch package.patch
+ jupyter-path.patch test-optional.patch ecm-7.patch increase-rtol.patch sagemath-gslcblas.patch r-no-readline.patch
+ sagemath-no-anal.h.patch sagemath-planarity3.patch fes02.patch)
sha256sums=('3cd9af3e3bfd7f5cc966b7c36168d04b9a1213aa9a7af3286b5d53d40e7653e3'
'9dba04ff13626a7b6c338a8b18a6c27d343f68a547a218533cf773af3dae6635'
'b02b3d2d5620ca20f96adb62b6fef05e4676c0a60983310a1450fdf3d923cb04'
'ff7e034d08ab084fdb193484f7fe3a659ebcd8ab33a2b7177237d65b26de7872'
'd60fb0fbd27991ce9496ca035a54b03334b5b53f244227a8d6e13f3327ce75d2'
'4a2297e4d9d28f0b3a1f58e1b463e332affcb109eafde44837b1657e309c8212'
- '7ab53d30b877dabb6835fbe67a208bef65fa0aaf40221b4d0b58e4b7086bc47a'
'775051aa9076ebf631c8a291af38b6ec4a13c904740dc9da831641d592d8bcd8'
'81d08c6a760f171f3381455b66a6c84789c9f0eefddbe6ca5794075514ad8c3a'
'65ad84c83d5f956fde8eab961f2caad56d64044324c4abc0e56bcd9f44061cb6'
'be925eefeac3f28e639794ddc20d64e6faafd7181804e29417a510224d19ccc7'
'973224f53e9a6fcfaa9c6cb842b02430a601d1c7ce0abb41b3591470d128930c'
- 'ef9f401fa84fe1772af9efee6816643534f2896da4c23b809937b19771bdfbbf')
+ 'ef9f401fa84fe1772af9efee6816643534f2896da4c23b809937b19771bdfbbf'
+ '8126c92a5fc15738c4f7982aadb5a4033230fc2d5da05af9133a96ad1181419e'
+ 'a1c562ebe4538d672404ca3ac2e954a3c955afeb7463f7b4fe6eaa6fa74fe5c7'
+ 'a39da083c038ada797ffc5bedc9ba47455a3f77057d42f86484ae877ef9172ea')
prepare(){
cd sage-$pkgver
@@ -77,14 +80,16 @@ prepare(){
patch -p1 -i ../sagemath-gslcblas.patch
# fix freezes in R interface with readline 7 (Debian)
patch -p1 -i ../r-no-readline.patch
+# fix build with planarity 3 (Debian)
+ patch -p2 -i ../sagemath-planarity3.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
+ patch -p1 -i ../fes02.patch
# replace is_package_installed usage http://trac.sagemath.org/ticket/20377
patch -p1 -i ../is-package-installed.patch
+# Allow compiling without pari's anal.h https://trac.sagemath.org/ticket/22195
+ patch -p1 -i ../sagemath-no-anal.h.patch
# use python2
sed -e 's|#!/usr/bin/env python|#!/usr/bin/env python2|' -e 's|exec python|exec python2|' -i src/bin/*
diff --git a/libre/sagemath/disable-fes.patch b/libre/sagemath/disable-fes.patch
deleted file mode 100644
index 086231d70..000000000
--- a/libre/sagemath/disable-fes.patch
+++ /dev/null
@@ -1,19 +0,0 @@
---- src/module_list.py.orig 2015-06-07 11:29:30.710612146 +0200
-+++ src/module_list.py 2015-06-07 11:30:21.877506106 +0200
-@@ -564,11 +564,11 @@
- sources = ["sage/libs/ecl.pyx"],
- libraries = ["ecl"]),
-
-- OptionalExtension("sage.libs.fes",
-- ["sage/libs/fes.pyx"],
-- language = "c",
-- libraries = ['fes'],
-- package = 'fes'),
-+# OptionalExtension("sage.libs.fes",
-+# ["sage/libs/fes.pyx"],
-+# language = "c",
-+# libraries = ['fes'],
-+# package = 'fes'),
-
- Extension('sage.libs.flint.flint',
- sources = ["sage/libs/flint/flint.pyx"],
diff --git a/libre/sagemath/fes02.patch b/libre/sagemath/fes02.patch
new file mode 100644
index 000000000..155d114b1
--- /dev/null
+++ b/libre/sagemath/fes02.patch
@@ -0,0 +1,57 @@
+From b1f5e3ecc789db674fe17552812f2d0e2ab84be0 Mon Sep 17 00:00:00 2001
+From: Charles Bouillaguet <charles.bouillaguet@lifl.fr>
+Date: Thu, 19 Sep 2013 10:31:11 +0200
+Subject: updating the libFES binding to match a change in the interface
+
+---
+ src/sage/libs/fes.pyx | 12 +++++++-----
+ 1 file changed, 7 insertions(+), 5 deletions(-)
+
+diff --git a/src/sage/libs/fes.pyx b/src/sage/libs/fes.pyx
+index 40b9c23..d188cf0 100644
+--- a/src/sage/libs/fes.pyx
++++ b/src/sage/libs/fes.pyx
+@@ -1,17 +1,19 @@
+ """
+-Binding for the FES library.
++Binding for the libFES library.
+
+ Finding solutions of systems of boolean equations by exhaustive
+ search, via the fes library. This is usually (much) faster than
+ computing a Groebner basis, except in special cases where the latter
+ is particularly easy.
+
+-The FES library is presently only able to deal with polynomials in 64
++More information is available at [http://www.lifl.fr/~bouillag/fes].
++
++The libFES library is presently only able to deal with polynomials in 64
+ variables. Performing a full exhaustive search over 64 variables will
+ take a **long** time. The number of variables can be artificially
+ reduced to 64 by specializing some of them.
+
+-Note that the FES library **requires** at least of the equations to be
++Note that the libFES library **requires** at least of the equations to be
+ non-linear.
+
+ AUTHORS:
+@@ -71,7 +73,7 @@ from libc.stdint cimport uint64_t
+ cdef extern from "fes_interface.h":
+ ctypedef int (*solution_callback_t)(void *, uint64_t)
+
+- void exhaustive_search_wrapper(int n, int n_eqs, int degree, int ***coeffs, solution_callback_t callback, void* callback_state, int verbose)
++ void exhaustive_search_wrapper(int n, int n_eqs, int degree, int ***coeffs, solution_callback_t callback, void* callback_state, int verbose, int T)
+
+
+ include 'sage/ext/interrupt.pxi' #sig_on(), sig_off()
+@@ -219,7 +221,7 @@ def exhaustive_search(eqs, max_sols=Infinity, verbose=False):
+
+ # ------- runs the library
+ sig_on()
+- exhaustive_search_wrapper(n, len(eqs), degree, coeffs, report_solution, <void *> internal_state, verbose)
++ exhaustive_search_wrapper(n, len(eqs), degree, coeffs, report_solution, <void *> internal_state, verbose, 0)
+ sig_off()
+
+ # ------- frees memory occupied by the dense representation of the equations
+--
+cgit v1.0-1-gd88e
+
diff --git a/libre/sagemath/sagemath-no-anal.h.patch b/libre/sagemath/sagemath-no-anal.h.patch
new file mode 100644
index 000000000..f1b261321
--- /dev/null
+++ b/libre/sagemath/sagemath-no-anal.h.patch
@@ -0,0 +1,12 @@
+diff --git a/src/sage/libs/cypari2/paripriv.pxd b/src/sage/libs/cypari2/paripriv.pxd
+index b6ea381..921599d 100644
+--- a/src/sage/libs/cypari2/paripriv.pxd
++++ b/src/sage/libs/cypari2/paripriv.pxd
+@@ -26,5 +26,5 @@ cdef extern from "pari/paripriv.h":
+
+ extern gp_data* GP_DATA
+
+-cdef extern from "pari/anal.h":
+- char* closure_func_err()
++cdef extern: # Declared in private PARI header file "anal.h"
++ const char* closure_func_err()
diff --git a/libre/sagemath/sagemath-planarity3.patch b/libre/sagemath/sagemath-planarity3.patch
new file mode 100644
index 000000000..607600879
--- /dev/null
+++ b/libre/sagemath/sagemath-planarity3.patch
@@ -0,0 +1,113 @@
+Author: Ximin Luo <infinity0@debian.org>
+Bug: https://trac.sagemath.org/ticket/21774
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+--- a/sage/src/sage/graphs/planarity.pyx
++++ b/sage/src/sage/graphs/planarity.pyx
+@@ -3,13 +3,19 @@
+ """
+
+ cdef extern from "planarity/graph.h":
+- ctypedef struct graphNode:
+- int v
++ ctypedef struct vertexRec:
+ int link[2]
+- ctypedef graphNode * graphNodeP
++ int index
++ ctypedef vertexRec * vertexRecP
++
++ ctypedef struct edgeRec:
++ int link[2]
++ int neighbor
++ ctypedef edgeRec * edgeRecP
+
+ ctypedef struct BM_graph:
+- graphNodeP G
++ vertexRecP V
++ edgeRecP E
+ int N
+ ctypedef BM_graph * graphP
+
+@@ -93,15 +99,16 @@
+ g._pos = { u: [0,0], v: [0,1] }
+ return (True, None) if kuratowski else True
+
+- # create to and from mappings to relabel vertices to the set {0,...,n-1}
++ # create to and from mappings to relabel vertices to the set {1,...,n}
++ # (planarity 3 uses 1-based array indexing, with 0 representing NIL)
+ cdef int i
+ listto = g.vertices()
+ ffrom = {}
+ for vvv in listto:
+- ffrom[vvv] = listto.index(vvv)
++ ffrom[vvv] = listto.index(vvv) + 1
+ to = {}
+ for i from 0 <= i < len(listto):
+- to[i] = listto[i]
++ to[i + 1] = listto[i]
+ g.relabel(ffrom)
+
+ cdef graphP theGraph
+@@ -125,7 +132,7 @@
+ status = gp_Embed(theGraph, EMBEDFLAGS_PLANAR)
+ gp_SortVertices(theGraph)
+
+- # use to and from mappings to relabel vertices back from the set {0,...,n-1}
++ # use to and from mappings to relabel vertices back from the set {1,...,n}
+ g.relabel(to)
+
+ if status == NOTOK:
+@@ -134,12 +141,12 @@
+ # Kuratowski subgraph isolator
+ g_dict = {}
+ from sage.graphs.graph import Graph
+- for i from 0 <= i < theGraph.N:
++ for i from 0 < i <= theGraph.N:
+ linked_list = []
+- j = theGraph.G[i].link[1]
+- while j >= theGraph.N:
+- linked_list.append(to[theGraph.G[j].v])
+- j = theGraph.G[j].link[1]
++ j = theGraph.V[i].link[1]
++ while j:
++ linked_list.append(to[theGraph.E[j].neighbor])
++ j = theGraph.E[j].link[1]
+ if len(linked_list) > 0:
+ g_dict[to[i]] = linked_list
+ G = Graph(g_dict)
+@@ -153,12 +160,12 @@
+ if set_embedding:
+ emb_dict = {}
+ #for i in range(theGraph.N):
+- for i from 0 <= i < theGraph.N:
++ for i from 0 < i <= theGraph.N:
+ linked_list = []
+- j = theGraph.G[i].link[1]
+- while j >= theGraph.N:
+- linked_list.append(to[theGraph.G[j].v])
+- j = theGraph.G[j].link[1]
++ j = theGraph.V[i].link[1]
++ while j:
++ linked_list.append(to[theGraph.E[j].neighbor])
++ j = theGraph.E[j].link[1]
+ emb_dict[to[i]] = linked_list
+ g._embedding = emb_dict
+ if set_pos:
+@@ -174,12 +181,12 @@
+
+ emb_dict = {}
+ #for i in range(theGraph.N):
+- for i from 0 <= i < theGraph.N:
++ for i from 0 < i <= theGraph.N:
+ linked_list = []
+- j = theGraph.G[i].link[0]
+- while j >= theGraph.N:
+- linked_list.append(to[theGraph.G[j].v])
+- j = theGraph.G[j].link[0]
++ j = theGraph.V[i].link[0]
++ while j:
++ linked_list.append(to[theGraph.E[j].neighbor])
++ j = theGraph.E[j].link[0]
+ emb_dict[to[i]] = linked_list
+ g._embedding = emb_dict
+ gp_Free(&theGraph)