# Description: Markdown renderer for the CLI
# URL: https://github.com/charmbracelet/glow
# Maintainer: Tim Biermann, tbier at posteo dot de
# Depends on: go

name=glow
version=1.5.1
release=1
source=(https://github.com/charmbracelet/glow/archive/v$version/glow-$version.tar.gz)

build() {
  cd $name-$version

  export CGO_CPPFLAGS="${CPPFLAGS}"
  export CGO_CFLAGS="${CFLAGS}"
  export CGO_CXXFLAGS="${CXXFLAGS}"
  export CGO_LDFLAGS="${LDFLAGS}"

  mkdir "$PKGMK_SOURCE_DIR/gopath" || true
  export GOPATH="$PKGMK_SOURCE_DIR/gopath"

  go build \
    -trimpath \
    -buildmode=pie \
    -mod=readonly \
    -modcacherw \
    -o glow .
  install -Dm755 glow $PKG/usr/bin/glow
}
