summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 15c89d70b7351f0dd5cc5c9d19982cbfe4679987 (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: Kef Schecter <furrykef@gmail.com>
# Contributor: Mr.Smith1974

pkgname=cytopia-git
pkgver=r2838.2c670ec2
pkgrel=1
pkgdesc='A city building simulation game'
arch=('x86_64')
url='https://www.cytopia.net/'
license=('GPL-3.0-only')
depends=('gcc-libs' 'glibc' 'libnoise' 'sdl2' 'sdl2_image' 'sdl2_ttf' 'zlib')
makedepends=('git' 'cmake')
source=('git+https://github.com/CytopiaTeam/Cytopia.git')
sha256sums=('SKIP')

pkgver() {
    cd Cytopia
    printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

build() {
    cd Cytopia
    mkdir -p build
    cd build

    ### NOTE
    # In the future we should use CMAKE_INSTALL_PREFIX=/usr
    # However, as of 2024-04-16, this does not work as expected.
    #
    # TODO: avoid -DCMAKE_BUILD_TYPE=Release
    # (See CMake package guidelines on ArchWiki)
    cmake .. \
        -DCMAKE_INSTALL_PREFIX=/opt/cytopia \
        -DCMAKE_BUILD_TYPE=Release \
        -Wno-dev
    cmake --build .
}

check() {
    cd Cytopia/build
    ctest
}

package() {
    cd Cytopia/build
    DESTDIR="$pkgdir" cmake --build . --target install

    ### REMOVE next line once installing to /usr works correctly
    mkdir -p "$pkgdir/usr/bin"
    ln -sf /opt/cytopia/Cytopia "$pkgdir/usr/bin/cytopia"
}