[Buildroot] [PATCH 3/7] package/pkg-golang: support PURL generation

Thomas Perale thomas.perale at mind.be
Tue Apr 15 19:55:37 UTC 2025


The PURL specification for Golang packages follows the coordinates from
the sonatype ossindex:

https://ossindex.sonatype.org/ecosystem/golang

- The PURL type is defined as 'golang'.
- The PURL namespace of the packages is made of the source host website,
  the owner.
- The PURL name is the package name.

Signed-off-by: Thomas Perale <thomas.perale at mind.be>
---
 package/pkg-golang.mk | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/package/pkg-golang.mk b/package/pkg-golang.mk
index a4e8bd30cc..f76c976ce3 100644
--- a/package/pkg-golang.mk
+++ b/package/pkg-golang.mk
@@ -182,6 +182,22 @@ define $(2)_INSTALL_CMDS
 endef
 endif
 
+ifndef $(2)_PURL_TYPE
+ ifdef $(3)_PURL_TYPE
+  $(2)_PURL_TYPE = $$($(3)_PURL_TYPE)
+ else
+  $(2)_PURL_TYPE = golang
+ endif
+endif
+
+ifndef $(2)_PURL_NAMESPACE
+ ifdef $(3)_PURL_NAMESPACE
+  $(2)_PURL_NAMESPACE = $$($(3)_PURL_NAMESPACE)
+ else
+  $(2)_PURL_NAMESPACE = $$(call domain,$$($(2)_SITE))/$$(call owner,$$($(2)_SITE))
+ endif
+endif
+
 # Call the generic package infrastructure to generate the necessary make
 # targets
 $(call inner-generic-package,$(1),$(2),$(3),$(4))
-- 
2.49.0



More information about the buildroot mailing list