Page MenuHomeFreeBSD

Mk/bsd.port.mk: Add ability to install subpackages
Needs ReviewPublic

Authored by pizzamig on Feb 8 2024, 9:43 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Apr 8, 10:33 PM
Unknown Object (File)
Sat, Apr 6, 4:34 AM
Unknown Object (File)
Mon, Mar 25, 10:39 PM
Unknown Object (File)
Feb 26 2024, 5:43 AM
Unknown Object (File)
Feb 17 2024, 6:47 AM
Unknown Object (File)
Feb 12 2024, 2:24 PM
Unknown Object (File)
Feb 9 2024, 4:49 PM
Unknown Object (File)
Feb 9 2024, 4:49 PM

Details

Reviewers
None
Group Reviewers
portmgr
Summary

Subpackages is a feature focused on packages.
However, port builders lack the ability to install portion of a port,
causing a very different behavior.
With this patch we add the ability to install only subpackages
specificed by the TARGET_SUBPACKAGES variable.
This variable is going to contain a comma separated list of subpackages.
If the variable is missing, all subpackages are installed
The variable works for install and reinstall targets.
The deinstall targets keep the previous behavior, removing the whole port.

Diff Detail

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

Event Timeline

pizzamig created this revision.

This is the "install" part only. Is this review also supposed to get the dependency part for this to work (e.g. a port depending on only a subpackage and the recursive dependency tracking and install needs to set TARGET_SUBPACKAGE), or is the dependency part supposed to come / available in another review?

Mk/bsd.port.mk
4872
  • Would it make sense to convert the variable name TARGET_SUBPACAKGE to plural?
  • May it be beneficial / more easy for code which wants to use this, to have TARGET_SUBPACAKGE(S) be a comma separated list instead of a space separated list?
arrowd added inline comments.
Mk/bsd.port.mk
4884

I'm not quite sure why _DEPPKGS is needed at all. To ensure the order in which subpackages are installed in case of interdependencies?
But then the previous version of this code doesn't care about it.

  • Use a comma separated list of subpkg
  • Add documentation for TARGET_SUBPACKAGES variable
Mk/bsd.port.mk
4884

There is a target per subpackage. Subpackages can have other subpackages as dependencies.
_DEPPKGS is the way to ensure that dependencies are installed as well

Mk/bsd.port.mk
4872

Good points.
Update the patch with your suggestions

Running make -C audio/alsa-plugins/ -V _IPKGS TARGET_SUBPACKAGES=, results in emptiness. Not sure if this is a bug, though, but probably should be fixed for POLA sake.

If some subpackages have been disabled via options, should we force to build them anyway if they are listed in TARGET_SUBPACKAGES? What if other ports rely on particular subpackage?