On 2023/11/13 14:57:39 +0100, Stefan Hagen <sh+openbsd-po...@codevoid.de> wrote:
> Omar Polo wrote (2023-11-13 14:08 CET):
> > On 2023/11/13 13:49:03 +0100, Stefan Hagen <sh+openbsd-po...@codevoid.de> 
> > wrote:
> > > Hi,
> > > 
> > > DIST_TUPLE did not yet make it into the Makefile.template.
> > > 
> > > OK to add it under the GH_ parts?
> > 
> > why not replacing GH_* completely with this in the template?  There is
> > still stuff that explicitly depends on GH_*?  (except go.port.mk)
> 
> If there's no case left for GH_, I'm not against removing it.

to be clear: I wasn't suggesting to nuke GH_*, just that the Makefile
template could mention only one method, and DIST_TUPLE is IMHO the one
to suggest now.

> Index: infrastructure/templates/Makefile.template
> ===================================================================
> RCS file: /cvs/ports/infrastructure/templates/Makefile.template,v
> diff -u -p -u -p -r1.99 Makefile.template
> --- infrastructure/templates/Makefile.template        15 Oct 2023 11:22:01 
> -0000      1.99
> +++ infrastructure/templates/Makefile.template        13 Nov 2023 13:56:55 
> -0000
> @@ -38,15 +38,15 @@ DISTNAME =        ???
>  #
>  # github:
>  # /releases/ -> preferred. ignore GH_*, just use SITES and DISTNAME.

here it still references GH_* directly, not that's bad, but I'd take the
chance to generalize a bit this paragraph and providing a note that can
be used to quickly fetch stuff from various forges.

> -# /archive/ ->  GH_ACCOUNT and GH_PROJECT, plus either GH_TAGNAME or 
> GH_COMMIT.
> +# /archive/ ->  use DIST_TUPLE as described below.
> [...]

Here's what I had in mind.  it needs better wording but haven't come up
with something better yet.  Neither "forgename" nor "name" (nor "forge")
convey the meaning of "just put github/codeberg/gitlab/... here".

Index: Makefile.template
===================================================================
RCS file: /home/cvs/ports/infrastructure/templates/Makefile.template,v
diff -u -p -r1.99 Makefile.template
--- Makefile.template   15 Oct 2023 11:22:01 -0000      1.99
+++ Makefile.template   13 Nov 2023 17:01:29 -0000
@@ -35,18 +35,11 @@ DISTNAME =  ???
 #PKGNAME =     ???
 #PKGNAME-foo = ???     for multi packages
 
+# For web forges (github, codeberg, ...) if there's a static tarball
+# available (preferred) just use SITES and DISTNAME, otherwise
+# DIST_TUPLE, in which case DISTNAME is not generally needed.
 #
-# github:
-# /releases/ -> preferred. ignore GH_*, just use SITES and DISTNAME.
-# /archive/ ->  GH_ACCOUNT and GH_PROJECT, plus either GH_TAGNAME or GH_COMMIT.
-#
-# set DISTNAME if using GH_COMMIT, or if using GH_TAGNAME and the tag is not in
-# the format "v1.00" or "1.00".
-#
-#GH_ACCOUNT =  username
-#GH_PROJECT =  project
-#GH_TAGNAME =  1.0
-#GH_COMMIT =   abab123456789abacafeabab123123b1e4ble4bl
+#DIST_TUPLE =  forgename account project tagname/commitid .
 
 # for any port that creates shared libraries.
 # both libtool and cmake automatically set filenames based on this variable.

Reply via email to