aboutsummaryrefslogtreecommitdiffstats
path: root/Mk
diff options
context:
space:
mode:
authortcberner <tcberner@FreeBSD.org>2016-10-19 01:22:35 +0800
committertcberner <tcberner@FreeBSD.org>2016-10-19 01:22:35 +0800
commit9e1cd6c1fb71e1135cbf968c5ac18e67d9ec7082 (patch)
tree81e0de1cf21ddaecde85001eb3dcccbb81d0b7b0 /Mk
parent1446b2e51625a1f9a1eeffb5848c4003eeceb822 (diff)
downloadfreebsd-ports-gnome-9e1cd6c1fb71e1135cbf968c5ac18e67d9ec7082.tar.gz
freebsd-ports-gnome-9e1cd6c1fb71e1135cbf968c5ac18e67d9ec7082.tar.zst
freebsd-ports-gnome-9e1cd6c1fb71e1135cbf968c5ac18e67d9ec7082.zip
Introduce new extensible virtual categories for KDE
A lot of KDE Ports share MASTERSITES, LICENSE and so one, as they are released as a bundle upstream, however, there was not really a clean way to share this information. Using these new categories, we can simplify the Makefiles for the diverse KDE ports. At the moment we support the virtual category * kde-kde4 In the future, this will be extended to * kde-frameworks * kde-plasma * kde-applications PR: 213406 Differential Revision: https://reviews.freebsd.org/D7645 Exp-run by : antoine Reviewed by: mat, rakuco Approved by: portmgr (mat), rakuco (mentor)
Diffstat (limited to 'Mk')
-rw-r--r--Mk/Uses/kde.mk40
-rw-r--r--Mk/bsd.port.mk2
2 files changed, 41 insertions, 1 deletions
diff --git a/Mk/Uses/kde.mk b/Mk/Uses/kde.mk
index 0371e1717e1d..dd81a08d12f9 100644
--- a/Mk/Uses/kde.mk
+++ b/Mk/Uses/kde.mk
@@ -16,6 +16,14 @@
# * foo_run Add a run-time dependency (RUN_DEPENDS)
# * foo (default) Add both dependencies on component <foo>
#
+#
+# To simplify the ports, also:
+# CATEGORIES If the port is part of one of the KDE Software distribution,
+# it can add, in addition to 'kde' one of the following:
+# kde-kde4: part of kde4 release
+# this will then set default values for MASTER_SITES and DIST_SUBDIR
+# as well as CPE_VENDOR and LICENSE.
+#
# MAINTAINER: kde@FreeBSD.org
.if !defined(_INCLUDE_USES_KDE_MK)
@@ -72,6 +80,38 @@ KTP_BRANCH?= stable
KDE_PREFIX= ${LOCALBASE}
# ==============================================================================
+# === _KDE_DIST HANDLING -- SETTING DEFAULT VALUES =============================
+# Doing MASTER_SITES magic based on the category of the port
+_KDE_CATEGORIES_SUPPORTED= kde-kde4
+. for cat in ${_KDE_CATEGORIES_SUPPORTED}
+. if ${CATEGORIES:M${cat}}
+. if !defined(_KDE_CATEGORY)
+_KDE_CATEGORY= ${cat}
+. else
+IGNORE?= cannot be installed: multiple kde-<...> categories specified via CATEGORIES=${CATEGORIES} #'
+. endif
+. endif
+. endfor
+
+. if defined(_KDE_CATEGORY)
+# KDE is normally licencensed LGPL 2.0.
+LICENSE?= LGPL20
+
+# Set CPE Vendor Information
+# As KDE_DIST is set we can assume it is port release by KDE and the vendor
+# is therefore kde.
+CPE_VENDOR?= kde
+
+. if ${_KDE_CATEGORY:Mkde-kde4}
+PORTVERSION?= ${KDE4_VERSION}
+MASTER_SITES?= KDE/${KDE4_BRANCH}/${KDE4_VERSION}/src
+DIST_SUBDIR?= KDE/${KDE4_VERSION}
+. else
+IGNORE?= unknown CATEGORY value '${_KDE_CATEGORY}' #'
+. endif
+. endif #defined(_KDE_CATEGORY)
+# ==============================================================================
+
# ==== SETUP CMAKE ENVIRONMENT =================================================
# Help cmake to find files when testing ports with non-default PREFIX.
CMAKE_ARGS+= -DCMAKE_PREFIX_PATH="${LOCALBASE}"
diff --git a/Mk/bsd.port.mk b/Mk/bsd.port.mk
index d7384b713e35..c5f7bf75c21b 100644
--- a/Mk/bsd.port.mk
+++ b/Mk/bsd.port.mk
@@ -2439,7 +2439,7 @@ VALID_CATEGORIES+= accessibility afterstep arabic archivers astro audio \
benchmarks biology cad chinese comms converters databases \
deskutils devel docs dns editors elisp emulators enlightenment finance french ftp \
games geography german gnome gnustep graphics hamradio haskell hebrew hungarian \
- ipv6 irc japanese java kde kld korean lang linux lisp \
+ ipv6 irc japanese java kde ${_KDE_CATEGORIES_SUPPORTED} kld korean lang linux lisp \
mail mate math mbone misc multimedia net net-im net-mgmt net-p2p news \
palm parallel pear perl5 plan9 polish portuguese ports-mgmt \
print python ruby rubygems russian \