Page MenuHomeFreeBSD

Add support for USES.subpkg
Needs ReviewPublic

Authored by pizzamig on Jan 24 2024, 10:16 PM.
Tags
None
Referenced Files
F89327154: D43587.id.diff
Fri, Jul 26, 5:08 PM
Unknown Object (File)
Tue, Jul 16, 7:01 PM
Unknown Object (File)
Mon, Jul 15, 2:56 PM
Unknown Object (File)
Mon, Jul 8, 3:28 AM
Unknown Object (File)
Sat, Jun 29, 1:02 AM
Unknown Object (File)
May 14 2024, 3:06 PM
Unknown Object (File)
May 13 2024, 4:08 AM
Unknown Object (File)
May 11 2024, 2:52 AM
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.