Skip to content

Commit

Permalink
Add checkdeps field to package.yml
Browse files Browse the repository at this point in the history
Signed-off-by: Gavin Zhao <git@gzgz.dev>
  • Loading branch information
GZGavinZhao committed Oct 22, 2023
1 parent 8b94671 commit 54e3265
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 0 deletions.
16 changes: 16 additions & 0 deletions man/package.yml.5.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down
13 changes: 13 additions & 0 deletions ypkg-install-deps
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down
2 changes: 2 additions & 0 deletions ypkg2/ypkgspec.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ class YpkgSpec:

# Dependencies
pkg_builddeps = None
pkg_checkdeps = None

mandatory_tokens = None
optional_tokens = None
Expand Down Expand Up @@ -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")),
Expand Down

0 comments on commit 54e3265

Please # to comment.