Extra repos in subdirs

Pulling in other GitHub repos in subdirs

Some programs need plugins etc that are developed in separate repositories. graphics/nomacs is an example of this: it wants the nomacs-plugins repository to be cloned into nomacs/ImageLounge/plugins/.

The simple solution

This is how to do it: GH_TUPLE

In this case, the plugins are offered as an OPTION. The tuple is therefore enabled by the PLUGINS option.

PLUGINS_GH_TUPLE=       nomacs:nomacs-plugins:3.14:plugins/ImageLounge/plugins

The syntax is as follows (spaces added for clarity, do not use spaces in production):

nomacs :nomacs-plugins:3.14:plugins/ImageLounge/plugins
account:project       :tag :group  /subdir

Note that the group identifier looks like it's a part of the subdir, but it is not.

PR 245110 has been filed to get this clarified in Porter's Handbook.

Another example

CodeLite is slightly more comprehensive example. It expects a couple sub-repositories to be present in specific directories:

eranif/ctags in ctags/
eranif/dbgd in wxdap/

CodeLite itself is already defined in PORTNAME, so only the "extra" repos are defined in GH_TUPLE:

USE_GITHUB=	yes
GH_ACCOUNT=	eranif
GH_TUPLE=	eranif:ctags:p6.0.20230108.0:ctags/ctags \
		eranif:dbgd:f8f7afa:wxdap/wxdap

The work dir will have the following subdirs containing the submodules:

% ls -l /usr/ports/editors/codelite/work/codelite-17.0.0/
(...)
drwxr-xr-x  21 nobody  wheel   2624 Feb 11 15:03 ctags
drwxr-xr-x   5 nobody  wheel    704 Feb 11 15:03 wxdap