summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 3a229dd97c538af1a88d2c803e82a9cbe1dbf2dc (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
# Maintainer: Fabio 'Lolix' Loli <fabio.loli@disroot.org> -> https://github.com/FabioLolix
# Contributor: Evert Vorster <evorster@gmail.com>

pkgname=vegastrike-engine
pkgver=0.9.1
pkgrel=2
pkgdesc="A spaceflight simulator in massive universe"
arch=(x86_64)
url="https://www.vega-strike.org/"
license=(GPL-3.0-or-later)
depends=(boost-libs python freeglut gtk3 libvorbis openal sdl glu

         # namcap implicit depends
         glibc gcc-libs glib2 zlib libpng libglvnd expat libjpeg-turbo)
makedepends=(git cmake boost gtest)
source=("git+https://github.com/vegastrike/Vega-Strike-Engine-Source#tag=v${pkgver}"
		vegastrike-engine-Add-missing-header.patch)
sha256sums=('602cb322ba7ffa07885e00631892083592ecad8d9687d136734029187dd2dce5'
            'beb8280fcf695de4d420ea271d3bfff0d9780127bc2c13b8b9cc5fd6deb4038d')

prepare() {
  cd Vega-Strike-Engine-Source
  patch -Np1 -i ../vegastrike-engine-Add-missing-header.patch
}

build(){
  # buildtype None, enable ffmpeg, ogre will fail, not supported
  # https://github.com/vegastrike/Vega-Strike-Engine-Source/issues/777#issuecomment-1763235378

  local _flags=(
    #-DINSTALL_GTEST=ON  #fail to build using system's gtest
    -DUSE_GTEST=ON
	-DENABLE_PIE=ON
  )

  cmake -B build -S "Vega-Strike-Engine-Source/engine" -Wno-dev \
    -DCMAKE_BUILD_TYPE=Release \
    -DCMAKE_INSTALL_PREFIX=/usr \
    "${_flags[@]}"

  cmake --build build
}

check() {
  ctest --test-dir build --output-on-failure
}

package() {
  DESTDIR="$pkgdir" cmake --install build

  # remove bundled gtest,gmock
  rm -rf ${pkgdir}/usr/include
  rm -rf ${pkgdir}/usr/lib
}