summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 7b6375446e7e082da86c6d60842e9181f348e0ea (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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# Maintainer: detiam <dehe_tian@outlook.com>
# Contributor: Maxime Gauduin <alucryd@archlinux.org>
# Contributor: Giancarlo Razzolini <grazzolini@archlinux.org>
# Contributor: Samuel "scrufulufugus" Monson <smonson@irbash.net>
# Contributor: PedroHLC <root@pedrohlc.com>

pkgname=gamescope-nvidia-git
_pkgname=gamescope
pkgver=3.14.3.r8.gf88723f
pkgrel=1
pkgdesc='SteamOS session compositing window manager (NVIDIA patch)'
arch=(x86_64)
url=https://github.com/sharkautarch/gamescope/tree/nvidia-fix
license=('BSD-2-Clause')
install="$_pkgname.install"
depends=(
  'libpipewire'
  'libcap'
  'libliftoff'
  'libxcomposite'
  'libxdamage'
  'libxkbcommon'
  'libxmu'
  'libxres'
  'libxxf86vm'
  'seatd' # wlroots deps
  'xcb-util-errors' # wlroots deps
  'libdisplay-info' # wlroots deps
  'sdl2'
  'vulkan-icd-loader'
  'xorg-xwayland')
makedepends=(
  'git'
  'glm'
  'glslang'
  'meson'
  'ninja'
  'vulkan-headers'
  'wayland-protocols')
provides=("$_pkgname")
conflicts=("$_pkgname")
source=(
  "git+https://github.com/ValveSoftware/gamescope.git"
  "git+https://github.com/ValveSoftware/openvr.git"
  "git+https://github.com/Joshua-Ashton/reshade.git"
  "git+https://github.com/KhronosGroup/SPIRV-Headers.git"
  "git+https://github.com/Joshua-Ashton/vkroots.git"
  "git+https://github.com/Joshua-Ashton/wlroots.git"
  "git+https://github.com/nothings/stb.git"
  "reverts-bd722f7.patch")
sha1sums=('SKIP'
          'SKIP'
          'SKIP'
          'SKIP'
          'SKIP'
          'SKIP'
          'SKIP'
          '6573136d575068266dcb67459545ab06db58758a')

prepare() {
  # apply nvidia-fix patchs from
  # https://github.com/sharkautarch/gamescope/tree/nvidia-fix
  for patch in "${source[@]}"; do
    if [[ $patch == *.patch ]]; then
      msg2 "Applying $patch"
      patch --no-backup-if-mismatch -d gamescope -Np1 -i "$srcdir/$patch"
    fi
  done

  cd gamescope

  msg2 'Retrieving git build dependencies...'
  # configure build deps
  git -c submodule.src/reshade.url="$srcdir/reshade" \
      -c submodule.subprojects/vkroots.url="$srcdir/vkroots" \
      -c submodule.subprojects/wlroots.url="$srcdir/wlroots" \
      -c submodule.thirdparty/SPIRV-Headers.url="$srcdir/SPIRV-Headers" \
      -c submodule.subprojects/openvr.url="$srcdir/openvr" \
      -c submodule.subprojects/libdisplay-info.update=none \
      -c submodule.subprojects/libliftoff.update=none \
      -c protocol.file.allow=always submodule update --init --progress

  msg2 'Retrieving meson build dependencies...'
  # meson wrap deps that can't be replaced with system one
  sed -i "s|^url =.*|url = file://$srcdir/stb|" subprojects/stb.wrap
  meson subprojects download stb
}

pkgver() {
  git -C "${_pkgname}" describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
}

build() {
  arch-meson gamescope build \
    -Dforce_fallback_for=stb,vkroots \
    -Dbenchmark=disabled \
    -Dpipewire=enabled
  meson compile -C build
}

package() {
  DESTDIR="${pkgdir}" meson install -C build --skip-subprojects
  install -Dm 644 gamescope/LICENSE -t "${pkgdir}"/usr/share/licenses/gamescope/
}

# vim: ts=2 sw=2 et: