summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 6fbe58c00c2a3bf08e5fc19ef92083a388669461 (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
# Maintainer: Daniel Bermond <dbermond@archlinux.org>

pkgname=cnmatrix
pkgver=0.0
pkgrel=4
pkgdesc='C interface to a few matrix backends'
arch=('x86_64')
url='https://github.com/cntools/cnmatrix/'
license=('MIT')
depends=(
    'cblas'
    'lapacke')
makedepends=(
    'cmake'
    'eigen3')
source=("https://github.com/cntools/cnmatrix/archive/v${pkgver}/${pkgname}-${pkgver}.tar.gz")
sha256sums=('c9c43791b258feb25436288b1e219566903d72a158c81480a2185f21b0648426')

build() {
    # for allowing the use of a different cblas provider
    export CFLAGS+=" $(pkg-config --cflags cblas)"
    
    cmake -B build -S "${pkgname}-${pkgver}" \
        -G 'Unix Makefiles' \
        -DCMAKE_BUILD_TYPE:STRING='None' \
        -DCMAKE_INSTALL_PREFIX:PATH='/usr' \
        -DENABLE_TESTS:BOOL='ON' \
        -Wno-dev
    cmake --build build
}

check() {
    ctest --test-dir build --output-on-failure
}

package() {
    DESTDIR="$pkgdir" cmake --install build
    install -D -m644 "${pkgname}-${pkgver}/LICENSE" -t "${pkgdir}/usr/share/licenses/${pkgname}"
}