summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 361d70066ff3e89f752b8749ed5870f62c98d25a (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
pkgname=tuxclocker-git
_pkgname=tuxclocker
pkgver=1.3.1.591.00fa886
pkgrel=1
pkgdesc="A hardware controlling and monitoring program for GPUs and CPUs"
arch=('x86_64')
url="https://github.com/Lurkki14/tuxclocker"

license=('GPL3')

depends=('boost-libs' 'libdrm' 'qt5-base' 'qt5-charts')
makedepends=('boost' 'git' 'meson' 'qt5-tools')
optdepends=('libxnvctrl: XNVCtrl' 'nvidia-utils: nvidia-ml')

conflicts=('tuxclocker')

source=(
            "git+https://github.com/Lurkki14/tuxclocker.git#branch=master" 
            'tuxclocker.desktop'
            'tuxclockerd.service'
            'tuxclockerd-dbus.service'
            'tuxclocker.env'
        )
sha256sums=(
            
            'SKIP'
            'bedbd8bedbbb1235790d882d5e51eb2af21f27b64b62eafa0e38222f54b560a0'
            'b39fb7ee38605d9626740f930bd0b58f15901655fba15ce0f5c8a5f4005637e8'
            '4928c76f4cee4f4bc435031f12620f99aa76b72fa459e809e30d58979e326a1e'
            'a5f194cce493e305da8592b630223d04a25e57c8c4e5a44ed47030f893270dde'
        )

pkgver() {
    cd "$srcdir/$_pkgname"
    # git describe --tags | sed 's/-/+/g'
    printf "%s.r%s.%s" "$(git describe --tags | cut -d'-' -f1)" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

prepare() {
    cd "$srcdir/$_pkgname"
    git submodule update --init --recursive
}

build() {
    cd "$srcdir/$_pkgname"

    meson build --prefix=/usr -Dplugins=true -Ddaemon=true

    meson compile -C build
}

package() {
    pushd "$srcdir/$_pkgname"
    
    meson install -C build --destdir "$pkgdir"
 
    popd

    install -Dm644 "$srcdir/$_pkgname/dev/dbusconf.conf" "$pkgdir/etc/${_pkgname}-dbusconf.conf"

    install -Dm644 "$srcdir/$_pkgname/src/$_pkgname-qt/resources/$_pkgname-logo.svg" "$pkgdir/usr/share/icons/hicolor/scalable/apps/$_pkgname.svg"

    install -Dm644 "tuxclocker.desktop" -t "$pkgdir/usr/share/applications/"

    install -Dm644 "tuxclockerd-dbus.service" "$pkgdir/usr/lib/systemd/system/tuxclockerd-dbus.service"

    install -Dm644 "tuxclockerd.service" "$pkgdir/usr/lib/systemd/system/tuxclockerd.service"

    install -Dm655 "tuxclocker.env" "$pkgdir/etc/"

    echo
    echo
    echo -----------------------------------------------------------------------------------------------
    echo 'Please do not forget to enable and start systemd services "systemctl enable --now tuxclockerd-dbus tuxclockerd"'
    echo -----------------------------------------------------------------------------------------------
    echo
    echo
}