aboutsummaryrefslogtreecommitdiffstats
path: root/community/eigen/APKBUILD
blob: 43d1da4076d9b36e43ea748b2237e5805c5abda7 (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
# Contributor: stef <l0ls0fo2i@ctrlc.hu>
# Contributor: Bradley J Chambers <brad.chambers@gmail.com>
# Maintainer: Bradley J Chambers <brad.chambers@gmail.com>
pkgname=eigen
pkgver=3.3.7
pkgrel=1
pkgdesc="Eigen is a C++ template library for linear algebra"
url="http://eigen.tuxfamily.org/index.php?title=Main_Page"
arch="noarch"
license="MPL-2.0"
depends=""
options="!check"  # checks take a long time, and tend to fail randomly
makedepends="cmake openblas-dev suitesparse-dev mpfr-dev fftw-dev boost-dev gmp-dev glu-dev freeglut-dev"
install=""
subpackages="$pkgname-dev $pkgname-doc"
source="$pkgname-$pkgver.tar.gz::http://bitbucket.org/eigen/$pkgname/get/$pkgver.tar.gz
	fftw-test-fix.patch"
builddir="$srcdir/$pkgname-$pkgname"

build() {
	mkdir -p build
	cd build
	# needs -std so c11 tests are being built
	CXXFLAGS="-std=c++11" \
	cmake -DCMAKE_INSTALL_PREFIX=/usr "$builddir"
	make
}

prepare() {
	mv "$builddir"-* "$builddir"  # directory name contains hash
	default_prepare
}

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

dev() {
	default_dev
	mkdir -p ${subpkgdir}/usr/share/cmake/Modules
	mv $pkgdir/usr/share/eigen3/cmake/*.cmake ${subpkgdir}/usr/share/cmake/Modules
}

package() {
	cd "$builddir/build"
	make DESTDIR="$pkgdir" install
	mkdir -p "$pkgdir"/usr/share/doc/$pkgname
	cp -r "$builddir"/doc/ "$pkgdir"/usr/share/doc/$pkgname
	mkdir -p $pkgdir/usr/lib/pkgconfig
	mv $pkgdir/usr/share/pkgconfig/eigen3.pc $pkgdir/usr/lib/pkgconfig
}

sha512sums="34cf600914cce719d61511577ef9cd26fbdcb7a6fad1d0ab8396f98b887fac6a5577d3967e84a8f56225cc50de38f3b91f34f447d14312028383e32b34ea1972  eigen-3.3.7.tar.gz
c1f9d7d8c9025b4b2b3a679f80519e494f206d7bee232cd10dd45df454b1ce6697858547bc0d956a5818481d344948704db8dbb39d04ac69ff7de99961492384  fftw-test-fix.patch"