2025-08-20 22:24:36 +02:00

64 lines
2.2 KiB
Bash

# Contributor: @ifurther <55025025+ifurther@users.noreply.github.com>
_realname=hugo
pkgbase=mingw-w64-${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}")
pkgver=0.148.2
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=('mingw64' 'ucrt64' 'clang64' 'clangarm64')
url='https://gohugo.io/'
msys2_repository_url='https://github.com/gohugoio/hugo/'
msys2_references=(
'anitya: 12959'
'archlinux: hugo'
'aur: hugo-git'
"cpe: cpe:/a:gohugo:hugo"
'gentoo: www-apps/hugo'
)
license=('spdx:Apache-2.0')
depends=("${MINGW_PACKAGE_PREFIX}-cc-libs")
makedepends=("${MINGW_PACKAGE_PREFIX}-go" "${MINGW_PACKAGE_PREFIX}-cc" "git")
optdepends=("git: To interact with repositories")
options=('!strip')
source=("https://github.com/gohugoio/hugo/archive/v${pkgver}/${_realname}-${pkgver}.tar.gz")
sha256sums=('562024495bb23ee54d11bbb63d15156213d40b24c5f5276bc8851dc6135b8602')
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
}