summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: ac616c3316c7b9aa28c1874ccdad3613003e5bb7 (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
pkgname=mingw-w64-fftw
pkgver=3.3.10
pkgrel=1
pkgdesc="A library for computing the discrete Fourier transform (DFT) (mingw-w64)"
arch=('any')
url="http://www.fftw.org"
license=("GPL")
depends=('mingw-w64-crt')
makedepends=('mingw-w64-configure')
checkdepends=('mingw-w64-wine')
options=(staticlibs !strip !buildflags)
source=("$url/fftw-${pkgver}.tar.gz")
sha256sums=('56c932549852cddcfafdab3820b0200c7742675be92179e59e6215b340e26467')

_architectures="i686-w64-mingw32 x86_64-w64-mingw32"

build() {
  cd "${srcdir}/fftw-${pkgver}"
  for _arch in ${_architectures}; do
    mkdir -p build-${_arch}-d && pushd build-${_arch}-d
    ${_arch}-configure \
      --disable-dependency-tracking \
      --disable-threads
    make
    popd

    mkdir -p build-${_arch}-ld && pushd build-${_arch}-ld
    ${_arch}-configure \
      --enable-long-double \
      --disable-dependency-tracking \
      --disable-threads
    make
    popd

    mkdir -p build-${_arch}-f && pushd build-${_arch}-f
    ${_arch}-configure \
      --enable-float \
      --disable-dependency-tracking \
      --disable-threads
    make
    popd

    mkdir -p build-${_arch}-q && pushd build-${_arch}-q
    ${_arch}-configure \
      --enable-quad-precision \
      --disable-dependency-tracking \
      --disable-threads
    make
    popd
  done
}

check() {
  cd "${srcdir}/fftw-${pkgver}"

  # run tests through wine
  sed -i "s|\$program=\$arglist\[0\]|\$program=\"wine \$arglist[0]\"|g" tests/check.pl

  for _arch in ${_architectures}; do
    cd "${srcdir}/fftw-${pkgver}/build-${_arch}-d"
    ${_arch}-wine tests/bench.exe --verbose=1 --verify 'ofcd7*1' --verify 'ifr40x13v32' --verify 'ifcd10x9x5*10'
    #make check
  done
}

package() {
  for _arch in ${_architectures}; do
    cd "${srcdir}/fftw-${pkgver}/build-${_arch}-d"
    make DESTDIR="$pkgdir" install
    cd "${srcdir}/fftw-${pkgver}/build-${_arch}-ld"
    make DESTDIR="$pkgdir" install
    cd "${srcdir}/fftw-${pkgver}/build-${_arch}-f"
    make DESTDIR="$pkgdir" install
    cd "${srcdir}/fftw-${pkgver}/build-${_arch}-q"
    make DESTDIR="$pkgdir" install
    rm "$pkgdir"/usr/${_arch}/bin/*.exe
    ${_arch}-strip --strip-unneeded "$pkgdir"/usr/${_arch}/bin/*.dll
    ${_arch}-strip -g "$pkgdir"/usr/${_arch}/lib/*.a
    rm "$pkgdir/usr/${_arch}/bin/fftw-wisdom-to-conf"
    rm -r "$pkgdir/usr/${_arch}/share"
  done
}