Index | Thread | Search

From:
Thomas Frohwein <tfrohwein@fastmail.com>
Subject:
DIST_TUPLE fix for project string with subdir
To:
ports@openbsd.org
Cc:
Rafael Sadowski <rafael@sizeofvoid.org>
Date:
Wed, 7 Feb 2024 23:40:59 -0500

Download raw body.

Thread
Hi,

DIST_TUPLE can be used for projects with more levels of hierarchy than
single directories for account and project by using '/' in the project
value. This is currently only done by qt5 ports, for example qtbase as
shown here in the sqlports DistTuple table:

FullPkgPath|Project
x11/qt5/qtbase|qt/qtbase

Rafael has run into problems using this in combination with git
submodules because in its current state, DIST_TUPLE takes the
unmodified Project string as heuristic for the location of the
extracted files, including a directory 'qt/' in this example. This
doesn't match how qt5 software is distributed (and likely also in
other contexts). The correct path to the files is relatively
straightforward: just remove any directories. The diff below takes care
of this.

I've looked through sqlports for DIST_TUPLE with '/' and it's only qt5
ports. No ports have weirder things like multiple '/'. The risk of this
breaking something unintentionally is very low in light of this. I've
built and packaged x11/qt5/qtbase and also a few other DIST_TUPLE ports
without a '/' in the project string and no breakage observed. Rafael
reports success with his qt5 submodule draft if this diff is applied.

ok?

Index: dist-tuple.port.mk
===================================================================
RCS file: /cvs/ports/infrastructure/mk/dist-tuple.port.mk,v
retrieving revision 1.15
diff -u -p -r1.15 dist-tuple.port.mk
--- dist-tuple.port.mk	6 Nov 2023 07:02:08 -0000	1.15
+++ dist-tuple.port.mk	4 Feb 2024 18:32:53 -0000
@@ -45,7 +45,7 @@ HOMEPAGE ?=	${TEMPLATE_HOMEPAGE.${_templ
 MODDIST-TUPLE_post-extract += \
 	t=${WRKDIST}/${_targetdir}; [[ -d $$t ]] && rmdir $$t \
 	|| mkdir -p `dirname $$t` ; \
-	mv ${WRKDIR}/${_project}-${_id:S/refs\/tags\///:S/^v//} $$t;
+	mv ${WRKDIR}/${_project:C,^.*/,,}-${_id:S/refs\/tags\///:S/^v//} $$t;
 .      endif
 .    endfor