summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 74a4c9e9c2072305fb7cf6eb355e00500e09dcc6 (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
# Maintainer: Ysblokje <ysblokje at gmail dot com>
# Co-Maintainer: Mark Wagie <mark dot wagie at tutanota dot com>
pkgname=('gamemode' 'lib32-gamemode')
pkgbase='gamemode'
pkgver=1.6
pkgrel=7
pkgdesc="A daemon/lib combo that allows games to request a set of optimisations be temporarily applied to the host OS"
arch=('x86_64')
url="https://github.com/FeralInteractive/gamemode"
license=('BSD')
makedepends=('meson' 'lib32-systemd' 'lib32-dbus')
depends=('libinih')
checkdepends=('appstream')
source=("$url/releases/download/$pkgver/$pkgname-$pkgver.tar.xz")
sha256sums=('ede17eb042c1c87f7b35bfe96a00560afaea086f685d25bb3964d794b0af9c80')

build() {
    meson "${pkgbase}-${pkgver}" build64 \
        --prefix /usr \
        --libexecdir lib/gamemode \
        -Dwith-pam-group=gamemode \
        -Dwith-systemd-user-unit-dir=/usr/lib/systemd/user
    meson compile -C build64

    export CFLAGS=-m32
    export CXXFLAGS=-m32
    export PKG_CONFIG_PATH='/usr/lib32/pkgconfig'

    meson "${pkgbase}-${pkgver}" build32 \
        --prefix /usr \
        -Dwith-sd-bus-provider=no-daemon \
        -Dwith-examples=false \
        -Dwith-util=false \
        --libdir lib32
    meson compile -C build32
}

check() {
    meson test -C build64
    meson test -C build32
}

package_gamemode() {
    depends=('libinih' 'dbus')
    optdepends=('systemd' 'polkit')
    install="${pkgname}.install"

    DESTDIR="${pkgdir}" meson install -C build64

    install -Dm644 "${srcdir}/${pkgbase}-${pkgver}/LICENSE.txt" -t \
        "${pkgdir}/usr/share/licenses/${pkgname}/"
    install -Dm644 "${srcdir}/${pkgbase}-${pkgver}/example/gamemode.ini" -t \
        "${pkgdir}/usr/share/doc/${pkgname}/example" 
}

package_lib32-gamemode() {
    depends=('gamemode' 'lib32-dbus')

    DESTDIR="${pkgdir}" meson install -C build32

    rm -rf "${pkgdir}/usr/include"
    install -Dm644 "${srcdir}/${pkgbase}-${pkgver}/LICENSE.txt" -t \
        "${pkgdir}/usr/share/licenses/${pkgname}/"
}

# vim: set ts=4 sw=4 tw=0 et :