summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 9b19409192bddebff170d2e45608830a6d45dfb3 (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
46
47
pkgname=asciitosvg-git
pkgver=r49.ca82a5c
pkgrel=1
pkgdesc="Create beautiful SVG diagrams from ASCII art"
arch=("any")
url="https://github.com/asciitosvg/asciitosvg/"
license=("MIT")

makedepends=(
  'git'
  'go-pie'
)

source=(
  "git+https://github.com/asciitosvg/asciitosvg"
)

sha512sums=(
  'SKIP'
)

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

prepare() {
  cd asciitosvg
  go mod init 'github.com/asciitosvg/asciitosvg'
  go mod tidy
}

build() {
  mkdir -p gopath/src/github.com/asciitosvg
  ln -rTsf asciitosvg gopath/src/github.com/asciitosvg/asciitosvg
  export GOPATH="$srcdir/gopath"
  cd "$GOPATH/src/github.com/asciitosvg/asciitosvg"
  go install \
    -gcflags "all=-trimpath=$GOPATH" \
    -asmflags "all=-trimpath=$GOPATH" \
    -ldflags "-extldflags $LDFLAGS" \
    -v ./...
}

package() {
  install -Dm755 "gopath/bin/a2s" "$pkgdir/usr/bin/a2s"
}