summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO12
-rw-r--r--PKGBUILD63
2 files changed, 41 insertions, 34 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 4f8568998105..eebb1ceb9d07 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,13 +1,15 @@
pkgbase = golang-mockery
pkgdesc = A mock code autogenerator for golang
- pkgver = 2.13.1
- pkgrel = 2
+ pkgver = 2.35.4
+ pkgrel = 1
url = https://github.com/vektra/mockery
- arch = x86_64
+ arch = any
license = BSD
makedepends = go
depends = glibc
- source = https://github.com/vektra/mockery/archive/v2.13.1/golang-mockery-2.13.1.tar.gz
- sha256sums = e52ca8bfa6b6f9bfb90d42e9e065ef01484f8039731cc320f6dfe4b11fae76b9
+ provides = mockery=2.35.4
+ conflicts = mockery
+ source = mockery-2.35.4.tar.gz::https://github.com/vektra/mockery/archive/refs/tags/v2.35.4.tar.gz
+ sha256sums = f50c603bee265e736510000001dff49ccc9b332cde4b245be390f4e74c3abd34
pkgname = golang-mockery
diff --git a/PKGBUILD b/PKGBUILD
index 609d15cb3e28..3c961b827887 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,37 +1,42 @@
-# Maintainer: ml <>
-pkgname=golang-mockery
-pkgver=2.13.1
-pkgrel=2
+# Contributor: matthias.lisin
+# Maintainer: zxp19821005 <zxp19821005 at 163 dot com>
+_pkgname=mockery
+pkgname="golang-${_pkgname}"
+pkgver=2.35.4
+pkgrel=1
pkgdesc='A mock code autogenerator for golang'
-arch=('x86_64')
+arch=('any')
url='https://github.com/vektra/mockery'
-license=('BSD')
+license=("BSD")
+provides=("${_pkgname}=${pkgver}")
+conflicts=("${_pkgname}")
depends=('glibc')
makedepends=('go')
-source=("$url/archive/v$pkgver/$pkgname-$pkgver.tar.gz")
-sha256sums=('e52ca8bfa6b6f9bfb90d42e9e065ef01484f8039731cc320f6dfe4b11fae76b9')
-
+source=("${_pkgname}-${pkgver}.tar.gz::${url}/archive/refs/tags/v${pkgver}.tar.gz")
+sha256sums=('f50c603bee265e736510000001dff49ccc9b332cde4b245be390f4e74c3abd34')
build() {
- cd mockery-"$pkgver"
- export CGO_ENABLED=1
- export CGO_LDFLAGS="$LDFLAGS"
- export CGO_CFLAGS="$CFLAGS"
- export CGO_CPPFLAGS="$CPPFLAGS"
- export CGO_CXXFLAGS="$CXXFLAGS"
- export GOFLAGS='-buildmode=pie -modcacherw -trimpath'
- go build -o mockery -ldflags "-linkmode=external -X github.com/vektra/mockery/v2/pkg/config.SemVer=v$pkgver" main.go
+ cd "${_pkgname}"-"${pkgver}"
+ export CGO_ENABLED=1
+ export CGO_LDFLAGS="$LDFLAGS"
+ export CGO_CFLAGS="$CFLAGS"
+ export CGO_CPPFLAGS="$CPPFLAGS"
+ export CGO_CXXFLAGS="$CXXFLAGS"
+ export GOFLAGS='-buildmode=pie -modcacherw -trimpath'
+ # For Chinese Only
+ #export GO111MODULE=on
+ #export GOPROXY=https://goproxy.cn
+ go build -o "${_pkgname}" -ldflags "-linkmode=external -X github.com/vektra/mockery/v2/pkg/config.SemVer=v${pkgver}" main.go
- for i in bash zsh fish; do
- # --config=/dev/null to avoid reading .mockery.yaml
- ./mockery --config=/dev/null completion "$i" >completion."$i"
- done
+ for _shell in bash zsh fish; do
+ # --config=/dev/null to avoid reading .mockery.yaml
+ ./mockery --config=/dev/null completion "${_shell}" >completion."${_shell}"
+ done
}
-
package() {
- cd mockery-"$pkgver"
- install -Dm755 mockery -t "$pkgdir"/usr/bin
- install -Dm755 LICENSE -t "$pkgdir"/usr/share/licenses/"$pkgname"
- install -Dm644 completion.bash "$pkgdir"/usr/share/bash-completion/completions/mockery
- install -Dm644 completion.zsh "$pkgdir"/usr/share/zsh/site-functions/_mockery
- install -Dm644 completion.fish "$pkgdir"/usr/share/fish/vendor_completions.d/mockery.fish
-}
+ cd "${srcdir}/${_pkgname}-${pkgver}"
+ install -Dm755 "${_pkgname}" -t "${pkgdir}/usr/bin"
+ install -Dm644 "LICENSE" -t "${pkgdir}/usr/share/licenses/${pkgname}"
+ install -Dm644 "completion.bash" "${pkgdir}/usr/share/bash-completion/completions/${_pkgname}"
+ install -Dm644 "completion.zsh" "${pkgdir}/usr/share/zsh/site-functions/_${_pkgname}"
+ install -Dm644 "completion.fish" "${pkgdir}/usr/share/fish/vendor_completions.d/${_pkgname}.fish"
+} \ No newline at end of file