Date: Thursday, September 21, 2017 @ 20:03:24 Author: arojas Revision: 259317
Adapt to networkx 2 API changes Added: sagemath/trunk/sagemath-detect-igraph.patch sagemath/trunk/sagemath-networkx2.patch Modified: sagemath/trunk/PKGBUILD ------------------------------+ PKGBUILD | 12 +++++++++--- sagemath-detect-igraph.patch | 21 +++++++++++++++++++++ sagemath-networkx2.patch | 26 ++++++++++++++++++++++++++ 3 files changed, 56 insertions(+), 3 deletions(-) Modified: PKGBUILD =================================================================== --- PKGBUILD 2017-09-21 20:02:30 UTC (rev 259316) +++ PKGBUILD 2017-09-21 20:03:24 UTC (rev 259317) @@ -9,7 +9,7 @@ pkgbase=sagemath pkgname=(sagemath sagemath-jupyter) pkgver=8.0 -pkgrel=4 +pkgrel=5 pkgdesc="Open Source Mathematics Software, free alternative to Magma, Maple, Mathematica, and Matlab" arch=(i686 x86_64) url="http://www.sagemath.org" @@ -37,7 +37,7 @@ source=("$pkgname-$pkgver.tar.gz::https://github.com/sagemath/sage/archive/$pkgver.tar.gz" env.patch package.patch latte-count.patch jupyter-path.patch sagemath-python3-notebook.patch test-optional.patch r-no-readline.patch fes02.patch sagemath-ecl-no-sigfpe.patch sagemath-cython-0.26.patch - sagemath-pynac-0.7.11.patch) + sagemath-pynac-0.7.11.patch sagemath-detect-igraph.patch sagemath-networkx2.patch) sha256sums=('91df3e303add71616e24b38c04789f66d57ada7b1017e5369e850c42d5e8753d' 'e0b5b8673300857fde823209a7e90faecf9e754ab812cc5e54297eddc0c79571' '4a2297e4d9d28f0b3a1f58e1b463e332affcb109eafde44837b1657e309c8212' @@ -49,7 +49,9 @@ 'a39da083c038ada797ffc5bedc9ba47455a3f77057d42f86484ae877ef9172ea' 'c31809f887bf9acc45c5bd9dd30bb93e73601d3efbf3016594c3c1d241731c8a' '2953ef15d957a2f3304a5584c154bf4777bcb4b461414d3a2178423257539755' - '3e23ff449a5a3a032684287722455633762636b93ecfc35fb00e875c69eff240') + '3e23ff449a5a3a032684287722455633762636b93ecfc35fb00e875c69eff240' + '90be1d1a90120bd5bd3620769480106ba809dd23e896bc4a3f8931e5340f3cda' + 'a1a0ab5b794136b518f5f66fe9f1689411fabb3b81560b159eae81f6f69000e3') prepare(){ cd sage-$pkgver @@ -72,6 +74,10 @@ # fix Cremona database detection sed -e "s|is_package_installed('database_cremona_ellcurve')|os.path.exists('/usr/share/cremona/cremona.db')|" \ -i src/sage/databases/cremona.py +# fix python-igraph detection + patch -p1 -i ../sagemath-detect-igraph.patch +# adapt to networkx 2 changes + patch -p1 -i ../sagemath-networkx2.patch # Upstream patches # fix build against libfes 0.2 http://trac.sagemath.org/ticket/15209 Added: sagemath-detect-igraph.patch =================================================================== --- sagemath-detect-igraph.patch (rev 0) +++ sagemath-detect-igraph.patch 2017-09-21 20:03:24 UTC (rev 259317) @@ -0,0 +1,21 @@ +diff --git a/src/sage/graphs/generic_graph.py b/src/sage/graphs/generic_graph.py +index 252984f..ce19682 100644 +--- a/src/sage/graphs/generic_graph.py ++++ b/src/sage/graphs/generic_graph.py +@@ -7876,10 +7875,12 @@ class GenericGraph(GenericGraph_pyx): + if algorithm is None: + if vertex_bound: + algorithm = "LP" +- elif is_package_installed("python_igraph"): +- algorithm = "igraph" + else: +- algorithm = "FF" ++ algorithm = "igraph" ++ try: ++ import igraph ++ except ImportError: ++ algorithm = "FF" + + if (algorithm == "FF"): + return self._ford_fulkerson(x,y, value_only=value_only, integer=integer, use_edge_labels=use_edge_labels) + Added: sagemath-networkx2.patch =================================================================== --- sagemath-networkx2.patch (rev 0) +++ sagemath-networkx2.patch 2017-09-21 20:03:24 UTC (rev 259317) @@ -0,0 +1,26 @@ +diff --git a/src/sage/graphs/digraph.py b/src/sage/graphs/digraph.py +index 8c29602da6..e7a185d586 100644 +--- a/src/sage/graphs/digraph.py ++++ b/src/sage/graphs/digraph.py +@@ -751,7 +751,7 @@ class DiGraph(GenericGraph): + self.allow_multiple_edges(multiedges,check=False) + self.allow_loops(loops,check=False) + self.add_vertices(data.nodes()) +- self.add_edges((u,v,r(l)) for u,v,l in data.edges_iter(data=True)) ++ self.add_edges((u,v,r(l)) for u,v,l in data.edges(data=True)) + elif format == 'igraph': + if not data.is_directed(): + raise ValueError("A *directed* igraph graph was expected. To "+ +diff --git a/src/sage/graphs/graph.py b/src/sage/graphs/graph.py +index b63135d8e6..5775042976 100644 +--- a/src/sage/graphs/graph.py ++++ b/src/sage/graphs/graph.py +@@ -1199,7 +1199,7 @@ class Graph(GenericGraph): + self.allow_loops(loops, check=False) + self.allow_multiple_edges(multiedges, check=False) + self.add_vertices(data.nodes()) +- self.add_edges((u,v,r(l)) for u,v,l in data.edges_iter(data=True)) ++ self.add_edges((u,v,r(l)) for u,v,l in data.edges(data=True)) + elif format == 'igraph': + if data.is_directed(): + raise ValueError("An *undirected* igraph graph was expected. "+