[Buildroot] [PATCH 6/7] package/pkg-python: support PURL generation

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


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

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

- The PURL type is 'pypi'.
- The PURL name is the package name. Since buildroot python packages
  include a 'python-' prefix to the name of package, this part is
  stripped.

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

diff --git a/package/pkg-python.mk b/package/pkg-python.mk
index 32ace4aac1..c125b2e009 100644
--- a/package/pkg-python.mk
+++ b/package/pkg-python.mk
@@ -454,6 +454,22 @@ endif
 
 endif # host / target
 
+ifndef $(2)_PURL_TYPE
+ ifdef $(3)_PURL_TYPE
+  $(2)_PURL_TYPE = $$($(3)_PURL_TYPE)
+ else
+  $(2)_PURL_TYPE = pypi
+ endif
+endif
+
+ifndef $(2)_PURL_NAME
+ ifdef $(3)_PURL_NAME
+  $(2)_PURL_NAME = $$($(3)_PURL_NAME)
+ else
+  $(2)_PURL_NAME=$$(patsubst python-%,%,$$($(2)_RAWNAME))
+ 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