summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 20abfff0144ce71b1a4d58f612b961b1627325fd (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
# Contributor: Connor Behan <connor.behan@gmail.com>
# Contributor: Rémy Oudompheng <remy@archlinux.org>

pkgname=macaulay2
pkgver=19030.995c6fd8c
pkgrel=1
pkgdesc="Software system for algebraic geometry and commutative algebra"
arch=('i686' 'x86_64')
url="http://www.math.uiuc.edu/Macaulay2/"
license=('GPL')
depends=('gcc-fortran' 'readline' 'gdbm' 'gc' 'mpir' 'mpfr' 'mpsolve-git' 'boost' 'lapack' 'cblas' 'eigen' 'ntl' 'scscp' 'singular-factory' 'frobby' 'flint' 'cddlib' 'glpk' 'gfan' 'gtest')
makedepends=('git' 'unzip' 'emacs' 'texinfo')
source=('git+https://github.com/Macaulay2/M2')

pkgver() {
  cd "${srcdir}"/M2
  echo `git rev-list --count master`.`git rev-parse --short master`
}

build() {
  cd "$srcdir"/M2/M2

  # Some provided examples will make M2 crash if the -q option is used.
  # Removing -q works, but it might require ~/.Macaulay2/init.m2 to be present.
  sed -i -e 's|GTEST_PATH="\$(BUILTLIBPATH)/include/gtest"|GTEST_PATH="/usr/src/googletest"|g' configure.ac
  sed -i -e 's/IgnoreExampleErrors ?= false/IgnoreExampleErrors ?= true/' Macaulay2/packages/Makefile.in
  sed -i -e 's/ -q//' Macaulay2/packages/Makefile.in

  # M2 recommends to run make first which runs autoconf and autoheader
  make
  #autoreconf
  # Now run configure and then make again
  ./configure "LIBS=-lcblas" --prefix=/usr \
    --libexecdir='${prefix}'/lib/Macaulay2 \
    --enable-shared --enable-download \
    --enable-frobby --enable-pari --disable-gfan
  make -j1
}

package() {
  cd "$srcdir"/M2/M2
  mkdir "$pkgdir"/usr

  # If we used DESTDIR instead, the submodules would create /var/abs/local/ within /var/abs/local/
  # We would also not get the utilities in /usr/lib/Macaulay2/Macaulay2/bin/
  make install prefix="$pkgdir"/usr

  cd "$pkgdir"/usr/share
  mv info info-mac
  mkdir info
  mv info-mac info/Macaulay2
}
md5sums=('SKIP')