diff options
-rw-r--r-- | .SRCINFO | 8 | ||||
-rw-r--r-- | PKGBUILD | 50 |
2 files changed, 33 insertions, 25 deletions
@@ -1,7 +1,7 @@ pkgbase = align-git pkgdesc = A general purpose application for aligning text - pkgver = 1.1.0.r0.g3cf3157 - pkgrel = 2 + pkgver = 1.1.2.r0.ga2c6f9c + pkgrel = 1 url = https://github.com/Guitarbum722/align arch = x86_64 license = MIT @@ -9,8 +9,8 @@ pkgbase = align-git makedepends = go depends = glibc provides = align - source = align::git+https://github.com/Guitarbum722/align + conflicts = align + source = align-git::git+https://github.com/Guitarbum722/align sha256sums = SKIP pkgname = align-git - @@ -1,42 +1,50 @@ -# Maintainer: Dimitris Kiziridis <ragouel at outlook dot com> +# Maintainer: Luis Martinez <luis dot martinez at disroot dot org> +# Contributor: Dimitris Kiziridis <ragouel at outlook dot com> pkgname=align-git -_pkgname=align -pkgver=1.1.0.r0.g3cf3157 -pkgrel=2 +pkgver=1.1.2.r0.ga2c6f9c +pkgrel=1 pkgdesc="A general purpose application for aligning text" arch=('x86_64') url='https://github.com/Guitarbum722/align' license=('MIT') provides=('align') +conflicts=('align') depends=('glibc') makedepends=('git' 'go') -source=("align::git+${url}") +source=("$pkgname::git+$url") sha256sums=('SKIP') pkgver() { - cd "${srcdir}/${_pkgname}" - git describe --long --tags | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g' + git -C "$pkgname" describe --long --tags | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g' } prepare() { - cd "${srcdir}/${_pkgname}" - mkdir -p build/ + cd "$pkgname" + mkdir -p build + go mod init "${url#https://}" + go mod tidy } build() { - cd "${srcdir}/${_pkgname}" - export CGO_LDFLAGS="${LDFLAGS}" - export CGO_CFLAGS="${CFLAGS}" - export CGO_CPPFLAGS="${CPPFLAGS}" - export CGO_CXXFLAGS="${CXXFLAGS}" - export GOFLAGS="-buildmode=pie -trimpath -mod=readonly -modcacherw" - go get -d -v ./... - go build -o build ./... + export CGO_LDFLAGS="${LDFLAGS}" + export CGO_CFLAGS="${CFLAGS}" + export CGO_CPPFLAGS="${CPPFLAGS}" + export CGO_CXXFLAGS="${CXXFLAGS}" + export GOFLAGS="-buildmode=pie -trimpath -ldflags=-linkmode=external -mod=readonly -modcacherw" + + cd "$pkgname/" + go build -o build ./... +} + +check() { + cd "$pkgname" + go test ./... } package() { - cd "${srcdir}/${_pkgname}" - install -Dm755 build/align "${pkgdir}/usr/bin/${_pkgname}" - install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE" -}
\ No newline at end of file + cd "$pkgname" + install -Dm755 build/align -t "$pkgdir/usr/bin/" + install -Dm644 LICENSE -t "$pkgdir/usr/share/licenses/$pkgname/" + install -Dm644 README.md -t "$pkgdir/usr/share/doc/$pkgname/" +} |