From 54e3265917887fe6b7aaca3edf0e5e4bfa9a12be Mon Sep 17 00:00:00 2001 From: Gavin Zhao Date: Sat, 21 Oct 2023 12:52:13 -0400 Subject: [PATCH] Add checkdeps field to package.yml Signed-off-by: Gavin Zhao --- man/package.yml.5.md | 16 ++++++++++++++++ ypkg-install-deps | 13 +++++++++++++ ypkg2/ypkgspec.py | 2 ++ 3 files changed, 31 insertions(+) diff --git a/man/package.yml.5.md b/man/package.yml.5.md index d183126..ea33f35 100644 --- a/man/package.yml.5.md +++ b/man/package.yml.5.md @@ -145,6 +145,22 @@ additional functionality. It is not required to list any package here that exists in the `system.base` or `system.devel` component. +* `checkdeps` [list] + + Specifies the build and/or run dependencies required to build and/or run + the tests of + this package in an isolated environment (`solbuild(1)`). + + You may use full package names here, though it is preferable to use the + `pkg-config(1)` names. + + `ypkg-build(1)` understands pkgconfig dependencies denoted inside either + the `pkgconfig($name)` identifier, or `pkgconfig32($name)` for emul32 + build dependencies. + + It is not required to list any package here that exists in the `system.base` + or `system.devel` component. + * `clang` [boolean] Set this key to `yes` to force building this package with the `clang` diff --git a/ypkg-install-deps b/ypkg-install-deps index 412e2bc..cef18dc 100755 --- a/ypkg-install-deps +++ b/ypkg-install-deps @@ -83,6 +83,19 @@ def main(): if not idb.has_package(dep): ndeps.add(dep) + if spec.pkg_checkdeps: + for dep in spec.pkg_checkdeps: + em32 = pkgconfig32_dep.match(dep) + if em32: + pc32deps.add(em32.group(1)) + continue + em = pkgconfig_dep.match(dep) + if em: + pcdeps.add(em.group(1)) + continue + if not idb.has_package(dep): + ndeps.add(dep) + # Get the global known pkgconfig providers pkgConfigs, pkgConfigs32 = pdb.get_pkgconfig_providers() diff --git a/ypkg2/ypkgspec.py b/ypkg2/ypkgspec.py index 14382cf..51620aa 100644 --- a/ypkg2/ypkgspec.py +++ b/ypkg2/ypkgspec.py @@ -107,6 +107,7 @@ class YpkgSpec: # Dependencies pkg_builddeps = None + pkg_checkdeps = None mandatory_tokens = None optional_tokens = None @@ -219,6 +220,7 @@ def __init__(self): ("patterns", MultimapFormat(self, self.add_pattern, "main")), ("permanent", OneOrMoreString), ("builddeps", OneOrMoreString), + ("checkdeps", OneOrMoreString), ("rundeps", MultimapFormat(self, self.add_rundep, "main")), ("component", MultimapFormat(self, self.add_component, "main")), ("conflicts", MultimapFormat(self, self.add_conflict, "main")),