diff options
Diffstat (limited to 'PKGBUILD')
-rw-r--r-- | PKGBUILD | 50 |
1 files changed, 23 insertions, 27 deletions
@@ -1,41 +1,37 @@ # Maintainer: aksr <aksr at t-com dot me> pkgname=typo-git -pkgver=r19.7cc4581 +pkgver=r24.2b34eb0 pkgrel=1 -pkgdesc="A modern version of the original Unix typo command." +pkgdesc='A modern version of the original Unix typo command.' arch=('i686' 'x86_64') -url="https://github.com/robpike/typo" +url='https://github.com/robpike/typo' license=('BSD') -makedepends=('git' 'go>=1.5') -conflicts=('typo') -_gourl=robpike.io/cmd/typo +makedepends=('git' 'go>=1.19') +conflicts=("${pkgname%-*}") +source=("git+$url.git") +md5sums=('SKIP') pkgver() { - GOPATH="$srcdir" go get -d ${_gourl} - cd "$srcdir/src/${_gourl}/" - printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)" + cd typo + printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)" } build() { - GOPATH="$srcdir" go get -fix -v -d ${_gourl} - sed -i '93s|.*| path := filepath.Join(string(os.PathSeparator), "usr", "share", "doc", "'"$pkgname"'", base)|g' \ - "$srcdir"/src/${_gourl}/typo.go - cd "$srcdir"/src/${_gourl} - GOPATH="$srcdir" go build -o typo -} - -check() { - GOPATH="$srcdir" go test -v -x ${_gourl} + 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"/src/${_gourl} - install -Dm755 typo "$pkgdir/usr/bin/typo" - install -Dm644 LICENSE $pkgdir/usr/share/licenses/$pkgname/LICENSE - install -Dm644 typo.png $pkgdir/usr/share/doc/$pkgname/typo.png - sed '409,489!d' typo.go > README - install -Dm644 README $pkgdir/usr/share/doc/$pkgname/README - install -Dm644 w2006.txt $pkgdir/usr/share/doc/$pkgname/w2006.txt - ln -rs $pkgdir/usr/share/doc/$pkgname/w2006.txt $pkgdir/usr/share/doc/$pkgname/words + 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 } - |