APKBUILD 1.94 KB
Newer Older
Jakub Jirutka's avatar
Jakub Jirutka committed
1 2 3 4
# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=arpack
_pkgname=$pkgname-ng
5 6
pkgver=3.5.0
pkgrel=0
Jakub Jirutka's avatar
Jakub Jirutka committed
7 8
pkgdesc="Collection of Fortran77 subroutines designed to solve large scale eigenvalue problems"
url="https://github.com/opencollab/arpack-ng"
9
arch="all !s390x"  # openblas not avail on excluded platform
Jakub Jirutka's avatar
Jakub Jirutka committed
10 11 12 13 14 15 16 17
license="BSD"
depends=""
depends_dev="openblas-dev"
makedepends="$depends_dev autoconf automake gfortran libtool"
subpackages="$pkgname-dev $pkgname-doc"
source="$pkgname-$pkgver.tar.gz::https://github.com/opencollab/$_pkgname/archive/$pkgver.tar.gz"
builddir="$srcdir/$_pkgname-$pkgver"

18
# Tests hang on ppc64le when running via abuild, don't know why.
19
case "$CARCH" in
20
	ppc64le) options="!check";;
21 22
esac

23 24 25 26 27 28 29
_ilp64=no
_builddir64="$builddir-64"
if [ "$CARCH" = "x86_64" ]; then
	subpackages="$subpackages $pkgname-ilp64"
	_ilp64=yes
fi

Jakub Jirutka's avatar
Jakub Jirutka committed
30
prepare() {
31
	default_prepare
32
	cd "$builddir"
33

Jakub Jirutka's avatar
Jakub Jirutka committed
34
	./bootstrap
35
	cp -ar "$builddir" "$_builddir64"
Jakub Jirutka's avatar
Jakub Jirutka committed
36 37 38 39
}

build() {
	cd "$builddir"
40
	_build
41 42 43 44 45 46 47 48 49

	if [ "$_ilp64" = yes ]; then
		msg "Building with ILP64..."

		cd "$builddir-64"
		_build LIBSUFFIX=64_ \
			SYMBOLSUFFIX=_64 \
			INTERFACE64=1 \
			--with-blas=openblas64_ \
50
			--with-lapack=openblas64_
51 52
	fi
}
Jakub Jirutka's avatar
Jakub Jirutka committed
53

54
_build() {
Jakub Jirutka's avatar
Jakub Jirutka committed
55 56 57 58
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
59
		"$@"
Jakub Jirutka's avatar
Jakub Jirutka committed
60 61 62
	make
}

63 64 65 66 67
check() {
	cd "$builddir"
	make check
}

Jakub Jirutka's avatar
Jakub Jirutka committed
68
package() {
69
	if [ "$_ilp64" = yes ]; then
70
		make -C "$_builddir64" DESTDIR="$pkgdir" install
71
	fi
Jakub Jirutka's avatar
Jakub Jirutka committed
72

73
	cd "$builddir"
74
	make DESTDIR="$pkgdir" install
Jakub Jirutka's avatar
Jakub Jirutka committed
75

76
	install -D -m644 COPYING \
77
		"$pkgdir"/usr/share/licenses/$pkgname/COPYING
Jakub Jirutka's avatar
Jakub Jirutka committed
78

79
	install -d "$pkgdir"/usr/share/doc/$pkgname
Jakub Jirutka's avatar
Jakub Jirutka committed
80 81 82
	mv DOCUMENTS/* "$pkgdir"/usr/share/doc/$pkgname/
}

83 84 85 86 87 88 89
ilp64() {
	pkgdesc="$pkgdesc (ILP64)"

	mkdir -p "$subpkgdir"/usr/lib
	mv "$pkgdir"/usr/lib/libarpack64_* "$subpkgdir"/usr/lib/
}

90
sha512sums="67181c783e61d5d2214ccbfa0de8efd55148537feca30376760f7009995694f68c9fc14991306fa19ad67598497510b6e0d42b68dc56dd581dc2a798e3a4b369  arpack-3.5.0.tar.gz"