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)
Fri, May 3, 12:03 PM
Unknown Object (File)
Apr 27 2024, 8:48 AM
Unknown Object (File)
Apr 27 2024, 7:52 AM
Unknown Object (File)
Apr 27 2024, 7:52 AM
Unknown Object (File)
Apr 27 2024, 6:15 AM
Unknown Object (File)
Apr 27 2024, 12:01 AM
Unknown Object (File)
Apr 22 2024, 9:34 PM
Unknown Object (File)
Apr 22 2024, 3:23 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?