summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 553697a3d3e2e7892d510ca9f09eb1870e368865 (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
# Maintainer: Darvin Delgado <dnmodder at gmail dot com>

_pkgbase=mangohud
pkgbase=$_pkgbase-git
pkgname=('mangohud-git' 'lib32-mangohud-git' 'mangohud-common-git')
pkgver=0.3.0.r28.g32c4515
pkgrel=2
url='https://github.com/flightlessmango/MangoHud'
license=('MIT')
arch=('x86_64')
depends=('glslang' 'libglvnd' 'lib32-libglvnd' 'libxnvctrl' 'vulkan-headers')
makedepends=('gcc' 'meson' 'python-mako' 'libx11' 'lib32-libx11' 'libxnvctrl' 'git')
replaces=('vulkan-mesa-layer-mango' 'lib32-vulkan-mesa-layer-mango')
source=("$_pkgbase::git+$url#branch=develop"
        'ImGui::git+https://github.com/flightlessmango/ImGui.git')
sha512sums=('SKIP'
            'SKIP')

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

prepare() {
    cd "$_pkgbase"
    git submodule init
    git config submodule.'modules/ImGui/src'.url "$srcdir/ImGui"
    git submodule update
}

build() {
    arch-meson "$_pkgbase" build64 \
    --libdir lib/mangohud/lib64 \
    --prefix /usr \
    -Dappend_libdir_mangohud=false \
    -Dinclude_doc=false

    ninja -C build64

    export CC="gcc -m32"
    export CXX="g++ -m32"
    export PKG_CONFIG_PATH="/usr/lib32/pkgconfig:/usr/lib/i386-linux-gnu/pkgconfig:/usr/lib/pkgconfig:${PKG_CONFIG_PATH_32}"
    export LLVM_CONFIG="/usr/bin/llvm-config32"

    arch-meson "$_pkgbase" build32 \
    --libdir lib/mangohud/lib32 \
    --prefix /usr \
    -Dappend_libdir_mangohud=false \
    -Dinclude_doc=false

    ninja -C build32
}

package_mangohud-git() {
    pkgdesc='A Vulkan overlay layer for monitoring FPS, temperatures, CPU/GPU load and more'
    conflicts=('mangohud')
    
    DESTDIR="$pkgdir" ninja -C build64 install
}

package_lib32-mangohud-git() {
    pkgdesc='A Vulkan overlay layer for monitoring FPS, temperatures, CPU/GPU load and more (32-bit)'
    conflicts=('lib32-mangohud')

    DESTDIR="$pkgdir" ninja -C build32 install
}

package_mangohud-common-git() {
    pkgdesc='A Vulkan overlay layer for monitoring FPS, temperatures, CPU/GPU load and more'
    conflicts=('mangohud-common')

    install -Dm664 "$_pkgbase/bin/MangoHud.conf" "$pkgdir/usr/share/doc/mangohud/MangoHud.conf.example"
    install -Dm664 "$_pkgbase/LICENSE" "$pkgdir/usr/share/licenses/$_pkgbase/LICENSE"
}