summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: ccad6f1e4a9e7883d2f09d363ed231e9aae2c714 (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
# Maintainer: ravenstar <yexella at gmail dot com>

pkgname=gled-git
pkgver=r4.97dfdc8
pkgrel=1
pkgdesc="Logitech G102 and G203 Prodigy Mouse LED control"
arch=('x86_64')
url="https://github.com/karlovskiy/${pkgname%-git}"
license=('MIT')
makedepends=('git' 'go')
depends=('libusb')
provides=("${pkgname%-git}")
conflicts=("${pkgname%-git}")
source=("git+${url}.git")
md5sums=('SKIP')

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

build() {
	cd "${srcdir}/${pkgname%-git}"
	export GOFLAGS="-buildmode=pie -gcflags=all=-trimpath=${PWD} -asmflags=all=-trimpath=${PWD} -ldflags=-extldflags=-zrelro -ldflags=-extldflags=-znow"
	go build -o ${pkgname%-git} .
}

package() {
    cd "${srcdir}/${pkgname%-git}"
    install -Dm755 "${pkgname%-git}" "${pkgdir}/usr/bin/${pkgname%-git}"
    install -Dm644 "LICENSE" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}