grype: Add 0.99.1
This commit is contained in:
parent
ceff84ccfe
commit
1a039ce5a1
61
mingw-w64-grype/PKGBUILD
Normal file
61
mingw-w64-grype/PKGBUILD
Normal file
@ -0,0 +1,61 @@
|
||||
# Maintainer: Christoph Reiter <reiter.christoph@gmail.com>
|
||||
|
||||
_realname=grype
|
||||
pkgbase="mingw-w64-${_realname}"
|
||||
pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}")
|
||||
pkgver=0.99.1
|
||||
pkgrel=1
|
||||
pkgdesc="Vulnerability scanner for container images, filesystems, and SBOMs (mingw-w64)"
|
||||
arch=('any')
|
||||
mingw_arch=('mingw64' 'ucrt64' 'clang64' 'clangarm64')
|
||||
url="https://github.com/anchore/grype"
|
||||
msys2_repository_url="https://github.com/anchore/grype"
|
||||
license=("spdx:Apache-2.0")
|
||||
depends=()
|
||||
makedepends=(
|
||||
"${MINGW_PACKAGE_PREFIX}-go"
|
||||
"${MINGW_PACKAGE_PREFIX}-cc"
|
||||
)
|
||||
source=("${_realname}-${pkgver}.tar.gz::https://github.com/anchore/grype/archive/v${pkgver}.tar.gz")
|
||||
noextract=("${_realname}-${pkgver}.tar.gz")
|
||||
sha256sums=('0f5e294615013e4f4a757064540696e52546c1b8bdef65ea9b1ccc3ddd49d39a')
|
||||
|
||||
prepare() {
|
||||
tar -xf "${_realname}-${pkgver}.tar.gz" || true
|
||||
}
|
||||
|
||||
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"
|
||||
case "${CARCH}" in
|
||||
x86_64)
|
||||
GOFLAGS+=" -buildmode=pie"
|
||||
;;
|
||||
esac
|
||||
|
||||
export GOFLAGS+=" -ldflags=-X=main.version=${pkgver}"
|
||||
|
||||
go build -o bin/${_realname}.exe ./cmd/grype
|
||||
|
||||
./bin/${_realname}.exe completion bash > "${_realname}.bash"
|
||||
./bin/${_realname}.exe completion fish > "${_realname}.fish"
|
||||
./bin/${_realname}.exe completion zsh > "${_realname}.zsh"
|
||||
}
|
||||
|
||||
package() {
|
||||
cd "${_realname}-${pkgver}"
|
||||
|
||||
install -Dm755 "bin/${_realname}.exe" "${pkgdir}${MINGW_PREFIX}/bin/${_realname}.exe"
|
||||
|
||||
install -Dm644 "${_realname}.bash" "${pkgdir}${MINGW_PREFIX}/share/bash-completion/completions/${_realname}"
|
||||
install -Dm644 "${_realname}.fish" "${pkgdir}${MINGW_PREFIX}/share/fish/vendor_completions.d/${_realname}.fish"
|
||||
install -Dm644 "${_realname}.zsh" "${pkgdir}${MINGW_PREFIX}/share/zsh/site-functions/_${_realname}"
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user