# Contributor: William Pitcock # Maintainer: William Pitcock pkgname=fftw pkgver=3.3.5 pkgrel=0 pkgdesc="fastest fourier transform in the west" url="http://www.fftw.org/" license="GPL" depends= makedepends="texinfo" install= # 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" prepare() { cd "$_builddir" 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 case "$i--$CARCH" in single--x86_64 | double--x86_64) _cf="$_cf --enable-sse2 --enable-avx";; single--arm*) _cf="$_cf --enable-neon";; esac msg "Building for $i precision ($_cf)" 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() { 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="6cc08a3b9c7ee06fdd5b9eb02e06f569 fftw-3.3.5.tar.gz" sha256sums="8ecfe1b04732ec3f5b7d279fdb8efcad536d555f9d1e8fabd027037d45ea8bcf fftw-3.3.5.tar.gz" sha512sums="a81f02d884cfe4171fab479b0e5ec76eceb9c5da6d4eda1f89281b7e1efa2d8176c9ba87051595c402889eb32172d216ce40eb2bef41289c646f01002fb4ba8e fftw-3.3.5.tar.gz"