summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: da40d207c49cb68f804e5472a8c053cdb346c2be (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
55
56
57
# Maintainer: Chiller Dragon <chillerdragon@gmail.com>

pkgname=term-ux-git
pkgver=18.0.3.r1066.g2b35da053
pkgrel=1
pkgdesc="A custom Teeworlds curses client based on chillerbot-ux (ddnet based)."
arch=('x86_64')
url="https://chillerbot.github.io/"
license=('custom:BSD' 'CCPL:by-nc-sa')
depends=('freetype2' 'opusfile' 'curl' 'glew' 'wavpack' 'pnglite' 'ffmpeg' 'libnotify' 'miniupnpc' 'sqlite' 'mariadb-libs')
makedepends=('git' 'cargo' 'cmake' 'ninja' 'python')
checkdepends=('gmock')
provides=('term-ux')
conflicts=('term-ux')
source=('git+https://github.com/chillerbot/chillerbot-ux')
sha256sums=('SKIP')

pkgver() {
    cd chillerbot-ux
    v=$(echo '#include "src/game/version.h"
              #include <iostream>
              int main() {
                  std::cout << GAME_RELEASE_VERSION << std::endl;
              }' | g++ -xc++ - && ./a.out)
    _commit=$(git log --pretty=oneline | grep "Version $v" | cut -d' ' -f1)
    r=$(git log $_commit..HEAD --pretty=oneline | wc -l)
    h=$(git rev-parse --short HEAD)
    printf $v.r$r.g$h
}

build() {
    mkdir -p build
    cd build
    cmake ../chillerbot-ux          \
        -DCMAKE_BUILD_TYPE=Release  \
        -DCMAKE_INSTALL_PREFIX=/usr \
        -DAUTOUPDATE=OFF            \
        -DHEADLESS_CLIENT=ON        \
        -DCURSES_CLIENT=ON          \
        -DVULKAN=OFF                \
        -DSERVER=OFF                \
        -DANTIBOT=OFF               \
        -DVIDEORECORDER=OFF         \
        -DUPNP=ON                   \
        -DMYSQL=OFF                 \
        -GNinja
    ninja
}

check() {
    ninja run_tests -C build
}

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