summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 93782c56c35f170323897d31534e8258253e581c (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.r39.g314602b
pkgrel=1
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')
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
}