blob: 179dded8c32afd22b3f6596d00d82e4b4be3237d (
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
48
49
|
# Maintainer: Vitalii Kuzhdin <vitaliikuzhdin@gmail.com>
_binname="gsa"
pkgname="go-size-analyzer"
pkgver=1.7.4
pkgrel=1
pkgdesc="A tool for analyzing the dependencies in compiled Golang binaries"
arch=('x86_64' 'aarch64')
url="https://${_binname}.zxilly.dev"
_url="https://github.com/Zxilly/${pkgname}"
license=('AGPL-3.0-only')
depends=('glibc')
makedepends=('go')
_pkgsrc="${pkgname}-${pkgver}"
source=("${_pkgsrc}.tar.gz::${_url}/archive/refs/tags/v${pkgver}.tar.gz")
b2sums=('ff7c5acc8f12c0c0581b8b61d942cbc25dc546c923824dda383dd0642f30295ddad27b9a6eb0e51cda062fc24586a929aba619956cb8de60f14a47b978e117de')
prepare() {
cd "${srcdir}/${_pkgsrc}"
mkdir -p "build"
}
build() {
local build_date=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
cd "${srcdir}/${_pkgsrc}"
export CGO_CPPFLAGS="${CPPFLAGS}"
export CGO_CFLAGS="${CFLAGS}"
export CGO_CXXFLAGS="${CXXFLAGS}"
export CGO_LDFLAGS="${LDFLAGS}"
export GOFLAGS="-buildmode=pie -trimpath -ldflags=-linkmode=external -mod=readonly -modcacherw"
go build -o "build/${_binname}" -ldflags "\
-X ${_url#https://}.version=${pkgver} \
-X ${_url#https://}.buildDate=${build_date}" \
./"cmd/${_binname}"
}
# check() {
# cd "${srcdir}/${_pkgsrc}"
# go test ./...
# }
package() {
cd "${srcdir}/${_pkgsrc}"
install -Dm755 "build/${_binname}" "${pkgdir}/usr/bin/${_binname}"
install -Dm644 "README.md" "${pkgdir}/usr/share/doc/${pkgname}/README.md"
# install -Dm644 "README_zh_CN.md" "${pkgdir}/usr/share/doc/${_pkgname}/README_zh_CN.md"
install -Dm644 "LICENSE" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}
|