summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 6fe2b95ee86f4cb87e43364396419ff6f69c3281 (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
# Maintainer: Sebastian Wiesner <sebastian@swsnr.de>

pkgname=zsa-wally
pkgver=2.1.0
pkgrel=13
pkgdesc="Flash your ZSA Keyboard the EZ way."
arch=('i686' 'x86_64')
url="https://github.com/zsa/wally"
license=("MIT")
depends=("gtk3" "webkit2gtk" "libusb")
makedepends=("go" "npm")
source=(
    "$pkgname-$pkgver.tar.gz::https://github.com/zsa/wally/archive/refs/tags/$pkgver-linux.tar.gz"
    "modernize-udev-rules.patch"
    "desktop-file.patch"
)
md5sums=('f4a98a0e51d5d0b6d23a95858d230e11'
         'd444c2b74b3c51c265f91020942075bc'
         'e1800d7066a392864619db15145fe735')
sha1sums=('deb20d7c9b1a1eb799bb2288540fb7119f1f8ba2'
          '62c1903d3723399d209f0642849d850e91feaef8'
          '3e1bd7e97924712381860ae3264b6600f5e9c23c')
sha512sums=('d84c469f7d43ba86eb5d0d527a17b588ea12e0272897231392e0572cef0a80f806948a225e263806e5cf7b2fc95eb58e02468ecbe8d12f69ec07919eb364e789'
            '923cd4c9795f9828a827e8f5d832ee6f0b74aeb19d948f4e9d8eb7b59d93a570a4bd5e0e0e0b24adfa78644df60425063b37f19ae658e1a3c6200a6c9c126793'
            '1f967e5ec80760b9a0cf0345d5227caf679398b3b78e0f05ddd5a5c1909039c15a8547aee9174e76beac84395a2b63b31c74396a66bce2193517f494b92216b4')

prepare() {
    cd "wally-$pkgver-linux"

    patch --strip=1 --input="$srcdir/modernize-udev-rules.patch"
    patch --strip=1 --input="$srcdir/desktop-file.patch"

    export GOPATH="$srcdir/gopath"
    go get -modcacherw -u github.com/wailsapp/wails/cmd/wails@v1.8.0
}

build() {
    cd "wally-$pkgver-linux"

    export GOPATH="$srcdir/gopath"
    export PATH="$(go env GOPATH)/bin:$PATH"

    export CGO_CPPFLAGS="${CPPFLAGS}"
    export CGO_CFLAGS="${CFLAGS}"
    export CGO_CXXFLAGS="${CXXFLAGS}"
    export CGO_LDFLAGS="${LDFLAGS}"
    export GOFLAGS="-buildmode=pie -trimpath -modcacherw"
    # Don't know what this does but it's in the install.linux.sh script from upstream
    export CGO_ENABLED=1

    wails build
}

package() {
    cd "wally-$pkgver-linux"
    install -Dm755 build/wally "$pkgdir/usr/bin/wally"
    install -Dm644 -t "$pkgdir/usr/lib/udev/rules.d/" dist/linux64/50-oryx.rules dist/linux64/50-wally.rules
    install -Dm644 dist/linux64/wally.desktop "$pkgdir/usr/share/applications/wally.desktop"
    install -Dm644 appicon.png "$pkgdir/usr/share/pixmaps/wally.png"
    # This file is only on master; meanwhile use the license from the Debian package copyright file
    install -Dm644 dist/ppa/wally/template/debian/copyright "$pkgdir/usr/share/licenses/$pkgname/copyright"
    #install -Dm644 license.md "$pkgdir/usr/share/licenses/$pkgname/license.md"
}