blob: 5a2fed2d673435ee8c9bd97c078e3867b271ed9e (
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
|
# Maintainer: aksr <aksr at t-com dot me>
pkgname=typo-git
pkgver=r24.2b34eb0
pkgrel=1
pkgdesc='A modern version of the original Unix typo command.'
arch=('i686' 'x86_64')
url='https://github.com/robpike/typo'
license=('BSD')
makedepends=('git' 'go>=1.19')
conflicts=("${pkgname%-*}")
source=("git+$url.git")
md5sums=('SKIP')
pkgver() {
cd typo
printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}
build() {
export CGO_CPPFLAGS="${CPPFLAGS}"
export CGO_CFLAGS="${CFLAGS}"
export CGO_CXXFLAGS="${CXXFLAGS}"
export CGO_LDFLAGS="${LDFLAGS}"
export GOFLAGS="-buildmode=pie -trimpath -mod=readonly -modcacherw"
cd $srcdir/${pkgname%-*}
[[ -d build ]] || mkdir build
go build -o build ./...
}
package() {
cd $srcdir/${pkgname%-*}
install -D -m755 build/typo "$pkgdir/usr/bin/typo"
sed '385,465!d' typo.go > README
install -D -m644 README "$pkgdir"/usr/share/doc/${pkgname%-*}/README
install -D -m644 LICENSE "$pkgdir"/usr/share/licenses/${pkgname}/LICENSE
}
|