summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 5f2f9822e6e18d95058997219d4f1dc73bb35242 (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
# Ruijie Yu (first.last@outlook.com)
pkgname=semver-cpp
_pkgname="$pkgname"
__pkgname="${_pkgname%-cpp}"
pkgver=0.2.2
pkgrel=1
pkgdesc='Semantic Versioning for modern C++'
url="https://github.com/Neargye/semver"
arch=(any)
license=(MIT)
depends=()
optdepends=(
'gcc: c++ compiler'
'clang: c++ compiler'
)
makedepends=(cmake make)
source=(
    # extracted: semver-0.2.2
    "$url/archive/v$pkgver.tar.gz"
)
sha512sums=('f299e6d74f0232f40e20959ed3d7138d5faff924f60748827849e21951d76d34070bac2479a35f3ea6e801ec5e23ebf8391adedc70d778c4aa5e4c89b20c332c')
_cmake_config=Release

_extracted="$__pkgname-$pkgver"
prepare() {
    cd "$srcdir/$_extracted"
    cmake \
        --warn-uninitialized \
        --warn-unused-vars \
        -S . -B build
}

build() {
    cmake \
        --build "$srcdir/$_extracted/build" \
        --config "$_cmake_config" \
        -j
}

check() {
    cd "$srcdir/$_extracted/build"
    ctest \
        --no-tests=ignore \
        --output-on-failure \
        --progress
}

package() {
    cmake \
        --install "$srcdir/$_extracted/build" \
        --prefix "$pkgdir/usr/" \
        --config "$_cmake_config"
}