aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexey Dokuchaev <danfe@FreeBSD.org>2023-04-05 19:02:36 +0000
committerJoseph Mingrone <jrm@FreeBSD.org>2023-04-12 15:23:04 +0000
commite33e3d31a36ce32d982cd5c380c02fea8947b624 (patch)
tree3d0b9c68ba8d091dbd593fd935dcbfa88b560e6e
parent25f8a2358ac02feae90463fc2042eea4157b1d4a (diff)
downloadports-e33e3d31a36ce32d982cd5c380c02fea8947b624.tar.gz
ports-e33e3d31a36ce32d982cd5c380c02fea8947b624.zip
sysutils/cpu-x: flavorize the port (by popular demand)
CPU-X can be used in graphic mode with GTK+3, or in text-based mode with ncurses, subject to build-time configuration. Previously this was controlled via options, but since graphic mode was the default, users who preferred ncurses (console) version had to reconfigure the port and build their own package, which was inconvenient. Now with flavors, everyone should be happy. Requested by: marck et al. (cherry picked from commit b0a0b0d7211d557fd8242ca38877e5ce4db97306)
-rw-r--r--sysutils/cpu-x/Makefile25
1 files changed, 17 insertions, 8 deletions
diff --git a/sysutils/cpu-x/Makefile b/sysutils/cpu-x/Makefile
index 70041938b6cd..b3ebda4e8be3 100644
--- a/sysutils/cpu-x/Makefile
+++ b/sysutils/cpu-x/Makefile
@@ -2,6 +2,7 @@ PORTNAME= cpu-x
PORTVERSION= 4.5.3
DISTVERSIONPREFIX= v
CATEGORIES= sysutils
+PKGNAMESUFFIX= -${FLAVOR}
MAINTAINER= danfe@FreeBSD.org
COMMENT= Gathers information about CPU, motherboard, and more
@@ -14,7 +15,7 @@ LIB_DEPENDS= libcpuid.so:sysutils/libcpuid \
libpci.so:devel/libpci \
libstatgrab.so:devel/libstatgrab
-USES= cmake ncurses pkgconfig
+USES= cmake pkgconfig
USE_GITHUB= yes
GH_ACCOUNT= TheTumultuousUnicornOfDarkness
GH_PROJECT= ${PORTNAME:tu}
@@ -22,18 +23,26 @@ CMAKE_OFF= WITH_LIBGLFW WITH_VULKAN WITH_OPENCL
PORTDOCS= ChangeLog.md README.md
-OPTIONS_DEFINE= DOCS NLS X11
-OPTIONS_DEFAULT= X11
+OPTIONS_DEFINE= DOCS NLS
OPTIONS_SUB= yes
NLS_USES= gettext
NLS_CMAKE_OFF= -DWITH_GETTEXT:BOOL=OFF
-X11_DESC= Build GTK+3 frontend in addition to ncurses one
-X11_USES= gnome
-X11_USE= GNOME=gtk30
-X11_CMAKE_OFF= -DWITH_GTK:BOOL=OFF
-X11_VARS= GLIB_SCHEMAS=org.cpu-x.gschema.xml
+FLAVORS= gtk3 ncurses
+
+CONFLICTS_INSTALL= ${FLAVORS:N${FLAVOR}:S/^/${PORTNAME}-/}
+
+.if ${FLAVOR:U} == ncurses
+USES+= ncurses
+CMAKE_ARGS+= -DWITH_GTK:BOOL=OFF
+PLIST_SUB+= X11="@comment "
+.else
+USES+= gnome
+USE_GNOME= gtk30
+GLIB_SCHEMAS= org.cpu-x.gschema.xml
+PLIST_SUB+= X11=""
+.endif
post-install-DOCS-on:
@${MKDIR} ${STAGEDIR}${DOCSDIR}