On Sat, 17 Oct 2026 11:59:28 +0200
Marc Espie <[email protected]> wrote:

> On Fri, Oct 16, 2026 at 11:37:12PM -0700, Thomas Frohwein wrote:
> > On Mon, 5 Oct 2026 16:42:56 +0100
> > Stuart Henderson <[email protected]> wrote:
> >   
> > > On 2026/10/05 05:24, Thomas Frohwein wrote:  
> > > > - devel/jj-gh: non-standard GH tagnames (jj-gh-v0.3.1);
> > > > therefore justifiable to require this to set WRKDIST manually.
> > > > (There may be a smarter regex for *_TAG_MOD.github that can
> > > > avoid this.)    
> > >   
> > > > ok?    
> > > 
> > > this is not an unusual naming format - while it's uncommon for
> > > DIST_TUPLE you'll find 30-40 or so if you look at ports with
> > > GH_TAGNAME so would be good to handle it sooner rather than later
> > > (setting WRKDIST=${WRKDIR}/${DISTNAME} by hand isn't something
> > > that easily comes to mind..)  
> > 
> > It took a bigger rewrite and some testing to arrive at what now
> > avoids the previous simplification that led to the regression with
> > jj-gh and others with a TAGNAME like abc-v0.1.2. Diff below, and
> > ports that need patches to deal with the changes (for good reasons)
> > attached.
> > 
> > Reminder about the rationale for update: lack of DIST_TUPLE
> > flexibility is leading to an increasing number of workarounds in
> > dist-tuple.port.mk and individual ports. Examples include custom
> > MODDIST-TUPLE_post-extract for codeberg so far (and videolan has
> > been proposed), and a significant number of DIST_TUPLE users having
> > to set WRKDIST to make up for the limitations.
> > Ideally, DIST_TUPLE will arrive at: 1) all configuration for
> > upstream sites is done in the variables in db/dist-tuple.pattern,
> > and 2) no workarounds are needed in individual ports for the
> > pertinent variables like DISTNAME or WRKDIST.
> > 
> > The main thing to know for those who want to add new sites/templates
> > into dist-tuple.pattern is that
> > TEMPLATE_EXTRACT_DIR.${template}.{hash or tag} tell
> > dist-tuple.port.mk what directory the upstream distfile extracts to
> > (relative path). Here, '<mod_id>' can be used in combination with
> > setting ID_MOD.${template}.{hash or tag} which is the 'id' part of
> > DIST_TUPLE (4th element of the DIST_TUPLE string) modified by the
> > pertinent ID_MOD.x.y. This way, the flaw of the previous version
> > that such modification was applied to the whole string for WRKDIST
> > is now avoided.
> > 
> > As a result, workarounds for codeberg (custom
> > MODDIST-TUPLE_post-extract and setting WRKDIST) are not needed
> > anymore.
> > 
> > This diff also fixes the issue with having to set WKRDIST in case of
> > gitlab with commit hashes (raised by ian in [1]). If/when the
> > update in this or a future version goes in, we should weed out the
> > then unnecessary WRKDIST lines.
> > 
> > I can comment on the internals of the new dist-tuple.port.mk
> > structure upon request. There may be opportunities to refine a few
> > things, like that there is quite a bit of duplication between the #
> > tag mode and # hash mode sections that I couldn't find a way to
> > improve sanely.
> > 
> > I ran this diff with the attached patches through a complete bulk
> > build and no errors attributable to this. Rationale for the diffs
> > with some explanation why I think they are a necessary step now
> > below in response to sthen's useful WRKDIST before-after comparison.
> > 
> > ok?  
> 
> 
> Please also write the corresponding man page snippet documenting the
> new TEMPLATE_EXTRACT_DIR variable.
> 
> And what needs to be user-visible in there.
> 
> Either your feature is good and it will be obvious, or you'll find
> that while trying to explain it in a manpage, it can use some love.

Something like this?

Index: bsd.port.mk.5
===================================================================
RCS file: /cvs/src/share/man/man5/bsd.port.mk.5,v
diff -u -p -r1.656 bsd.port.mk.5
--- bsd.port.mk.5       14 Sep 2026 00:17:01 -0000      1.656
+++ bsd.port.mk.5       17 Oct 2026 15:10:42 -0000
@@ -1709,8 +1709,35 @@ entries can be added as needed
 The components are used to build
 .Ev SITES.name
 .Ev DISTFILES.name
-and (optionally)
+and
+.Pq optionally
 .Ev HOMEPAGE .
+.Pp
+For each template,
+.Ev DIST_TUPLE
+needs information on the directory that is extracted from the distfile.
+If the default
+.Po an empirical best-guess combination of 
+.Ar project
+and
+.Ar commithash
+or a modified
+.Ar tagname
+.Pc
+doesn't match,
+.Ev TEMPLATE_EXTRACT_DIR.<name>.tag
+and
+.Ev TEMPLATE_EXTRACT_DIR.<name>.hash
+must be set in
+.Pa ${PORTSDIR}/infrastructure/db/dist-tuple.pattern
+to define the components of the directory name correctly.
+.Ar <mod_id>
+can be used here, which converts to
+.Ar tagname/commithash ,
+modified by the corresponding
+.Ev ID_MOD.<name>.tag
+or
+.Ev ID_MOD.<name>.hash .
 .Pp
 At the end of
 .Cm post-extract ,

Reply via email to