summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 0b7b78ce5abf9bb72e4b22a741416a7d92b10060 (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
# Maintainer: Christoph Haag <christoph.haag@collabora.com>
# Contributor: Sandy Carter <bwrsandman@gmail.com>

pkgname=openmw-vr-git
pkgver=r29818.cac0667193
pkgrel=1
pkgdesc="An open-source engine reimplementation for the role-playing game Morrowind, fork with OpenXR VR support."
arch=('i686' 'x86_64')
url="https://gitlab.com/madsbuvi/openmw"
license=('GPL3' 'MIT' 'custom')
depends=('openal' 'openscenegraph' 'mygui' 'qt5-base' 'ffmpeg' 'sdl2' 'unshield' 'libxt' 'boost-libs' 'ffmpeg4.4' "openxr")
optdepends=('openscenegraph-openmw-git: experimental performance enhancements for OpenMW that are too controversial to be included in the general purpose OSG project')
makedepends=('git' 'cmake' 'boost' 'ninja')
conflicts=("${pkgname%-git}" 'openmw-git')
provides=("${pkgname%-git}" 'openmw-git')
source=(
  'git+https://gitlab.com/madsbuvi/openmw.git'
)
sha1sums=('SKIP')

pkgver() {
  cd "${srcdir}/openmw"
  #_tag="$(git describe --tags $(git rev-list --tags --max-count=1) | sed 's/openmw-//')"
  #_numcommits="$(git rev-list  `git rev-list --tags --no-walk --max-count=1`..HEAD --count)"
  #_hash="$(git rev-parse --short HEAD)"
  #printf "%s.r%s.g%s" "$_tag" "$_numcommits" "$_hash"
  printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

prepare() {
  cd "${srcdir}/openmw"
}

build() {
  # Use Workaround for ffmpeg4.4 from https://gitlab.com/OpenMW/openmw/-/issues/6631#note_848732223
  export PKG_CONFIG_LIBDIR='/usr/lib/ffmpeg4.4/pkgconfig/'

  cd "${srcdir}/openmw"

  # -DOPENMW_USE_SYSTEM_BULLET=OFF: Doesn't build with bullet from repo

  cmake -DCMAKE_INSTALL_PREFIX=/usr \
        -DCMAKE_BUILD_TYPE=RelWithDebInfo \
        -DDESIRED_QT_VERSION=5 \
        -DOPENMW_USE_SYSTEM_BULLET=OFF \
        -DBUILD_OPENMW_VR=ON \
        -GNinja \
        -Bbuild
  ninja -C build
}

package() {
  cd "${srcdir}/openmw"
  DESTDIR="$pkgdir" ninja -C build install

  # actual binary is not installed by default
  install -m755 "$srcdir"/openmw/build/openmw_vr "$pkgdir"/usr/bin/openmw_vr
  install "$srcdir"/openmw/files/settings-overrides-vr.cfg "$pkgdir"/etc/openmw/settings-overrides-vr.cfg

  # install target shouldn't install openxr loader
  rm -rf "$pkgdir"/usr/include/openxr
  rm -rf "$pkgdir"/usr/lib/cmake/openxr
  rm -rf "$pkgdir"/usr/lib/libopenxr*
  rm -rf "$pkgdir"/usr/lib/pkgconfig/openxr.pc
  rm -rf "$pkgdir"/usr/share/doc/openxr
}

# vim:set ts=2 sw=2 et: