summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 72d5f76256653fc7b347f3b04f23311ff5901f5c (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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
pkgname=mingw-w64-lapack
pkgname=('mingw-w64-lapack' 'mingw-w64-blas' 'mingw-w64-cblas' 'mingw-w64-lapacke')
pkgver=3.12.0
pkgrel=5
arch=('any')
pkgdesc="Linear Algebra PACKage (mingw-w64)"
makedepends=('mingw-w64-cmake')
options=('!buildflags' '!strip' 'staticlibs')
license=('LGPL')
url="http://www.netlib.org/lapack"
source=("https://github.com/Reference-LAPACK/lapack/archive/v${pkgver}.tar.gz")
sha256sums=('eac9570f8e0ad6f30ce4b963f4f033f0f643e7c3912fc9ee6cd99120675ad48b')

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

prepare()
{
  cd "$srcdir/lapack-${pkgver}"
}

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

package_mingw-w64-lapack()
{
  depends=("mingw-w64-blas")
  for _arch in ${_architectures}; do
    cd "$srcdir/lapack-${pkgver}/build-${_arch}-static"
    make install DESTDIR="$pkgdir"
    cd "$srcdir/lapack-${pkgver}/build-${_arch}"
    make install DESTDIR="$pkgdir"
    rm "$pkgdir"/usr/${_arch}/*/lib*blas*
    rm "$pkgdir"/usr/${_arch}/*/lib*lapacke*
    rm "$pkgdir"/usr/${_arch}/lib/pkgconfig/*blas.pc
    rm "$pkgdir"/usr/${_arch}/lib/pkgconfig/*lapacke.pc
    rm -r "$pkgdir"/usr/${_arch}/include/
    rm -r "$pkgdir"/usr/${_arch}/lib/cmake/cblas*
    rm -r "$pkgdir"/usr/${_arch}/lib/cmake/lapacke*
    ${_arch}-strip --strip-unneeded "$pkgdir"/usr/${_arch}/bin/*.dll
    ${_arch}-strip -g "$pkgdir"/usr/${_arch}/lib/*.a
  done
}

package_mingw-w64-blas()
{
  pkgdesc="Basic Linear Algebra Subprograms (mingw-w64)"
  depends=(mingw-w64-crt mingw-w64-gcc)
  for _arch in ${_architectures}; do
    cd "$srcdir/lapack-${pkgver}/build-${_arch}-static/BLAS"
    make install DESTDIR="$pkgdir"
    cd "$srcdir/lapack-${pkgver}/build-${_arch}/BLAS"
    make install DESTDIR="$pkgdir"
    ${_arch}-strip --strip-unneeded "$pkgdir"/usr/${_arch}/bin/*.dll
    ${_arch}-strip -g "$pkgdir"/usr/${_arch}/lib/*.a
  done
}

package_mingw-w64-cblas()
{
  pkgdesc="C interface to BLAS (mingw-w64)"
  depends=("mingw-w64-blas")
  for _arch in ${_architectures}; do
    cd "$srcdir/lapack-${pkgver}/build-${_arch}-static/CBLAS"
    make install DESTDIR="$pkgdir"
    cd "$srcdir/lapack-${pkgver}/build-${_arch}/CBLAS"
    make install DESTDIR="$pkgdir"
    ${_arch}-strip --strip-unneeded "$pkgdir"/usr/${_arch}/bin/*.dll
    ${_arch}-strip -g "$pkgdir"/usr/${_arch}/lib/*.a
  done
}

package_mingw-w64-lapacke()
{
  pkgdesc="C interface to LAPACK (mingw-w64)"
  depends=("mingw-w64-lapack")
  for _arch in ${_architectures}; do
    cd "$srcdir/lapack-${pkgver}/build-${_arch}-static/LAPACKE"
    make install DESTDIR="$pkgdir"
    cd "$srcdir/lapack-${pkgver}/build-${_arch}/LAPACKE"
    make install DESTDIR="$pkgdir"
    ${_arch}-strip --strip-unneeded "$pkgdir"/usr/${_arch}/bin/*.dll
    ${_arch}-strip -g "$pkgdir"/usr/${_arch}/lib/*.a
  done
}