summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: c1e50d6f94677a9a8fefd7dcfb9f1205bdafa7cd (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
# Maintainer: Ranieri Althoff <ranisalt+aur at gmail dot com>

pkgbase=mangohud-opengl2
pkgname=('mangohud-opengl2' 'lib32-mangohud-opengl2' 'mangohud-opengl2-common')
provides=('mangohud' 'mangohud-common' 'lib32-mangohud' 'lib32-mangohud-common')
conficts=('mangohud')
pkgver=0.5.1
pkgrel=3
url='https://github.com/flightlessmango/MangoHud'
license=('MIT')
arch=('x86_64')
makedepends=('meson' 'python-mako' 'glslang' 'libglvnd' 'lib32-libglvnd' 'patch'
             'vulkan-headers' 'vulkan-icd-loader' 'lib32-vulkan-icd-loader')
source=("$pkgbase-$pkgver.tar.gz::https://github.com/flightlessmango/MangoHud/archive/v$pkgver.tar.gz")
sha256sums=('3e91d4fc7369d46763894c13f3315133871dd02705072981770c3cf58e8081c6')

_srcdir="MangoHud-$pkgver"

prepare() {
  cd "${_srcdir}"
  patch --forward --strip=1 --input="${startdir}/mangohud-opengl2.patch"
}

build() {
    arch-meson -Dappend_libdir_mangohud=false -Duse_system_vulkan=enabled -Dwith_xnvctrl=disabled \
      "$_srcdir" build64
    ninja -C build64

    export CC="gcc -m32"
    export CXX="g++ -m32"
    export PKG_CONFIG_PATH="/usr/lib32/pkgconfig"
    export LLVM_CONFIG="/usr/bin/llvm-config32"
    arch-meson -Dappend_libdir_mangohud=false -Duse_system_vulkan=enabled -Dwith_xnvctrl=disabled \
      "$_srcdir" build32 --libdir lib32
    ninja -C build32
}

package_mangohud-opengl2() {
    pkgdesc='(GL2, libre deps only version) A Vulkan overlay layer for monitoring FPS, temperatures, CPU/GPU load and more'
    depends=('gcc-libs' 'mangohud-common')
    optdepends=('bash: mangohud helper script')

    DESTDIR="$pkgdir" ninja -C build64 install
    rm -r "$pkgdir/usr/bin" "$pkgdir/usr/share/doc" "$pkgdir/usr/share/man"

    install -Dm644 "$_srcdir/LICENSE" "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

package_lib32-mangohud-opengl2() {
    pkgdesc='(GL2, libre deps only version)  A Vulkan overlay layer for monitoring FPS, temperatures, CPU/GPU load and more (32-bit)'
    depends=('lib32-gcc-libs' 'mangohud' 'mangohud-common')

    DESTDIR="$pkgdir" ninja -C build32 install
    rm -r "$pkgdir/usr/bin" "$pkgdir/usr/share/doc" "$pkgdir/usr/share/man"
    mv "$pkgdir/usr/share/vulkan/implicit_layer.d/MangoHud.json" "$pkgdir/usr/share/vulkan/implicit_layer.d/MangoHud.x86.json"

    install -Dm644 "$_srcdir/LICENSE" "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

package_mangohud-opengl2-common() {
    pkgdesc='(GL2, libre deps only version) Common files for mangohud and lib32-mangohud'
    optdepends=('bash: mangohud helper script')

    DESTDIR="$pkgdir" ninja -C build64 install
    rm -r "$pkgdir/usr/lib" "$pkgdir/usr/share/vulkan"

    install -Dm644 "$_srcdir/LICENSE" "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}