summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 79bd597d7328a3924dbe4ff93712a54a506f7709 (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
# Maintainer: Dimitris Kiziridis <ragouel at outlook dot com>

pkgname=align-git
_pkgname=align
pkgver=1.1.0.r0.g3cf3157
pkgrel=2
pkgdesc="A general purpose application for aligning text"
arch=('x86_64')
url='https://github.com/Guitarbum722/align'
license=('MIT')
provides=('align')
depends=('glibc')
makedepends=('git' 'go-pie')
source=("git+${url}")
md5sums=('SKIP')

pkgver() {
  cd "${srcdir}/${_pkgname}"
  git describe --long --tags | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
}

prepare() {
  cd "${srcdir}/${_pkgname}"
  mkdir -p $srcdir/go
  export GOPATH="${srcdir}"/go
  export PATH=$PATH:$GOPATH/bin
  go get -d -v ./...
}

build() {
  cd "${srcdir}/${_pkgname}/cmd/align"
  export GOPATH="${srcdir}"/go
  export PATH=$PATH:$GOPATH/bin
  go build \
    -trimpath \
    -ldflags "-extldflags $LDFLAGS" \
    -v ./...
}

package() {
  install -Dm755 "${srcdir}/${_pkgname}/cmd/align/${_pkgname}" "${pkgdir}/usr/bin/${_pkgname}"
  install -Dm644 "${srcdir}/${_pkgname}/LICENSE" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
  go clean -modcache #Remove go libraries
}