summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 50c5891c1e86c33681df61e6517ba2303d68287e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
# Maintainer: Antonio Rojas <arojas@archlinux.org>
# Contributor: Evgeniy Alekseev <arcanis.arch at gmail dot com>
# Contributor: Daniel Wallace <danielwallace at gtmanfred dot com>
# Contributor: Thomas Dziedzic <gostrc at gmail dot com>
# Contributor: Osman Ugus <ugus11 at yahoo dot com>
# Contributor: Stefan Husmann <stefan-husmann at t-online dot de>

pkgname=sagemath-git
pkgver=10.3.rc4.r0.gab1a517b64b
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=(brial
         cblas
         cliquer
         ecl
         eclib
         fflas-ffpack
         flint
         gap
         gcc-libs
         gd
         gfan
         giac
         givaro
         glibc
         glpk
         gmp
         gmp-ecm
         gsl
         iml
         ipython
         lcalc
         libbraiding
         libhomfly
         libmpc
         linbox
         lrcalc
         m4ri
         m4rie
         maxima-fas
         mpfi
         mpfr
         nauty
         ntl
         palp
         pari
         pari-galdata
         pari-seadata-small
         planarity
         python
         python-conway-polynomials
         python-cvxopt
         python-cysignals
         python-cypari2
         python-docutils
         python-fpylll
         python-ipywidgets
         python-matplotlib
         python-memory-allocator
         python-mpmath
         python-networkx
         python-numpy
         python-pexpect
         python-pillow
         python-pplpy
         python-primecountpy
         python-pygments
         python-pyparsing
         python-requests
         python-rpy2
         python-scipy
         python-sphinx
         python-sympy
         python-traitlets
         rankwidth
         sage-data-combinatorial_designs
         sage-data-elliptic_curves
         sage-data-graphs
         sage-data-polytopes_db
         singular
         symmetrica
         sympow
         tachyon
         threejs-sage)
optdepends=('benzene: for generating fusenes and benzenoids'
            'blas-openblas: faster linear algebra'
            'bliss: bliss backend for graph theory'
            'buckygen: for generating fullerene graphs'
            'coin-or-csdp: for computing Lovász theta-function of graphs'
            'coxeter: Coxeter groups implementation'
            'cryptominisat: SAT solver'
            'cython: to compile cython code'
            'dot2tex: for displaying some diagrams'
            'ffmpeg: to export animations to video'
            'fricas: FriCAS interface'
            'imagemagick: to show animations'
            'jmol: alternative 3D plot engine'
            'jupyter-jsmol: alternative 3D plot engine in the Jupyter notebook'
            'lrs: Algorithms for linear reverse search used in game theory and for computing volume of polytopes'
            'latte-integrale: integral point count in polyhedra'
            'msolve: polynomial system solving via msolve'
            'plantri: for generating some classes of graphs'
            'python-cvxpy: interface for several convex optimization backends'
            'python-database-cubic-hecke: cubic Hecke algebras'
            'python-database-knotinfo: interface to the KnotInfo and LinkInfo databases'
            'python-igraph: igraph backend for graph theory'
            'python-jupymake: polymake backend for polyhedral computations'
            'python-matroid-database: matroids database'
            'python-phitigra: graph editor'
            'python-pkgconfig: to compile cython code'
            'python-pycosat: picosat SAT solver'
            'python-pynormaliz: Normaliz backend for polyhedral computations'
            'python-pyscipopt: SCIP mixed integer linear programming backend'
            'rubiks: Rubiks cube algorithms'
            'sage-notebook-exporter: convert flask notebooks to Jupyter'
            'sagemath-doc: HTML documentation'
            'shared_meataxe: faster matrix arithmetic over finite fields'
            'sirocco: for computing the fundamental group of the complement of a plane curve'
            'topcom: to compute triangulations of point configurations')
makedepends=(bliss
             boost
             coxeter
             cython
             git
             mcqd
             python-jinja
             python-pkgconfig
             shared_meataxe
             sirocco
             tdlib)
conflicts=(sagemath)
provides=(sagemath)
source=(git+https://github.com/sagemath/sage#branch=develop
        latte-count.patch
        sagemath-tdlib-0.9.patch
        singular-4.4.patch)
sha256sums=('SKIP'
            '5cd2f88965d7ebab9dfab6f5c2040d363a4a5ae41230219cc7070b907381da5a'
            '56a83abecf2ff5a500442adc7a50abbb70006037dd39c39dcdb04b3ca9fb51e2'
            '2fd97d454a15f3ef0a974418189fdc1345d7ebb4394fab11caf2e3723f6efb02')
_pkgs=(standard
       bliss
       coxeter3
       mcqd
       meataxe
       sirocco
       tdlib)

pkgver() {
  cd sage
  git describe --long --tags | sed -r 's/([^-]*-g)/r\1/;s/-/./g'
}

prepare(){
  cd sage

# use correct latte-count binary name
  patch -p1 -i ../latte-count.patch
# update to tdlib 0.9 (Fedora)
  patch -p1 -i ../sagemath-tdlib-0.9.patch
# Adapt to Singular changes
  patch -p1 -i ../singular-4.4.patch

  ./bootstrap
}

build() {
  export SAGE_NUM_THREADS=$(($(nproc)/2))
  export PYTHONPATH="$PWD"/sage/pkgs/sage-setup

  for _pkg in ${_pkgs[@]}; do
    cd "$srcdir"/sage/pkgs/sagemath-$_pkg
    python setup.py build
  done
}

package() {
  for _pkg in ${_pkgs[@]}; do
    cd "$srcdir"/sage/pkgs/sagemath-$_pkg
    python setup.py install --root="$pkgdir" --optimize=1
  done

# fix symlinks to assets
  _pythonpath=`python -c "from sysconfig import get_path; print(get_path('platlib'))"`
  for _i in $(ls "$srcdir"/sage/src/sage/ext_data/notebook-ipython); do
    rm "$pkgdir"/usr/share/jupyter/kernels/sagemath/$_i
    ln -s $_pythonpath/sage/ext_data/notebook-ipython/$_i "$pkgdir"/usr/share/jupyter/kernels/sagemath/
  done

# adjust threejs version
  rm "$pkgdir"$_pythonpath/sage/ext_data/threejs/threejs-version.txt
  ln -s /usr/share/threejs-sage/version "$pkgdir"$_pythonpath/sage/ext_data/threejs/threejs-version.txt
}