From e995d9a4b1c2ba9ce54286f9ba854ca6dc0a3c13 Mon Sep 17 00:00:00 2001 From: jenkins Date: Fri, 15 Jul 2022 11:36:09 +0000 Subject: [PATCH 1/2] app-containers/syft: Import from Gentoo Upstream commit c691680319ac2f00f203533c3dca0b21ecf77f80 --- .../app-containers/syft/Manifest | 2 ++ .../app-containers/syft/metadata.xml | 8 +++++++ .../app-containers/syft/syft-0.51.0.ebuild | 22 +++++++++++++++++++ 3 files changed, 32 insertions(+) create mode 100644 sdk_container/src/third_party/coreos-overlay/app-containers/syft/Manifest create mode 100644 sdk_container/src/third_party/coreos-overlay/app-containers/syft/metadata.xml create mode 100644 sdk_container/src/third_party/coreos-overlay/app-containers/syft/syft-0.51.0.ebuild diff --git a/sdk_container/src/third_party/coreos-overlay/app-containers/syft/Manifest b/sdk_container/src/third_party/coreos-overlay/app-containers/syft/Manifest new file mode 100644 index 0000000000..351ff57f43 --- /dev/null +++ b/sdk_container/src/third_party/coreos-overlay/app-containers/syft/Manifest @@ -0,0 +1,2 @@ +DIST syft-0.51.0-deps.tar.xz 632084588 BLAKE2B f9b3e4e41521c25b6e338f2b8f3bba0be08e7608d95de7dba6f5f104e22b8de8a4b419e574e19634099a3bbc55556f83949c68abd5ae52d14b5e97cb9306bf22 SHA512 819236c275762cc42c60339ee2d6886f0998f34609ab0bbef3150b23fbcf3cecaea63d92f6e2e161bf3ec30edae00ef467755900fd1c98389db2f9cd8113fbf4 +DIST syft-0.51.0.tar.gz 3727474 BLAKE2B ae9f54f421faa530aabbbadd985071f603ccaa32c6cd5f0dd400ea9163a218e8ddd5e7035042a7eda6cd06910ce96ae0f42b7422c932992fad812431a42ac059 SHA512 fb844a76d3f3f303e781cea40ac6fb573927f6465a39da10fe9cffeb08ce7b1e8b8ed4acb219206e53159f802eaa12dce73ce5bc3b868f6f4270a30498b6b767 diff --git a/sdk_container/src/third_party/coreos-overlay/app-containers/syft/metadata.xml b/sdk_container/src/third_party/coreos-overlay/app-containers/syft/metadata.xml new file mode 100644 index 0000000000..3b2a9c5910 --- /dev/null +++ b/sdk_container/src/third_party/coreos-overlay/app-containers/syft/metadata.xml @@ -0,0 +1,8 @@ + + + + +williamh@gentoo.org +William Hubbs + + diff --git a/sdk_container/src/third_party/coreos-overlay/app-containers/syft/syft-0.51.0.ebuild b/sdk_container/src/third_party/coreos-overlay/app-containers/syft/syft-0.51.0.ebuild new file mode 100644 index 0000000000..2c42d972b9 --- /dev/null +++ b/sdk_container/src/third_party/coreos-overlay/app-containers/syft/syft-0.51.0.ebuild @@ -0,0 +1,22 @@ +# Copyright 2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 +inherit go-module + +DESCRIPTION="Generate a Software Bill of Materials from container images and filesystems" +HOMEPAGE="https://www.anchore.com" +SRC_URI="https://github.com/anchore/syft/archive/v${PV}.tar.gz -> ${P}.tar.gz" +SRC_URI+=" https://dev.gentoo.org/~williamh/dist/${P}-deps.tar.xz" + +LICENSE="Apache-2.0" +SLOT="0" +KEYWORDS="~amd64" + +src_compile() { + ego build -o bin/syft ./cmd/syft +} + +src_install() { +dobin bin/* +} From a938fb9b5c5f912b27db5a1845d949c181065779 Mon Sep 17 00:00:00 2001 From: jenkins Date: Mon, 18 Jul 2022 07:41:01 +0000 Subject: [PATCH 2/2] app-containers/syft: apply downstream changes * pass additional ldflags so that `syft version` prints the package version. * keyword stable for amd64 and arm64 (to reduce differences between the two). --- .../coreos-overlay/app-containers/syft/syft-0.51.0.ebuild | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sdk_container/src/third_party/coreos-overlay/app-containers/syft/syft-0.51.0.ebuild b/sdk_container/src/third_party/coreos-overlay/app-containers/syft/syft-0.51.0.ebuild index 2c42d972b9..7f44b825c0 100644 --- a/sdk_container/src/third_party/coreos-overlay/app-containers/syft/syft-0.51.0.ebuild +++ b/sdk_container/src/third_party/coreos-overlay/app-containers/syft/syft-0.51.0.ebuild @@ -11,12 +11,14 @@ SRC_URI+=" https://dev.gentoo.org/~williamh/dist/${P}-deps.tar.xz" LICENSE="Apache-2.0" SLOT="0" -KEYWORDS="~amd64" +# Flatcar: keyword for arm64 and amd64 +KEYWORDS="amd64 arm64" src_compile() { - ego build -o bin/syft ./cmd/syft + # Flatcar: add ldflags to set version + ego build -o bin/syft -ldflags "-X github.com/anchore/syft/internal/version.version=${PV}" ./cmd/syft } src_install() { -dobin bin/* + dobin bin/* }