Page MenuHomeFreeBSD

Add support for USES.subpkg
Needs ReviewPublic

Authored by pizzamig on Jan 24 2024, 10:16 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, May 14, 3:06 PM
Unknown Object (File)
Mon, May 13, 4:08 AM
Unknown Object (File)
Sat, May 11, 2:52 AM
Unknown Object (File)
Thu, May 9, 9:08 AM
Unknown Object (File)
Thu, May 9, 4:12 AM
Unknown Object (File)
Apr 30 2024, 1:53 AM
Unknown Object (File)
Apr 26 2024, 3:08 AM
Unknown Object (File)
Mar 25 2024, 10:37 PM
Subscribers
None

Details

Reviewers
arrowd
mat
Group Reviewers
portmgr
Summary

The idea is to have the dependency related *_DEPENDS define as
USES_*_DEPENDS in Uses Mk.
Then, the framework is going to add the USES_*_DEPENDS in the appropriate
SUBPACKAGE one

this patch is just to propose the approach and it's not ready to use
I've changed only LIB_DEPENDS and RUN_DEPENDS

Additionally, we would need a git hook to ensure that USES are not using
*_DEPENDS but USES_*_DEPENDS only

Diff Detail

Repository
R11 FreeBSD ports repository
Lint
No Lint Coverage
Unit
No Test Coverage
Build Status
Buildable 55603
Build 52492: arc lint + arc unit

Event Timeline

pizzamig created this revision.

So, if I have:

SUBPACKAGES= gtk3 gtk4
USES= gnome=libxml2
USES.gtk3= gnome=gtk30
USES.gtk4= gnome=gtk40

How does that work ?

The idea is that every time a USES is included, it generates a USES_*_DEPENDS
Those prefixed depends are going to be copied to the appropriate *_DEPENDS (without suffix main package, with suffixes for the subpackages)

USES= gnome=libxml2

It will set USES_LIB_DEPENDS= libxml2.so:textproc/libxml2and it will be added to LIB_DEPENDS

USES.gtk3= gnome=gtk30

It will set USES_LIB_DEPENDS= libgtk-3.so:x11-toolkits/gtk30and it will be added to LIB_DEPENDS.gtk3

And so on.

The idea is that every time a USES is included, it generates a USES_*_DEPENDS
Those prefixed depends are going to be copied to the appropriate *_DEPENDS (without suffix main package, with suffixes for the subpackages)

USES= gnome=libxml2

It will set USES_LIB_DEPENDS= libxml2.so:textproc/libxml2and it will be added to LIB_DEPENDS

USES.gtk3= gnome=gtk30

It will set USES_LIB_DEPENDS= libgtk-3.so:x11-toolkits/gtk30and it will be added to LIB_DEPENDS.gtk3

And so on.

A USES can only be parsed once, there is a guard against it.

So, in my example, the only one to actually do something is USES= gnome=libxml2, the other two are ignored.

Bear in mind that make has no local variables, every variable is global.