git: c7e31ef1e136 - main - misc/chatgpt-shell-cli: Add nox11 flavor

From: Nicola Vitale <nivit_at_FreeBSD.org>
Date: Sat, 10 Jun 2023 16:07:16 UTC
The branch main has been updated by nivit:

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

commit c7e31ef1e136646f3919865af7ebba40ad8cb7e7
Author:     Jimmy Olgeni <olgeni@FreeBSD.org>
AuthorDate: 2023-06-04 15:28:08 +0000
Commit:     Nicola Vitale <nivit@FreeBSD.org>
CommitDate: 2023-06-10 18:02:50 +0000

    misc/chatgpt-shell-cli: Add nox11 flavor
    
    Add nox11 flavor, so that it can be installed/used on headless servers.
    
    PR:             271880
    Reported by:    olgeni
---
 misc/chatgpt-shell-cli/Makefile | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/misc/chatgpt-shell-cli/Makefile b/misc/chatgpt-shell-cli/Makefile
index e0f10b1190a4..a22104f71249 100644
--- a/misc/chatgpt-shell-cli/Makefile
+++ b/misc/chatgpt-shell-cli/Makefile
@@ -15,7 +15,12 @@ RUN_DEPENDS=	bash:shells/bash \
 		jq:textproc/jq \
 		xdg-open:devel/xdg-utils
 
-USES=		magick:run shebangfix
+FLAVORS=	x11 nox11
+FLAVOR?=	${FLAVORS:[1]}
+
+nox11_PKGNAMESUFFIX=	-nox11
+
+USES=		magick:${FLAVOR},run shebangfix
 
 USE_GITHUB=	yes
 GH_ACCOUNT=	0xacx
@@ -30,7 +35,7 @@ NO_BUILD=	yes
 PLIST_FILES=	bin/chatgpt
 
 post-patch:
-		  ${REINPLACE_CMD} 's/open \("$${image_url}"\)/xdg-open \1/g' ${WRKSRC}/chatgpt.sh
+		${REINPLACE_CMD} 's/open \("$${image_url}"\)/xdg-open \1/g' ${WRKSRC}/chatgpt.sh
 
 do-install:
 		${INSTALL_SCRIPT} ${WRKSRC}/chatgpt.sh ${STAGEDIR}${PREFIX}/bin/chatgpt