summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: ec3934b2ccac2f2739ef70ee31d873a0545b87d2 (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
# Maintainer: Damglador <damglador@gmail.com>
# Contributor: dillard
# Thanks krunner-vscodeprojects-git for the base for this PKGBUILD

_pkgname=krunner-steam
pkgname=$_pkgname-git
pkgver=r23.debe0f8
pkgrel=1
pkgdesc="Launch Steam games from Krunner"
arch=("any")
url="https://github.com/Damglador/krunner-steam.git"
license=("LGPL-2.0-or-later")
depends=("python-gobject" "python-dbus" "krunner" "kservice")
makedepends=("git")
provides=("$_pkgname")
conflicts=("$_pkgname")
install="${_pkgname}.install"
source=("git+$url")
sha256sums=("SKIP")

pkgver() {
    cd "$_pkgname"
    printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

package() {
    cd "$_pkgname"
    install_path="$pkgdir/usr/lib/$_pkgname"

    # Install the python source files
    install -d "$install_path"
    install -m644 src/*             "$install_path/"
    install -m755 src/main.py       "$install_path/"

    # Install the license
    install -Dm644 LICENSE -t       "$pkgdir/usr/share/licenses/$_pkgname/"

    # Install the KRunner plugin metadata
    install -Dm644 krunner-steam.desktop "$pkgdir/usr/share/krunner/dbusplugins/krunnersteam.desktop"

    # Install and create the D-Bus service file
    install -d "$pkgdir/usr/share/dbus-1/services"
    cat <<EOF > "$pkgdir/usr/share/dbus-1/services/com.github.xtibor.krunnersteam.service"
[D-BUS Service]
Name=com.github.xtibor.krunnersteam
Exec=/usr/lib/$_pkgname/main.py
EOF
}