summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 46e793458ac5ed0af7ed5ae166bca202e065e004 (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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
# Maintainer: Cyrille Pontvieux <cyrille@enialis.net>
pkgbase=solarus
pkgname=(
  solarus
  solarus-launcher
  solarus-editor
)
pkgver=2.0.3
pkgrel=1
pkgdesc="A lightweight, free and open-source 2D game engine for Action-RPGs"
arch=("i686" "x86_64")
url="https://www.solarus-games.org/"
license=("GPL-3.0-only AND CC-BY-SA-3.0 AND CC-BY-SA-4.0")
makedepends=(
  "cmake"
  "zip"
)
source=("https://gitlab.com/solarus-games/$pkgbase/-/archive/v$pkgver/$pkgbase-v$pkgver.tar.gz")
sha256sums=('f80a7eb258da355ec5c29780e2813bd4026d1dcdded8a511aef482d29363f98b')
_rootdir=$pkgname-v$pkgver

prepare() {
  set -x
  cd "$_rootdir"
  (cd include/solarus && [ -e third_party ] || cp -a ../../third_party/glad/include third_party)
  cmake \
    -Wno-dev \
    -DCMAKE_INSTALL_PREFIX="/usr" \
    -DCMAKE_BUILD_TYPE=Release \
    -DSOLARUS_TESTS=OFF \
    -B .
  (
    cd launcher
    cmake \
      -Wno-dev \
      -DCMAKE_INSTALL_PREFIX="/usr" \
      -DCMAKE_BUILD_TYPE=Release \
      -DSOLARUS_DIR=.. \
      -DSOLARUS_LIBRARY=../libsolarus.so \
      -B .
  )
  (
    cd editor
    cmake \
      -Wno-dev \
      -DCMAKE_INSTALL_PREFIX="/usr" \
      -DCMAKE_BUILD_TYPE=Release \
      -DSOLARUS_DIR=.. \
      -DSOLARUS_LIBRARY=../libsolarus.so \
      -B .
  )
}

build() {
  cd "$_rootdir"
  cmake --build .
  (cd launcher && cmake --build .)
  (cd editor && cmake --build .)
}

package_solarus() {
  depends=(
    "glm"
    "hicolor-icon-theme"
    "libmodplug>=0.8.8.4"
    "libvorbis"
    "luajit>=2.0"
    "openal"
    "physfs"
    "sdl2>=2.0.18"
    "sdl2_image"
    "sdl2_ttf"
  )
  optdepends=(
    "solarus-launcher: GUI to choose and run Solarus games"
    "solarus-editor: GUI to create Solarus games"
  )
  conflicts=("solarus-git" "solarus-run")
  provides=("solarus")
  make -C "$_rootdir" DESTDIR="${pkgdir}/" install
}

package_solarus-launcher() {
  depends=(
    "solarus"
    "qt6-base>6.7"
    "qt6-svg"
    "qt6-tools"
  )
  make -C "$_rootdir/launcher" DESTDIR="${pkgdir}/" install
}

package_solarus-editor() {
  depends=(
    "solarus"
    "qt6-base>6.7"
    "qt6-svg"
    "qt6-tools"
  )
  conflicts=("solarus-quest-editor")
  make -C "$_rootdir/editor" DESTDIR="${pkgdir}/" install
}