summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 44dd8098d4de0afa6e7d3b2894564e5808e599a1 (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
# Maintainer: Alexander F. Rødseth <xyproto@archlinux.org>

pkgname=o
pkgver=2.12.1
pkgrel=1
pkgdesc='Small, fast and VT100-compatible text editor'
arch=(x86_64)
url='https://github.com/xyproto/o'
license=(BSD)
makedepends=(git go upx)
source=("git+$url#tag=$pkgver")
sha256sums=('SKIP')

build() {
  cd "$pkgname"

  # Using gccgo gives a smaller size, but forces AUR users to juggle between go and gccgo, which is unfortunate
  #go build -buildmode=pie -gccgoflags="-s -w $LDFLAGS"

  go build -buildmode=pie -gcflags="all=-trimpath=$PWD" -asmflags "all=-trimpath=$PWD" -ldflags "-s -w -extldflags $LDFLAGS"
  upx o
}

package() {
  install -Dm755 $pkgname/o "$pkgdir/usr/bin/o"
  install -Dm644 $pkgname/LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

# vim: ts=2 sw=2 et: