summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: fc24c7cc710d0280c0e93260531fd49e700e3527 (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
# Maintainer: éclairevoyant
# Contributor: aksr <aksr at t-com dot me>

_pkgname=hira
pkgname="$_pkgname-git"
pkgver=r13.3eb60dc
pkgrel=3
pkgdesc="Command to transliterate ASCII to Hiragana"
arch=(i686 x86_64)
url="https://github.com/robpike/$_pkgname"
license=(BSD)
depends=(glibc)
makedepends=(git go)
source=("git+$url.git")
b2sums=('SKIP')

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

prepare() {
	cd $_pkgname
	go mod init "${url#https://}"
	go mod tidy
}

build() {
	cd $_pkgname
	go build \
		-trimpath \
		-buildmode=pie \
		-mod=readonly \
		-modcacherw \
		-ldflags "-linkmode external -extldflags \"${LDFLAGS}\"" \
		.
}

package() {
	cd $_pkgname
	install -vDm755 $_pkgname -t "$pkgdir/usr/bin/"
	install -vDm644 LICENSE -t "$pkgdir/usr/share/licenses/$pkgname/"
	install -vDm644 README.md "$pkgdir/usr/share/doc/$pkgname/README"
}