summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 9c1d80d41a0b2e17aa9bb107f32ebf8e8d5e4f9a (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
# Maintainer: lain <aur@hacktheinter.net>
pkgname=ffts-git
pkgver=r799.fe86885
pkgrel=3
pkgdesc="The Fastest Fourier Transform in the South"
provides=("${pkgname%-git}")
conflicts=("${pkgname%-git}")
arch=('any')
url='https://github.com/anthonix/ffts'
license=('BSD')
depends=()
makedepends=('git' 'cmake')
source=(
  'git+https://github.com/anthonix/ffts.git'
  'fix-non-sse2.patch'
)
md5sums=(
  'SKIP'
  'e7711b3c9f73a2f36fbf405663c05c9d'
)

pkgver() {
  cd ffts
  printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

prepare() {
  cd ffts
  # Patch to fix compilation on non-SSE2 machines
  # Source: https://github.com/anthonix/ffts/pull/78
  # (has no effect on SSE2 machines, so we can just always apply the patch)
  git apply $srcdir/fix-non-sse2.patch
}

build() {
  mkdir -p ffts/build
  cd ffts/build
  cmake -DENABLE_SHARED=ON -DCMAKE_INSTALL_PREFIX=/usr ..
  make
}

package() {
  cd ffts
  install -Dm644 COPYRIGHT "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
  cd build
  make DESTDIR="$pkgdir" install
}