archrelease: copy trunk to community-any
[ArchLinux/community.git] / openrct2 / trunk / PKGBUILD
blob9ae44ef109f997229e111ee7760824df44dec71e
1 # Maintainer: Jelle van der Waa <jelle@archlinux.org>
2 # Contributor: Graham Edgecombe <graham@grahamedgecombe.com>
4 pkgname=openrct2
5 pkgver=0.4.4
6 pkgrel=1
7 pkgdesc='Open source re-implementation of Roller Coaster Tycoon 2 (requires full
8          copy of the game)'
9 arch=('x86_64')
10 url='https://openrct2.io'
11 license=('GPL3')
12 depends=('hicolor-icon-theme' 'sdl2' 'curl' 'speexdsp' 'fontconfig'
13          'libpng' 'openssl' 'libzip' 'icu' 'benchmark'
14          'flac' 'libvorbis')
15 makedepends=('cmake' 'gtest' 'nlohmann-json')
16 options=(!lto)
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')
26 prepare() {
27   cd "$srcdir/OpenRCT2-$pkgver"
28   mkdir build
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
34 build() {
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 ..
41   make all g2
44 check() {
45   cd "$srcdir/OpenRCT2-$pkgver"
47   mkdir -p build
48   make test
51 package() {
52   cd "$srcdir/OpenRCT2-$pkgver/build"
54   make DESTDIR="$pkgdir" install
56   rm "$pkgdir/usr/lib/libopenrct2.a"
57   rmdir "$pkgdir/usr/lib"