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)
Mon, Mar 25, 10:37 PM
Unknown Object (File)
Mar 2 2024, 4:43 PM
Unknown Object (File)
Feb 28 2024, 8:48 AM
Unknown Object (File)
Feb 18 2024, 9:00 AM
Unknown Object (File)
Feb 2 2024, 7:26 PM
Unknown Object (File)
Feb 2 2024, 4:18 PM
Unknown Object (File)
Jan 31 2024, 5:48 AM
Unknown Object (File)
Jan 29 2024, 1:49 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.