1 # Maintainer: Jelle van der Waa <jelle@archlinux.org>
2 # Contributor: Graham Edgecombe <graham@grahamedgecombe.com>
7 pkgdesc='Open source re-implementation of Roller Coaster Tycoon 2 (requires full
10 url='https://openrct2.io'
12 depends=('hicolor-icon-theme' 'sdl2' 'curl' 'speexdsp' 'fontconfig'
13 'libpng' 'openssl' 'libzip' 'icu' 'benchmark'
15 makedepends=('cmake' 'gtest' 'nlohmann-json')
17 optdepends=('zenity: System dialog box support (GNOME/GTK)'
18 'kdialog: System dialog box support (KDE)'
19 'alsa-lib: ALSA audio driver'
20 'libpulse: PulseAudio audio driver')
21 source=($pkgname-$pkgver.tar.gz::https://github.com/OpenRCT2/OpenRCT2/archive/v$pkgver.tar.gz
22 googletest-fix-maybe-uninitialized.patch)
23 sha256sums=('18970bfffe49c77fa81ea6c295119b173a613c7310d7762963458e3e77c24913'
24 '6c4becab25ec1824883a4c1946d4aa4b45534b9a6199b782db7879b78178ff84')
27 cd "$srcdir/OpenRCT2-$pkgver"
30 # add cmake command to patch googletest with https://github.com/google/googletest/pull/3024
31 sed '/URL https:\/\/github.com\/google\/googletest/ a PATCH_COMMAND patch -p1 -i ../../../../../googletest-fix-maybe-uninitialized.patch' -i test/tests/CMakeLists.txt
35 cd "$srcdir/OpenRCT2-$pkgver/build"
37 # https://github.com/OpenRCT2/OpenRCT2/issues/17371
38 export CXXFLAGS+=" -Wno-error=maybe-uninitialized -Wno-error=restrict -Wno-error=null-dereference"
39 cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr \
40 -DSTATIC=off -DWITH_TESTS=on -DCMAKE_INSTALL_LIBDIR=/usr/lib ..
45 cd "$srcdir/OpenRCT2-$pkgver"
52 cd "$srcdir/OpenRCT2-$pkgver/build"
54 make DESTDIR="$pkgdir" install
56 rm "$pkgdir/usr/lib/libopenrct2.a"
57 rmdir "$pkgdir/usr/lib"