summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 06f2d16ec3ca01fa4a42ced255cef0a3e93507a9 (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
# Maintainer Henry Smith <henrysmith6003@protonmail.com>

pkgname=golaunch
pkgver=0.7
pkgrel=2
pkgdesc='a simple .desktop launcher written in go.'
arch=('x86_64')
url="https://github.com/hen6003/golaunch"
license=('MIT')
makedepends=('go' 'git')
source=("https://github.com/hen6003/golaunch/archive/$pkgver.tar.gz")
sha256sums=('7c9de9c52dd08b04aab0fa2b5738ba28d452a7bb42d777636132c19a1199c84c')

prepare() {
  go mod init main
  go mod tidy

  go get -u \
    github.com/rkoesters/xdg/basedir \
	github.com/rkoesters/xdg/desktop
}

build() {
  cd "$pkgname"-"$pkgver"

  cd golaunch
  go build -gcflags "all=-trimpath=$PWD" \
    -asmflags "all=-trimpath=$PWD" \
    -ldflags "-extldflags $LDFLAGS" \
    ./golaunch.go

  cd ../godesktop
  go build -gcflags "all=-trimpath=$PWD" \
    -asmflags "all=-trimpath=$PWD" \
    -ldflags "-extldflags $LDFLAGS" \
    ./godesktop.go
}

package() {
  cd "$pkgname"-"$pkgver"
  install -Dm755 LICENSE "$pkgdir"/usr/share/licenses/"$pkgname"/LICENSE
  install -Dm755 golaunch/$pkgname "$pkgdir"/usr/bin/"$pkgname"
  install -Dm755 godesktop/godesktop "$pkgdir"/usr/bin/"godesktop"
}