aboutsummaryrefslogtreecommitdiff
path: root/Mk/Uses
diff options
context:
space:
mode:
authorAdriaan de Groot <adridg@FreeBSD.org>2021-02-13 21:12:23 +0000
committerAdriaan de Groot <adridg@FreeBSD.org>2021-02-13 21:12:23 +0000
commit31950a30cd8dae21a88d5a9756fca7a79b718c46 (patch)
tree2431c8629f0af058b13d09f94ee99d1ada02fe01 /Mk/Uses
parent15cb7f5f37b8147b704d8ea38d092266b729e97b (diff)
downloadports-31950a30cd8dae21a88d5a9756fca7a79b718c46.tar.gz
ports-31950a30cd8dae21a88d5a9756fca7a79b718c46.zip
Add KDE_INVENT convenience for KDE ports
KDE has its own GitLab instance. This behaves slightly different from other GitLab -- there's not really a "GL_ACCOUNT" involved, although the repositories are filed under various categories that behave like accounts do on GitLab.com. Some -- not many -- ports of KDE software pick up unreleased software, or software in-between releases. Those tend to use the GitHub mirror. That mirror should not be considered a good source for the software; it's better to stick close to the real source. With KDE_INVENT it is immediately clear that a port comes from KDE sources, but not released work. It is a shortcut for setting GL_ values for site, account (category) etc. While there's only a handful of ports now that would need it (and we would prefer to **not** package unreleased software) the "signal value" is a good one. Reviewed by: tcberner
Notes
Notes: svn path=/head/; revision=565178
Diffstat (limited to 'Mk/Uses')
-rw-r--r--Mk/Uses/kde.mk44
1 files changed, 44 insertions, 0 deletions
diff --git a/Mk/Uses/kde.mk b/Mk/Uses/kde.mk
index 13df491a7584..a51baf31889d 100644
--- a/Mk/Uses/kde.mk
+++ b/Mk/Uses/kde.mk
@@ -25,6 +25,24 @@
# this will then set default values for MASTER_SITES and DIST_SUBDIR
# as well as CPE_VENDOR and LICENSE.
#
+# KDE_INVENT If the port does not have a regular release, and should
+# be fetched from KDE Invent (a GitLab instance) it can set
+# KDE_INVENT to 3 space-separated values:
+# * a full 40-character commit hash
+# * a category name inside KDE Invent
+# * a repository name inside KDE Invent
+# Default values for category and name are:
+# * the first item in CATEGORIES that is not "kde"; this
+# is useful when the FreeBSD ports category and the KDE
+# category are the same (which happens sometimes)
+# * PORTNAME, often the FreeBSD port name is the same
+# as the upstream name and it will not need to be specified.
+# Sometimes `KDE_INVENT=<hash>` will do and often
+# `KDE_INVENT=<hash> <category>` is enough.
+#
+# Setting KDE_INVENT is the equivalent of a handful of USE_GITLAB
+# and related settings.
+#
# MAINTAINER: kde@FreeBSD.org
.if !defined(_INCLUDE_USES_KDE_MK)
@@ -92,6 +110,32 @@ IGNORE?= cannot be installed: multiple kde-<...> categories specified via CATEGO
. endif
. endfor
+# Doing source-selection if the sources are on KDE invent
+. if defined(KDE_INVENT)
+_invent_hash= ${KDE_INVENT:[1]}
+_invent_category= ${KDE_INVENT:[2]}
+_invent_name= ${KDE_INVENT:[3]}
+
+# Fill in default values if bits are missing
+. if empty(_invent_category)
+_invent_category= ${CATEGORIES:Nkde:[1]}
+. endif
+. if empty(_invent_name)
+_invent_name= ${PORTNAME}
+. endif
+
+# If valid, use it for GitLab
+. if empty(_invent_hash) || empty(_invent_category) || empty(_invent_name)
+IGNORE?= invalid KDE_INVENT value '${KDE_INVENT}'
+. else
+USE_GITLAB= yes
+GL_SITE= https://invent.kde.org
+GL_ACCOUNT= ${_invent_category}
+GL_PROJECT= ${_invent_name}
+GL_COMMIT= ${_invent_hash}
+. endif
+. endif
+
. if defined(_KDE_CATEGORY)
# KDE is normally licensed under the LGPL 2.0.
LICENSE?= LGPL20