summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: fafee33329cab7c3d1c16c3efce6e127b169eaee (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

pkgname=mingw-w64-optpp
pkgver=2.4
pkgrel=3
pkgdesc='An Object-Oriented Nonlinear Optimization Library (mingw-w64)'
url='https://software.sandia.gov/opt++/'
arch=('any')
license=('LGPL2.1')
depends=('mingw-w64-blas')
makedepends=('mingw-w64-configure')
options=('staticlibs' '!buildflags' '!strip')
#source=("${url}/downloads/optpp-${pkgver}.tar.gz")
#sha256sums=('b452cdf8aa770088e26b49e07b5cf13ae5972832c032abcad07a56baa2a588ef')

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

prepare() {
  # SSL certificate problem: unable to get local issuer certificate
  curl -k https://software.sandia.gov/opt++//downloads/optpp-2.4.tar.gz | tar xz
}

build() {
  cd "${srcdir}/optpp-${pkgver}"
  for _arch in ${_architectures}; do
    mkdir -p build-${_arch} && pushd build-${_arch}
    LDFLAGS="-Wl,-no-undefined" ${_arch}-configure --includedir=/usr/${_arch}/include/opt++
    make
    popd
  done
}

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