| 1 | # Contributor: Jakub Jirutka <[email protected]> |
| 2 | # Maintainer: Jakub Jirutka <[email protected]> |
| 3 | pkgname=arpack |
| 4 | _pkgname=$pkgname-ng |
| 5 | pkgver=3.9.1 |
| 6 | pkgrel=0 |
| 7 | pkgdesc="Collection of Fortran77 subroutines designed to solve large scale eigenvalue problems" |
| 8 | url="https://github.com/opencollab/arpack-ng" |
| 9 | arch="all" |
| 10 | license="BSD-3-Clause" |
| 11 | depends_dev="openblas-dev>=0.3.0" |
| 12 | makedepends=" |
| 13 | $depends_dev |
| 14 | autoconf |
| 15 | automake |
| 16 | gfortran |
| 17 | libtool |
| 18 | " |
| 19 | subpackages="$pkgname-dev $pkgname-doc" |
| 20 | source="https://github.com/opencollab/$_pkgname/archive/$pkgver/arpack-$pkgver.tar.gz" |
| 21 | builddir="$srcdir/$_pkgname-$pkgver" |
| 22 | |
| 23 | # Tests hang on ppc64le when running via abuild, don't know why. |
| 24 | case "$CARCH" in |
| 25 | ppc64le) options="!check";; |
| 26 | esac |
| 27 | |
| 28 | _ilp64=no |
| 29 | _builddir64="$builddir-64" |
| 30 | if [ "$CARCH" = "x86_64" ]; then |
| 31 | subpackages="$subpackages $pkgname-ilp64" |
| 32 | _ilp64=yes |
| 33 | fi |
| 34 | |
| 35 | prepare() { |
| 36 | default_prepare |
| 37 | |
| 38 | ./bootstrap |
| 39 | cp -ar "$builddir" "$_builddir64" |
| 40 | } |
| 41 | |
| 42 | build() { |
| 43 | export FFLAGS="$FFLAGS -fallow-argument-mismatch -ffixed-line-length-132" |
| 44 | |
| 45 | _build |
| 46 | |
| 47 | if [ "$_ilp64" = yes ]; then |
| 48 | msg "Building with ILP64..." |
| 49 | |
| 50 | cd "$builddir-64" |
| 51 | _build LIBSUFFIX=64_ \ |
| 52 | SYMBOLSUFFIX=_64 \ |
| 53 | INTERFACE64=1 \ |
| 54 | --with-blas=openblas64_ \ |
| 55 | --with-lapack=openblas64_ |
| 56 | fi |
| 57 | } |
| 58 | |
| 59 | _build() { |
| 60 | ./configure \ |
| 61 | --build=$CBUILD \ |
| 62 | --host=$CHOST \ |
| 63 | --prefix=/usr \ |
| 64 | --enable-shared \ |
| 65 | --enable-static \ |
| 66 | --enable-icb \ |
| 67 | "$@" |
| 68 | make |
| 69 | } |
| 70 | |
| 71 | check() { |
| 72 | make check |
| 73 | } |
| 74 | |
| 75 | package() { |
| 76 | if [ "$_ilp64" = yes ]; then |
| 77 | make -C "$_builddir64" DESTDIR="$pkgdir" install |
| 78 | fi |
| 79 | |
| 80 | make DESTDIR="$pkgdir" install |
| 81 | |
| 82 | install -D -m644 COPYING "$pkgdir"/usr/share/licenses/$pkgname/COPYING |
| 83 | |
| 84 | install -d "$pkgdir"/usr/share/doc/$pkgname |
| 85 | mv DOCUMENTS/* "$pkgdir"/usr/share/doc/$pkgname/ |
| 86 | } |
| 87 | |
| 88 | ilp64() { |
| 89 | pkgdesc="$pkgdesc (ILP64)" |
| 90 | |
| 91 | amove usr/lib/libarpack64_* |
| 92 | } |
| 93 | |
| 94 | sha512sums=" |
| 95 | 1ca590a8c4f75aa74402f9bd62e63851039687f4cb11afa8acb05fce1f22a512bff5fd1709ea85fdbea90b344fbbc01e3944c770b5ddc4d1aabc98ac334f78d2 arpack-3.9.1.tar.gz |
| 96 | " |