# Contributor: @ifurther <55025025+ifurther@users.noreply.github.com> _realname=hugo pkgbase=mingw-w64-${_realname} pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}") pkgver=0.120.4 pkgrel=1 pkgdesc='A Fast and Flexible Static Site Generator built with love by bep, spf13 and friends in Go. (mingw-w64)' arch=('any') mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clang32' 'clangarm64') msys2_references=( 'archlinux: hugo' ) msys2_repository_url='https://github.com/gohugoio/hugo/' url='https://gohugo.io/' license=('spdx:Apache-2.0') makedepends=("${MINGW_PACKAGE_PREFIX}-go" "${MINGW_PACKAGE_PREFIX}-cc" "git") optdepends=("git: To interact with repositories") options=('!strip') source=("${_realname}-${pkgver}.tar.gz::https://github.com/gohugoio/hugo/archive/refs/tags/v${pkgver}.tar.gz") sha256sums=('e374effe369c340d8085060e6bb45337eabf64cfe075295432ecafd6d033eb8b') build() { cd "${_realname}-${pkgver}" export GOOS=windows export GOROOT=${MINGW_PREFIX}/lib/go export CGO_CPPFLAGS="${CPPFLAGS}" export CGO_CFLAGS="${CFLAGS}" export CGO_CXXFLAGS="${CXXFLAGS}" export CGO_LDFLAGS="${LDFLAGS}" export GO_LDFLAGS="-s -w" export GOFLAGS="-trimpath -mod=readonly -modcacherw -ldflags=-linkmode=external" go build -tags extended ./hugo.exe gen man ./hugo.exe completion bash > hugo.bash-completion ./hugo.exe completion fish > hugo.fish ./hugo.exe completion zsh > hugo.zsh } check() { cd "${_realname}-${pkgver}" go test } package() { cd "${_realname}-${pkgver}" install -Dm755 "hugo.exe" "${pkgdir}${MINGW_PREFIX}/bin/hugo.exe" install -Dm644 "LICENSE" "${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/LICENSE" install -Dm644 "README.md" "${pkgdir}${MINGW_PREFIX}/share/doc/${_realname}/README.md" install -Dm644 man/*.1 -t "${pkgdir}${MINGW_PREFIX}"/share/man/man1/ install -Dm644 hugo.bash-completion "${pkgdir}${MINGW_PREFIX}"/share/bash-completion/completions/hugo install -Dm644 hugo.fish "${pkgdir}${MINGW_PREFIX}"/share/fish/vendor_completions.d/hugo.fish install -Dm644 hugo.zsh "${pkgdir}${MINGW_PREFIX}"/share/zsh/site-functions/_hugo }