summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: ab962d4744adbe7671d9b3716f9f1490d8f632c5 (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
_pkgname=flycast
pkgname="$_pkgname"
pkgver=2.1
_tag="V$pkgver"
pkgrel=2
pkgdesc='A multi-platform Sega Dreamcast, Naomi and Atomiswave emulator'
arch=('x86_64' 'i686')
url="https://github.com/flyinghead/flycast"
license=('GPL2')
depends=(
  'alsa-lib'
  'hicolor-icon-theme'
  'libgl'
  'libzip'
)
makedepends=(
  'cmake'
  'git'
  'python'
  'systemd'
)
provides=("$_pkgname" reicast)
conflicts=("$_pkgname")
source=(
  "$_pkgname"::"git+$url.git#tag=$_tag"
  "SDL"::"git+https://github.com/libsdl-org/SDL"
  "Vulkan-Headers"::"git+https://github.com/KhronosGroup/Vulkan-Headers"
  "VulkanMemoryAllocator"::"git+https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator"
  "breakpad"::"git+https://github.com/flyinghead/mingw-breakpad"
  "glslang"::"git+https://github.com/KhronosGroup/glslang"
  "libchdr"::"git+https://github.com/rtissera/libchdr"
  "luabridge"::"git+https://github.com/vinniefalco/LuaBridge"
  "oboe"::"git+https://github.com/google/oboe"
)
md5sums=(
  'SKIP'
  'SKIP'
  'SKIP'
  'SKIP'
  'SKIP'
  'SKIP'
  'SKIP'
  'SKIP'
  'SKIP'
)

prepare() {
  cd "$srcdir/$_pkgname"

  _submodules=(
    'core/deps/SDL'
    'core/deps/Vulkan-Headers'
    'core/deps/VulkanMemoryAllocator'
    'core/deps/breakpad'
    'core/deps/glslang'
    'core/deps/libchdr'
    'core/deps/luabridge'
    'core/deps/oboe'
  )
  for submodule in ${_submodules[@]} ; do
    git submodule init ${submodule}
    git submodule set-url ${submodule} "${srcdir}/${submodule##*/}"
    git -c protocol.file.allow=always submodule update ${submodule}
  done

  # add missing include
  _file='core/deps/breakpad/src/client/linux/handler/minidump_descriptor.h'
  if ! grep cstdint "$_file" > /dev/null ; then
    sed -Ei 's@^(#include "common/using_std_string.h")$@\1\n#include <cstdint>@' "$_file"
  fi
}

build() {
  cd "$srcdir/$_pkgname"
  cmake -B build -S "$srcdir/$_pkgname" \
    -DCMAKE_INSTALL_PREFIX='/usr'
  make -C build
}

package() {
  cd "$srcdir/$_pkgname/build"
  make DESTDIR="${pkgdir}" install
}