aboutsummaryrefslogtreecommitdiffstats
path: root/community/arpack/APKBUILD
blob: 50399acfd4d3fc83865ce403ae013842f72ef795 (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
# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=arpack
_pkgname=$pkgname-ng
pkgver=3.6.3
pkgrel=0
pkgdesc="Collection of Fortran77 subroutines designed to solve large scale eigenvalue problems"
url="https://github.com/opencollab/arpack-ng"
arch="all"
license="BSD"
depends=""
depends_dev="openblas-dev>=0.3.0"
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"

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

_ilp64=no
_builddir64="$builddir-64"
if [ "$CARCH" = "x86_64" ]; then
	subpackages="$subpackages $pkgname-ilp64"
	_ilp64=yes
fi

prepare() {
	default_prepare
	cd "$builddir"

	./bootstrap
	cp -ar "$builddir" "$_builddir64"
}

build() {
	cd "$builddir"
	_build

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

		cd "$builddir-64"
		_build LIBSUFFIX=64_ \
			SYMBOLSUFFIX=_64 \
			INTERFACE64=1 \
			--with-blas=openblas64_ \
			--with-lapack=openblas64_
	fi
}

_build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		"$@"
	make
}

check() {
	cd "$builddir"
	make check
}

package() {
	if [ "$_ilp64" = yes ]; then
		make -C "$_builddir64" DESTDIR="$pkgdir" install
	fi

	cd "$builddir"
	make DESTDIR="$pkgdir" install

	install -D -m644 COPYING \
		"$pkgdir"/usr/share/licenses/$pkgname/COPYING

	install -d "$pkgdir"/usr/share/doc/$pkgname
	mv DOCUMENTS/* "$pkgdir"/usr/share/doc/$pkgname/
}

ilp64() {
	pkgdesc="$pkgdesc (ILP64)"

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

sha512sums="8b404276380400feb7b0f089865b5f1f612736d42982d46a1f93a0c3a4561c08762e923a68cfe65785a9b161f21888ad921204e9a5ab058633ca6985349e1263  arpack-3.6.3.tar.gz"