# $Id: PKGBUILD 213281 2017-02-21 09:01:02Z arojas $ # Maintainer (Arch): Evgeniy Alekseev # Maintainer (Arch): Antonio Rojas # Contributor (Arch): Daniel Wallace # Contributor (Arch): Thomas Dziedzic # Contributor (Arch): Osman Ugus # Contributor (Arch): Stefan Husmann # Special thanks to Nareto for moving the compile from the .install to the PKGBUILD # Maintainer: Omar Vega Ramos # Maintainer: André Silva pkgname=sagemath pkgver=7.5.1 pkgrel=7.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" license=(GPL) depends=(ipython2 ppl palp brial cliquer maxima-ecl gfan sympow python2-rpy2 python2-fpylll python2-psutil python2-matplotlib python2-scipy python2-sympy python2-networkx python2-pillow python2-future libgap flintqs lcalc lrcalc arb eclib gmp-ecm zn_poly gd python2-cvxopt pynac linbox 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' 'python2-pkgconfig: to compile cython code' 'jmol: 3D plots' 'sage-notebook: Browser-based (flask) notebook interface' 'sagemath-doc: Documentation and inline help' 'python2-igraph: igraph backend for graph theory' 'coin-or-cbc: COIN backend for numerical computations' 'coin-or-csdp: for computing Lovász theta-function of graphs' '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' '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' 'libfes: exhaustive search of solutions for boolean equations' 'python2-pynormaliz: Normaliz backend for polyhedral computations' 'three.js: alternative 3D plots engine' 'tachyon: alternative 3D plots engine' '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) 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 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 sagemath-singular-4.1.0.p2.patch) sha256sums=('3cd9af3e3bfd7f5cc966b7c36168d04b9a1213aa9a7af3286b5d53d40e7653e3' '9dba04ff13626a7b6c338a8b18a6c27d343f68a547a218533cf773af3dae6635' 'b02b3d2d5620ca20f96adb62b6fef05e4676c0a60983310a1450fdf3d923cb04' 'ff7e034d08ab084fdb193484f7fe3a659ebcd8ab33a2b7177237d65b26de7872' 'd60fb0fbd27991ce9496ca035a54b03334b5b53f244227a8d6e13f3327ce75d2' '4a2297e4d9d28f0b3a1f58e1b463e332affcb109eafde44837b1657e309c8212' '775051aa9076ebf631c8a291af38b6ec4a13c904740dc9da831641d592d8bcd8' '81d08c6a760f171f3381455b66a6c84789c9f0eefddbe6ca5794075514ad8c3a' '65ad84c83d5f956fde8eab961f2caad56d64044324c4abc0e56bcd9f44061cb6' 'be925eefeac3f28e639794ddc20d64e6faafd7181804e29417a510224d19ccc7' '973224f53e9a6fcfaa9c6cb842b02430a601d1c7ce0abb41b3591470d128930c' 'ef9f401fa84fe1772af9efee6816643534f2896da4c23b809937b19771bdfbbf' '8126c92a5fc15738c4f7982aadb5a4033230fc2d5da05af9133a96ad1181419e' 'a1c562ebe4538d672404ca3ac2e954a3c955afeb7463f7b4fe6eaa6fa74fe5c7' 'a39da083c038ada797ffc5bedc9ba47455a3f77057d42f86484ae877ef9172ea' 'e1912afec58b834fac3b9161c2d5a1794bb618126c6bd7a4be85c834231360e7') prepare(){ cd sage-$pkgver # Parabola-specific patches # assume all optional packages are installed patch -p0 -i ../package.patch # set env variables patch -p0 -i ../env.patch # skip checking build status patch -p0 -i ../skip-check.patch # don't list optional packages when running tests patch -p0 -i ../test-optional.patch # set jupyter path patch -p0 -i ../jupyter-path.patch # search system paths for cython includes patch -p1 -i ../cython-sys-path.patch # fix regressions with ECM 7 patch -p1 -i ../ecm-7.patch # increase numerical tolerance, needed by scipy 0.18 patch -p1 -i ../increase-rtol.patch # fix cblas linking in gsl modules 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 # fix build with Singular 4.1.0-p2 patch -p0 -i ../sagemath-singular-4.1.0.p2.patch # Upstream patches # fix build against libfes 0.2 http://trac.sagemath.org/ticket/15209 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/* sed -e 's|cython {OPT}|cython2 {OPT}|' -e 's|python setup.py|python2 setup.py|' -i src/sage/misc/cython.py sed -e 's|exec ipython|exec ipython2|' -e 's|cygdb|cygdb2|g' -i src/bin/sage sed -e "s|'cython'|'cython2'|" -i src/bin/sage-cython sed -e 's|bin/python|bin/python2|g' -i src/bin/sage-env } build() { cd sage-$pkgver/src export SAGE_LOCAL="/usr" export SAGE_ROOT="$PWD" export SAGE_SRC="$PWD" export CC=gcc python2 setup.py build } package() { cd sage-$pkgver/src export SAGE_ROOT="$PWD" export SAGE_LOCAL="/usr" export JUPYTER_PATH="$pkgdir"/usr/share/jupyter python2 setup.py install --root="$pkgdir" --optimize=1 --skip-build mkdir -p "$pkgdir"/usr/bin cp bin/sage "$pkgdir"/usr/bin 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 cp bin/sage-$_i "$pkgdir"/usr/bin done cp bin/math-readline "$pkgdir"/usr/bin mkdir -p "$pkgdir"/usr/share/sage cp -r ext "$pkgdir"/usr/share/sage # Create SAGE_SRC, needed for the notebook and help mkdir "$pkgdir"/usr/share/sage/source ln -s /usr/share/doc/sage "$pkgdir"/usr/share/sage/source/doc # Remove sage_setup rm -r "$pkgdir"/usr/lib/python2.7/site-packages/sage_setup # Split jupyter kernel rm -r "$pkgdir"/usr/share/jupyter }