# $Id: PKGBUILD 197299 2013-10-25 01:41:11Z allan $ # Maintainer: Ronald van Haren # Contributor: damir pkgname=fftw pkgver=3.3.3 pkgrel=2 pkgdesc="A library for computing the discrete Fourier transform (DFT)" arch=('i686' 'x86_64' 'mips64el') license=('GPL2') url="http://www.fftw.org/" depends=('glibc' 'bash') makedepends=('gcc-fortran') source=("http://www.fftw.org/${pkgname}-${pkgver}.tar.gz") install=fftw.install sha1sums=('11487180928d05746d431ebe7a176b52fe205cf9') # notes: # http://www.fftw.org/fftw2_doc/fftw_6.html#SEC69 # http://www.fftw.org/faq/section2.html#singleprec # http://www.fftw.org/fftw3_doc/Precision.html#Precision build() { cd ${srcdir} cp -a ${pkgname}-${pkgver} ${pkgname}-${pkgver}-double cp -a ${pkgname}-${pkgver} ${pkgname}-${pkgver}-long-double mv ${pkgname}-${pkgver} ${pkgname}-${pkgver}-single if [ "$CARCH" = "mips64el" ] ; then sse2="" sse="" aligndouble="" else sse2="--enable-sse2" sse="--enable-sse" aligndouble="-malign-double" fi # use upstream default CFLAGS while keeping our -march/-mtune CFLAGS+=" -O3 -fomit-frame-pointer $aligndouble -fstrict-aliasing -ffast-math" CONFIGURE="./configure F77=gfortran --prefix=/usr \ --enable-shared --enable-threads" # build double precision cd ${srcdir}/${pkgname}-${pkgver}-double $CONFIGURE $sse2 make # build & install long double precission cd ${srcdir}/${pkgname}-${pkgver}-long-double $CONFIGURE --enable-long-double make # build & install single precision cd ${srcdir}/${pkgname}-${pkgver}-single $CONFIGURE --enable-float $sse make } package() { cd ${srcdir}/${pkgname}-${pkgver}-double make DESTDIR=${pkgdir} install cd ${srcdir}/${pkgname}-${pkgver}-long-double make DESTDIR=${pkgdir} install cd ${srcdir}/${pkgname}-${pkgver}-single make DESTDIR=${pkgdir} install }