forked from msys2/MINGW-packages
-
Notifications
You must be signed in to change notification settings - Fork 0
/
PKGBUILD
57 lines (48 loc) · 1.94 KB
/
PKGBUILD
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
# Maintainer: Hurcan Solter <hsolter@gmail.com>
_realname=armadillo
pkgbase=mingw-w64-${_realname}
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
pkgver=9.200.7
pkgrel=1
pkgdesc="C++ linear algebra library (mingw-w64)"
arch=('any')
url="https://arma.sourceforge.io/"
license=(MPL2)
depends=("${MINGW_PACKAGE_PREFIX}-gcc-libs"
"${MINGW_PACKAGE_PREFIX}-arpack"
"${MINGW_PACKAGE_PREFIX}-openblas")
makedepends=("${MINGW_PACKAGE_PREFIX}-gcc"
"${MINGW_PACKAGE_PREFIX}-cmake")
install=${_realname}-${CARCH}.install
source=(https://sourceforge.net/projects/arma/files/${_realname}-${pkgver}.tar.xz
0001-mingw-config-fix.patch)
sha256sums=('e2787d40bcd46edf70f65ba4efd523ccb8b96a93fdb8f76da6adf1e921cb7df8'
'772719e60eb2970ecb37844382dbcb6d0439f949c5080f9865798115640b612a')
prepare() {
cd "${srcdir}/${_realname}-${pkgver}"
patch -Np1 -i "${srcdir}/0001-mingw-config-fix.patch"
}
build() {
[[ -d ${srcdir}/build-${MINGW_CHOST} ]] && rm -rf ${srcdir}/build-${MINGW_CHOST}
mkdir -p ${srcdir}/build-${MINGW_CHOST} && cd ${srcdir}/build-${MINGW_CHOST}
MSYS2_ARG_CONV_EXCL="-DCMAKE_INSTALL_PREFIX=" \
${MINGW_PREFIX}/bin/cmake.exe \
-G"MSYS Makefiles" \
-DCMAKE_INSTALL_PREFIX=${MINGW_PREFIX} \
-DCMAKE_BUILD_TYPE=Release \
-DLAPACK_NAMES=openblas \
../${_realname}-${pkgver}
make
}
package() {
cd "${srcdir}/build-${MINGW_CHOST}"
make DESTDIR=${pkgdir} install
install -d ${pkgdir}${MINGW_PREFIX}/share/doc/${_realname}
install -m644 "${srcdir}/${_realname}-${pkgver}/"*{.html,.png,.pdf,README.md} \
"${pkgdir}${MINGW_PREFIX}/share/doc/${_realname}/"
install -Dm644 "${srcdir}/${_realname}-${pkgver}/LICENSE.txt" \
"${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/LICENSE.txt"
# Remove builders local installation path
local _prefix_win=$(cygpath -m ${MINGW_PREFIX})
sed -s "s|${_prefix_win}|${MINGW_PREFIX}|g" -i "${pkgdir}${MINGW_PREFIX}/include/armadillo_bits/config.hpp"
}