aboutsummaryrefslogtreecommitdiffstats
path: root/main/fftw
diff options
context:
space:
mode:
authorCarlo Landmeter <clandmeter@gmail.com>2015-11-18 09:30:05 +0100
committerCarlo Landmeter <clandmeter@gmail.com>2015-11-18 09:32:32 +0100
commit4dcf7a025a230a0e27a907efc119c5ab21f747a0 (patch)
treeab76c3851cccbbbc0ae4564db4d1b5f8cb59ef0d /main/fftw
parent941dc702ae960aab85ddd886db96df5947df0f94 (diff)
downloadaports-4dcf7a025a230a0e27a907efc119c5ab21f747a0.tar.bz2
aports-4dcf7a025a230a0e27a907efc119c5ab21f747a0.tar.xz
main/fftw: enable multiple precisions
Diffstat (limited to 'main/fftw')
-rw-r--r--main/fftw/APKBUILD84
1 files changed, 65 insertions, 19 deletions
diff --git a/main/fftw/APKBUILD b/main/fftw/APKBUILD
index c1ad92c41a..71ae3a9871 100644
--- a/main/fftw/APKBUILD
+++ b/main/fftw/APKBUILD
@@ -2,38 +2,84 @@
# Maintainer: William Pitcock <nenolod@dereferenced.org>
pkgname=fftw
pkgver=3.3.4
-pkgrel=0
+pkgrel=1
pkgdesc="fastest fourier transform in the west"
url="http://www.fftw.org/"
license="GPL"
depends=
-makedepends=
+makedepends="texinfo libquadmath"
install=
-subpackages="$pkgname-dev $pkgname-doc $pkgname-libs"
+# order of the libs split functions are important because of lib naming
+subpackages="$pkgname-dev $pkgname-doc $pkgname-single-libs:single
+ $pkgname-long-double-libs:long_double $pkgname-double-libs:double"
source="http://www.fftw.org/$pkgname-$pkgver.tar.gz"
arch="all"
+_precision="single double long-double"
-_builddir="$srcdir"/$pkgname-$pkgver
+_builddir="$srcdir"
-build() {
+prepare() {
cd "$_builddir"
- ./configure \
- --build=$CBUILD \
- --host=$CHOST \
- --prefix=/usr \
- --sysconfdir=/etc \
- --mandir=/usr/share/man \
- --infodir=/usr/share/info \
- --enable-single \
- --enable-shared \
- --enable-threads \
- || return 1
- make || return 1
+ for i in $_precision; do
+ cp -r "$srcdir"/$pkgname-$pkgver $srcdir/$i
+ done
+}
+
+build() {
+ for i in $_precision; do
+ case "$i" in
+ single)_cf="--enable-single";;
+ double)_cf="";;
+ long-double)_cf="--enable-long-double";;
+ esac
+
+ if [ "$i" = "single" ] || [ "$i" = "double" ]; then
+ case "$CARCH" in
+ x86_64)_cf="$_cf --enable-sse2 --enable-avx";;
+ armhf)_cf="$_cf --enable-neon";;
+ esac
+ fi
+
+ msg "Building for $i precision"
+ cd "$_builddir"/$i
+ ./configure \
+ --build=$CBUILD \
+ --host=$CHOST \
+ --prefix=/usr \
+ --sysconfdir=/etc \
+ --mandir=/usr/share/man \
+ --infodir=/usr/share/info \
+ --enable-shared \
+ --enable-threads \
+ $_cf \
+ || return 1
+ make || return 1
+ done
}
package() {
- cd "$_builddir"
- make DESTDIR="$pkgdir" install || return 1
+ for i in $_precision; do
+ cd "$_builddir"/$i
+ make DESTDIR="$pkgdir" install || return 1
+ done
+}
+
+single() {
+ mkdir -p "$subpkgdir"/usr/lib || return 1
+ mv "$pkgdir"/usr/lib/libfftw3f*.so* \
+ "$subpkgdir"/usr/lib/ || return 1
+}
+
+double() {
+ mkdir -p "$subpkgdir"/usr/lib || return 1
+ mv "$pkgdir"/usr/lib/libfftw3*.so* \
+ "$subpkgdir"/usr/lib/ || return 1
+}
+
+long_double() {
+ mkdir -p "$subpkgdir"/usr/lib || return 1
+ mv "$pkgdir"/usr/lib/libfftw3l*.so* \
+ "$subpkgdir"/usr/lib/ || return 1
}
md5sums="2edab8c06b24feeb3b82bbb3ebf3e7b3 fftw-3.3.4.tar.gz"