summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: a88231c8394cf930e321bd77bc81f8fd7e6535d6 (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
# Maintainer: INAJIMA Daisuke <inajima at gmail dot com>

_pkgname=fcitx5-vi-escape
pkgname=$_pkgname-git
pkgver=0.1.0.g12611dd
pkgrel=1
pkgdesc="Vi escape addon for Fcitx5"
arch=('x86_64')
url="https://github.com/anyakichi/fcitx5-vi-escape"
license=('MIT')
depends=('fcitx5')
makedepends=('git' 'extra-cmake-modules')
source=("git+https://github.com/anyakichi/fcitx5-vi-escape.git")
sha512sums=('SKIP')

pkgver() {
  cd $_pkgname

  printf "%s.%s" \
    $(grep -oP 'project\s*\(.*VERSION\s+\K[0-9.]+' CMakeLists.txt) \
    g$(git rev-parse --short HEAD)
}

build() {
  local cmake_options=(
    -B build
    -S $_pkgname
    -W no-dev
    -D CMAKE_BUILD_TYPE=None
    -D CMAKE_INSTALL_PREFIX=/usr
  )
  cmake "${cmake_options[@]}"
  cmake --build build
}

check() {
  local excluded_tests=""
  local ctest_flags=(
    --test-dir build
    # show the stdout and stderr when the test fails
    --output-on-failure
    # execute tests in parallel
    --parallel $(nproc)
    # exclude problematic tests
    --exclude-regex "$excluded_tests"
  )
  ctest "${ctest_flags[@]}"
}

package() {
  DESTDIR="$pkgdir" cmake --install build
}