diff options
author | Alexey Dokuchaev <danfe@FreeBSD.org> | 2023-04-05 19:02:36 +0000 |
---|---|---|
committer | Alexey Dokuchaev <danfe@FreeBSD.org> | 2023-04-05 19:02:36 +0000 |
commit | b0a0b0d7211d557fd8242ca38877e5ce4db97306 (patch) | |
tree | 8b2db93350c11ec69228090498e9a6608e6f05ea | |
parent | ecc484c2c9dd7ab839696092dfc66e78a2e295c8 (diff) | |
download | ports-b0a0b0d7211d557fd8242ca38877e5ce4db97306.tar.gz ports-b0a0b0d7211d557fd8242ca38877e5ce4db97306.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.
-rw-r--r-- | sysutils/cpu-x/Makefile | 25 |
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} |