Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 12 Apr 2023 15:23:48 GMT
From:      Joseph Mingrone <jrm@FreeBSD.org>
To:        ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-branches@FreeBSD.org
Subject:   git: e33e3d31a36c - 2023Q2 - sysutils/cpu-x: flavorize the port (by popular demand)
Message-ID:  <202304121523.33CFNmaJ084738@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch 2023Q2 has been updated by jrm:

URL: https://cgit.FreeBSD.org/ports/commit/?id=e33e3d31a36ce32d982cd5c380c02fea8947b624

commit e33e3d31a36ce32d982cd5c380c02fea8947b624
Author:     Alexey Dokuchaev <danfe@FreeBSD.org>
AuthorDate: 2023-04-05 19:02:36 +0000
Commit:     Joseph Mingrone <jrm@FreeBSD.org>
CommitDate: 2023-04-12 15:23:04 +0000

    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)
---
 sysutils/cpu-x/Makefile | 25 +++++++++++++++++--------
 1 file 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}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202304121523.33CFNmaJ084738>