summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: dc6a0fbe06759d227c6682557833381e9bd0ae2b (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
pkgname=mingw-w64-fann
pkgver=2.2.0
pkgrel=1
pkgdesc="Fast artificial neural network library (mingw-w64)"
arch=(any)
url="https://leenissen.dk/fann/"
depends=('mingw-w64-crt')
makedepends=('mingw-w64-cmake')
license=('LGPL2.1')
options=('!buildflags' 'staticlibs' '!strip')
source=("http://downloads.sourceforge.net/fann/${pkgver}/FANN-${pkgver}-Source.zip"
        'fann-mingw.patch')
md5sums=('292d914684c9eab1d84eb1f59b0fbf69'
         '130a56a7674a47db5c3aa6f81efb44fb')
_architectures="i686-w64-mingw32 x86_64-w64-mingw32"

prepare () {
  cd "$srcdir/FANN-${pkgver}-Source"
  patch -p1 -i "$srcdir"/fann-mingw.patch
}


build() {
  cd "$srcdir/FANN-${pkgver}-Source"
  for _arch in ${_architectures}; do
    mkdir -p build-${_arch}-static && pushd build-${_arch}-static
    ${_arch}-cmake \
      -DCMAKE_BUILD_TYPE=Release \
      -DBUILD_SHARED_LIBS=OFF \
      ..
    make
    popd
    mkdir -p build-${_arch} && pushd build-${_arch}
    ${_arch}-cmake \
      -DCMAKE_BUILD_TYPE=Release \
      ..
    make
    popd
  done
}

package() {
  for _arch in ${_architectures}; do  
    cd "$srcdir/FANN-${pkgver}-Source/build-${_arch}-static"
    make DESTDIR="$pkgdir" install
    cd "$srcdir/FANN-${pkgver}-Source/build-${_arch}"
    make DESTDIR="$pkgdir" install
    ${_arch}-strip --strip-unneeded "$pkgdir"/usr/${_arch}/bin/*.dll
    ${_arch}-strip -g "$pkgdir"/usr/${_arch}/lib/*.a
  done
}