# Maintainer: Antonio Rojas # Contributor: Evgeniy Alekseev # Contributor: Daniel Wallace # Contributor: Thomas Dziedzic # Contributor: Osman Ugus # Contributor: Stefan Husmann pkgbase=sagemath-git pkgname=(sagemath-git sagemath-jupyter-git) pkgver=9.0.beta8.r0.gcf9673bc59 pkgrel=1 pkgdesc="Open Source Mathematics Software, free alternative to Magma, Maple, Mathematica, and Matlab" arch=(x86_64) url="http://www.sagemath.org" license=(GPL) depends=(ipython palp brial cliquer maxima-ecl gfan sympow nauty python-rpy2 python-fpylll python-psutil python-cypari2 python-matplotlib python-scipy python-sympy python-networkx python-pillow python-pplpy python-future python-sphinx gap flintqs lcalc lrcalc arb eclib zn_poly gd python-cvxopt pynac-python3 linbox m4rie rubiks pari-galdata pari-seadata-small planarity rankwidth tachyon sage-data-combinatorial_designs sage-data-elliptic_curves sage-data-graphs sage-data-polytopes_db sage-data-conway_polynomials iml libgiac libhomfly libbraiding symmetrica three.js) optdepends=('cython: to compile cython code' 'python-pkgconfig: to compile cython code' 'jmol: alternative 3D plot engine' 'sagemath-doc: HTML documentation' 'python-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' 'ffmpeg: to export animations to video' 'imagemagick: to show animations' 'coxeter: Coxeter groups implementation' 'lrs: Algorithms for linear reverse search used in game theory and for computing volume of polytopes' 'libfes: exhaustive search of solutions for boolean equations' 'python-pynormaliz: Normaliz backend for polyhedral computations' 'latte-integrale: integral point count in polyhedra' 'python-jupymake: polymake backend for polyhedral computations' 'shared_meataxe: faster matrix arithmetic over finite fields' 'openblas: faster linear algebra' 'sirocco: for computing the fundamental group of the complement of a plane curve' 'primecount: faster prime_pi implementation' 'dot2tex: for displaying some diagrams' 'cryptominisat5: SAT solver' 'python-pycosat: picosat SAT solver' 'python-pip: to install optional packages with sage -pip') makedepends=(cython boost ratpoints python-jinja coin-or-cbc sirocco mcqd coxeter bliss tdlib python-pkgconfig shared_meataxe libfes primecount git) source=(git://git.sagemath.org/sage.git#branch=develop package.patch latte-count.patch test-optional.patch fes02.patch sagemath-cremona.patch sagemath-singular-4.1.2.patch sagemath-ecl-sigfpe.patch sagemath-ipython7.patch sagemath-rpy-3.patch sagemath-python-3.8.patch) sha256sums=('SKIP' '328e45e78065b5f6527174bda48cfff6828acbf107c2535b0a9a92c3ceb35842' 'dbf1f1d09decc6448ce443b5b60ed124a432761973bc0f4f08c9b5e34d968f9c' '1f2a34e15bf732ec8687c467a52e897615505dc3ddd792d811e8b6a7e19f1517' '9b2d87990db3045a83776e1ff527a31ce60a3361b08f5ec85fb1d45106982faa' '937074fa7a8a4e2aba9ea77ec622fe937985a1a9176c48460d51325ee877a4f5' '998e2c619d47849f977778906e2e492a09d8767b8f2e6d72a787368e7cf7b956' 'e44bbde87f3312548faad75b7383ef21fade55be251ab5804de41cd3842ca8a0' '151c4918e8f1198d195a83ad454431929d6a66319b31f68b43715825c604e5a1' '9062b412595e81a5ca560a5ae789f8b7318981689cb8d076b30d8c54a4fc4495' 'f2152e2ddf004c53273f61ea95938a82a60f71211826f1cf67db554617f5e6d2') pkgver() { cd sage git describe --long --tags | sed -r 's/([^-]*-g)/r\1/;s/-/./g' } prepare(){ cd sage # Arch-specific patches # assume all optional packages are installed patch -p0 -i ../package.patch # don't list optional packages when running tests patch -p0 -i ../test-optional.patch # use correct latte-count binary name patch -p1 -i ../latte-count.patch # Python 3.8 support patch -p1 -i ../sagemath-python-3.8.patch # Support IPython 7 patch -p1 -i ../sagemath-ipython7.patch # Adapt to rpy 3.0 changes patch -p1 -i ../sagemath-rpy-3.patch # Fix mathjax path sed -e 's|mathjax|mathjax2|g' -i src/sage/env.py # Upstream patches # fix build against libfes 0.2 http://trac.sagemath.org/ticket/15209 patch -p1 -i ../fes02.patch # use Features to detect Cremona databases https://trac.sagemath.org/ticket/25825 patch -p1 -i ../sagemath-cremona.patch # Fixes for singular 4.1.2 https://trac.sagemath.org/ticket/25993 patch -p1 -i ../sagemath-singular-4.1.2.patch # Fix SIGFPE crashes with ecl 16.1.3 https://trac.sagemath.org/ticket/22191 patch -p1 -i ../sagemath-ecl-sigfpe.patch sed -e 's|sage-python23|python|' -i src/bin/* sed -e 's|$SAGE_PYTHON3|yes|' -i src/bin/sage } build() { cd sage/src export CC=gcc \ SAGE_ROOT="$PWD" \ SAGE_SRC="$PWD" \ SAGE_NUM_THREADS=10 python setup.py build } package_sagemath-git() { optdepends+=('sagemath-jupyter-git: Jupyter kernel') conflicts=(sagemath) provides=(sagemath) cd sage/src export SAGE_ROOT="$PWD" \ SAGE_LOCAL="/usr" \ SAGE_EXTCODE="$PWD"/ext python setup.py install --root="$pkgdir" --optimize=1 mkdir -p "$pkgdir"/usr/bin cp bin/{sage,math-readline} "$pkgdir"/usr/bin for _i in cachegrind callgrind cleaner coverage coverageall cython eval fixdoctests grep grepdoc inline-fortran ipynb2rst \ ipython massif maxima.lisp native-execute notebook num-threads.py omega open preparse python run \ run-cython runtests startuptime.py valgrind version.sh do cp bin/sage-$_i "$pkgdir"/usr/bin done mkdir -p "$pkgdir"/usr/share/sage cp -r ext "$pkgdir"/usr/share/sage _pythonpath=`python -c "from sysconfig import get_path; print(get_path('platlib'))"` # Remove sage_setup rm -r "$pkgdir"/$_pythonpath/sage_setup # Install tests cp -r sage/doctest/tests "$pkgdir"/$_pythonpath/sage/doctest cp -r sage/tests/books "$pkgdir"/$_pythonpath/sage/tests # Split jupyter kernel rm -r "$pkgdir"/usr/share/jupyter } package_sagemath-jupyter-git() { pkgdesc='Jupyter kernel for SageMath' depends=(sagemath python-jupyter_client python-ipywidgets) optdepends=('jsmol: alternative 3D plot engine') cd sage/src export SAGE_ROOT="$PWD" \ SAGE_LOCAL="/usr" \ MATHJAX_DIR="/usr/share/mathjax2" python -c "from sage.repl.ipython_kernel.install import SageKernelSpec; SageKernelSpec.update(prefix='$pkgdir/usr')" # fix symlinks to assets for _i in $(ls ext/notebook-ipython); do rm "$pkgdir"/usr/share/jupyter/kernels/sagemath/$_i ln -s /usr/share/sage/ext/notebook-ipython/$_i "$pkgdir"/usr/share/jupyter/kernels/sagemath/ done }