aboutsummaryrefslogtreecommitdiffstats
path: root/community/arpack/APKBUILD
blob: 3ffe1301ed432fb8b03c1dd1cba2f0bb3d1bf044 (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
# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=arpack
_pkgname=$pkgname-ng
pkgver=3.4.0
pkgrel=2
pkgdesc="Collection of Fortran77 subroutines designed to solve large scale eigenvalue problems"
url="https://github.com/opencollab/arpack-ng"
arch="all !ppc64le" #openblas not avail on excluded platform
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"

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

prepare() {
	default_prepare || return 1
	cd "$builddir"

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

build() {
	cd "$builddir"
	_build || return 1

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

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

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

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

	cd "$builddir"
	make DESTDIR="$pkgdir" install || return 1

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

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

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

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

md5sums="ae9ca13f2143a7ea280cb0e2fd4bfae4  arpack-3.4.0.tar.gz"
sha256sums="69e9fa08bacb2475e636da05a6c222b17c67f1ebeab3793762062248dd9d842f  arpack-3.4.0.tar.gz"
sha512sums="4577a960ed0783ed2c0eb5e1871c21b9e23e75fbbfa10da1584cd3716f2699c0d633bb0e2019c0aa8809917684ef18d32508b76cb1edfc62b1179d5bbc2b68ba  arpack-3.4.0.tar.gz"