summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: e77228e0439a53d690addbef96cf276195e00eab (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
# Maintainer: Winston Astrachan <winston dot astrachan at gmail dot com>

pkgname=kiibohd-configurator-bin
_shortname=kiibohd-configurator
pkgver=1.1.0
pkgrel=1
pkgdesc='Configuration utility for Input Club keyboards'
arch=('x86_64')
url='https://github.com/kiibohd/configurator'
license=('GPL')
depends=('fuse2' 'zlib' 'hicolor-icon-theme' 'dfu-util')
provides=($_shortname)
conflicts=('kiibohd-configurator-git')
options=(!strip)
install="${pkgname}.install"
_appimage="${pkgname}-${pkgver}-${pkgrel}.AppImage"
source=("${_appimage}::https://github.com/kiibohd/configurator/releases/download/v${pkgver}/${_shortname}-${pkgver}-linux-${CARCH}.AppImage"
        "98-kiibohd.rules"
)
sha256sums=('c6908bae5f7e1024cd653fbcbee3a32ecd10f365f32634b103f5f883f6f851af'
            '570124a77f39dc4b50afac411ffb5d5717aae176641c7b371b2fcfc02ee9807a')

prepare() {
    # Extract files from appimage
    chmod +x ${_appimage}
    ./${_appimage} --appimage-extract
}

package() {
    cd "$srcdir"

    # Install udev rules
    install -d "${pkgdir}/etc/udev/rules.d"
    install -Dm644 98-kiibohd.rules -t "${pkgdir}/etc/udev/rules.d"

    # Install appimage
    install -d "${pkgdir}/usr/bin"
    install -Dm755 "${_appimage}" -t "${pkgdir}/opt/${_shortname}"

    # Install icons
    install -dm755 "${pkgdir}/usr/share/icons/hicolor"
    find squashfs-root -type d -exec chmod 0755 {} \;
    cp -r squashfs-root/usr/share/icons/hicolor "${pkgdir}/usr/share/icons"

    # Install desktop file
    install -d "${pkgdir}/usr/share/applications"
    sed -i -E "s|Exec=AppRun|Exec=env DESKTOPINTEGRATION=false /usr/bin/${_shortname}|" "squashfs-root/${_shortname}.desktop"
    install -Dm644 "squashfs-root/${_shortname}.desktop" -t "${pkgdir}/usr/share/applications"

    # Symlink AppImage
    ln -s "/opt/${_shortname}/${_appimage}" "${pkgdir}/usr/bin/${_shortname}"
}