summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: a25d08a81cd6e664f2f833638c9cf83a6e290a7e (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
58
59
60
61
62
63
64
65
66
67
# Maintainer: Fabio 'Lolix' Loli <fabio.loli@disroot.org> -> https://github.com/FabioLolix

pkgname=openloco-git
pkgver=26.07.1.r5.gef55ac7cb
pkgrel=2
pkgdesc="An open source re-implementation of Chris Sawyer's Locomotion"
arch=(x86_64)
url="https://github.com/OpenLoco/OpenLoco"
license=(MIT)
depends=(
    fmt
    glibc
    hicolor-icon-theme
    libgcc
    libpng
    libstdc++
    onetbb
    openal
    sdl3
    yaml-cpp
    )
makedepends=(
    cmake
    git
    gtest
    )
optdepends=(
    'libpipewire: audio output'
    'libpulse: audio output'
    )
provides=(openloco)
conflicts=(openloco)
source=("git+https://github.com/openloco/openloco.git")
sha256sums=('SKIP')

pkgver() {
  cd openloco
  git describe --long --tags | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
}

build() {
  local _flags=(
    -DFETCHCONTENT_QUIET=OFF
  )

  cmake -G "Unix Makefiles" -B build -S "openloco" -Wno-author \
    -DCMAKE_BUILD_TYPE=None \
    -DCMAKE_INSTALL_PREFIX=/usr \
    "${_flags[@]}"

  cmake --build build
}

check() {
  ctest --test-dir build --output-on-failure
}

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

  install -d "${pkgdir}"/usr/share/openloco
  mv "${pkgdir}"/usr/bin/* "${pkgdir}"/usr/share/openloco
  ln -s /usr/share/openloco/OpenLoco "${pkgdir}/usr/bin/openloco"
  ln -s /usr/share/openloco/OpenLoco "${pkgdir}/usr/bin/OpenLoco"

  install -D "openloco/LICENSE" -t "${pkgdir}/usr/share/licenses/${pkgname}"
}