summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 833d3633112771ebd5a77d51dea2c7e8e05d0465 (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: Roboron <robertoms258 at gmail dot com>

pkgname=simutrans-extended-git
pkgver=r21380.61cfea693
pkgrel=1
pkgdesc="Transportation simulation game - Extended Version - Nightly build from git"
arch=('any')
url="https://www.simutrans.com/"
license=('custom:Artistic')
depends=('gcc-libs' 'zstd' 'zlib' 'sdl2' 'hicolor-icon-theme' 'freetype2' 'miniupnpc' 'fluidsynth')
makedepends=('pkgconf' 'git' 'cmake')
optdepends=('soundfont-fluid: Default MIDI soundfont for music'
			'soundfont-realfont: recommended MIDI soundfont'
            'simutrans-extended-pak128.britain: High resolution graphics set for Simutrans Extended, with a British theme'
            'simutrans-extended-pak128.cs: High resolution graphics set for Simutrans Extended, with a czech theme'
            'simutrans-extended-pak128.sweden: High resolution graphics set for Simutrans Extended, with a swedish theme'
            'simutrans-extended-pak256: Highest resolution graphics set for Simutrans Extended')
conflicts=('simutrans-extended')
source=($pkgname::git+https://github.com/jamespetts/simutrans-extended/
        settings-folder.patch
        path-for-game-data.patch
        simutrans-extended.desktop
        "How to add files and paksets.md")
sha256sums=('SKIP'
            '7ed69019ba97849b65e2b8ac5ad8bf2110a7f048e3590d67c76c9cfca8a10b8d'
            'd1609eb40c9bbcdb6f13e10d1150f7995700249053aaa56da8b4a0aaf24f7260'
            '0efcf72d3670c53de99c44cb0d8f43f7e7663fda5df0f631ba6c687cc85967d3'
            '1707b5adff4174af173ac4d7a5cab1fbcda9245e55c0149ed5c3274e7bfc586c')

prepare() {
  cd $pkgname

  # Adjust paths
  patch -Np0 -i ../settings-folder.patch
  patch -Np0 -i ../path-for-game-data.patch
}

build() {
  cd $pkgname
  cmake -S . -B build 
  cmake build -DCMAKE_BUILD_TYPE=Release
  cmake --build build -j$(nproc) --target simutrans-extended
}

package() {
  #binary
  install -Dm755 $pkgname/build/simutrans/simutrans-extended "$pkgdir/usr/bin/simutrans-extended"
  rm $pkgname/build/simutrans/simutrans-extended
  
  #data
  mkdir -p "$pkgdir/usr/share/games/simutrans-extended"
  cp -r $pkgname/simutrans/* "$pkgdir/usr/share/games/simutrans-extended"

  #desktop file and icon
  install -Dm644 $pkgname/simutrans.svg "$pkgdir/usr/share/icons/hicolor/scalable/apps/simutrans-extended.svg"
  install -Dm644 simutrans-extended.desktop "$pkgdir/usr/share/applications/simutrans-extended.desktop"

  #license
  install -Dm644 $pkgname/LICENSE.txt "$pkgdir/usr/share/licenses/simutrans-extended/license.txt"
  
  install -Dm644 "How to add files and paksets.md" "$pkgdir/usr/share/games/simutrans-extended/How to add files and paksets.md"
}

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