summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 48ff9f44bdb143639e47dc581d4c8282143e39b1 (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
# Maintainer: Chocobo1 <chocobo1 AT archlinux DOT net>

pkgname=cmocka-git
pkgver=1.1.5.r196.g309ee5e
pkgrel=2
pkgdesc="An unit testing framework for C with support for mock objects"
arch=('i686' 'x86_64')
url="https://cmocka.org/"
license=('Apache')
depends=('glibc')
makedepends=('git' 'cmake')
provides=("cmocka=$pkgver")
conflicts=('cmocka')
options=('staticlibs')
source=("git+https://git.cryptomilk.org/projects/cmocka.git")
sha256sums=('SKIP')


pkgver() {
  cd "cmocka"

  git describe --long --tags | sed 's/^cmocka-//;s/\([^-]*-g\)/r\1/;s/-/./g'
}

build() {
  cd "cmocka"

  cmake \
    -B "_build" \
    -DCMAKE_BUILD_TYPE=Release \
    -DCMAKE_INSTALL_PREFIX="/usr" \
    -DUNIT_TESTING=ON \
    ./
  make -C "_build"
}

check() {
  cd "cmocka"

  make -C "_build" test
}

package() {
  cd "cmocka"

  make -C "_build" DESTDIR="$pkgdir" install
}