Enable automatic setting of WRKDIST if DIST_TUPLE is used. After the

previous attempt last fall led to breakage, this is now fixed and has
survived a bulk kindly tested by tb@. It is based on how GitHub
packages its tarballs. If needed, heuristics for other sources like
gitlab, srht can be added later through the same mechanism.

This makes lines in DIST_TUPLE (github) ports like the following
superfluous:

WRKDIST = ${WRKDIR}/project-${COMMIT_HASH}
This commit is contained in:
thfr
2024-02-29 21:20:51 +00:00
parent 2ad186e15f
commit 691c247714
2 changed files with 8 additions and 6 deletions
+6 -4
View File
@@ -1,6 +1,6 @@
#-*- mode: Makefile; tab-width: 4; -*-
# ex:ts=4 sw=4 filetype=make:
# $OpenBSD: bsd.port.mk,v 1.1637 2024/01/09 11:58:11 sthen Exp $
# $OpenBSD: bsd.port.mk,v 1.1638 2024/02/29 21:20:51 thfr Exp $
#
# bsd.port.mk - 940820 Jordan K. Hubbard.
# This file is in the public domain.
@@ -894,10 +894,12 @@ _WRKDIRS += ${WRKOBJDIR_MFS}/${_WRKDIR_STEM}
WRKDIST ?= ${WRKDIR}/${GH_PROJECT}-${GH_TAGNAME:C/^[vV]([0-9])/\1/}
.elif !empty(GH_COMMIT)
WRKDIST ?= ${WRKDIR}/${GH_PROJECT}-${GH_COMMIT}
.elif !defined(DISTNAME)
WRKDIST ?= ${WRKDIR}
.else
.elif defined(DISTNAME)
WRKDIST ?= ${WRKDIR}/${DISTNAME}
.elif !empty(_DT_WRKDIST)
WRKDIST ?= ${_DT_WRKDIST}
.else
WRKDIST ?= ${WRKDIR}
.endif
WRKSRC ?= ${WRKDIST}
+2 -2
View File
@@ -29,9 +29,9 @@ _subdir =
# set DISTNAME if not done by the port and add refs/tags/ subdir
DISTNAME ?= ${_project}-${_id:C/^(v|V|ver|[Rr]el|[Rr]elease)[-._]?([0-9])/\2/}
_subdir = refs/tags/
#WRKDIST ?= ${WRKDIR}/${_project}-${_id:C/^(v|V|ver|[Rr]el|[Rr]elease)[-._]?([0-9])/\2/}
_DT_WRKDIST ?= ${WRKDIR}/${_project}-${_id:C/^(v|V|ver|[Rr]el|[Rr]elease)[-._]?([0-9])/\2/}
. else
#WRKDIST ?= ${WRKDIR}/${_project}-${_id}
_DT_WRKDIST ?= ${WRKDIR}/${_project:C,^.*/,,}-${_id}
. endif
. for _subst in S,<account>,${_account},g:S,<project>,${_project},g:S,<id>,${_id},g:S,<subdir>,${_subdir},g:S,<site>,${SITES.${_template}},g