git: a58264f05f67 - main - x11-toolkits/wxgtk31: add non-default, webkit-less gtk2 flavor

From: Alexey Dokuchaev <danfe_at_FreeBSD.org>
Date: Wed, 08 Jun 2022 08:29:48 UTC
The branch main has been updated by danfe:

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

commit a58264f05f6792fa7b5c2c930b0661202f8de737
Author:     Alexey Dokuchaev <danfe@FreeBSD.org>
AuthorDate: 2022-06-08 08:29:06 +0000
Commit:     Alexey Dokuchaev <danfe@FreeBSD.org>
CommitDate: 2022-06-08 08:29:06 +0000

    x11-toolkits/wxgtk31: add non-default, webkit-less gtk2 flavor
    
    This follows similar commit b7cbb62f6ab6 in `x11-toolkits/wxgtk30'
    to allow widget-heavy graphical software, e.g. various CADs, offer
    more fluent, responsive, and overall better user experience.
---
 x11-toolkits/wxgtk31/Makefile  | 33 +++++++++++++---
 x11-toolkits/wxgtk31/pkg-plist | 86 +++++++++++++++++++++---------------------
 2 files changed, 71 insertions(+), 48 deletions(-)

diff --git a/x11-toolkits/wxgtk31/Makefile b/x11-toolkits/wxgtk31/Makefile
index a157185d203c..abf04f3a5a44 100644
--- a/x11-toolkits/wxgtk31/Makefile
+++ b/x11-toolkits/wxgtk31/Makefile
@@ -3,10 +3,10 @@ DISTVERSIONPREFIX=	v
 DISTVERSION=	3.1.5
 PORTREVISION=	2
 CATEGORIES=	x11-toolkits
-PKGNAMESUFFIX=	31-gtk3
+PKGNAMESUFFIX=	${_SHORT_WX_VER}-${FLAVOR}
 
 MAINTAINER=	ports@FreeBSD.org
-COMMENT=	GUI toolkit (wxWidgets) with GTK+ bindings
+COMMENT=	GUI toolkit (wxWidgets) with ${FLAVOR:S/k/&+/:tu} bindings
 
 LICENSE=	GPLv2+
 LICENSE_FILE=	${WRKSRC}/docs/gpl.txt
@@ -15,6 +15,7 @@ LIB_DEPENDS=	libcurl.so:ftp/curl \
 		libexpat.so:textproc/expat2 \
 		libfontconfig.so:x11-fonts/fontconfig \
 		libfreetype.so:print/freetype2 \
+		libharfbuzz.so:print/harfbuzz \
 		libjbig.so:graphics/jbigkit \
 		libnotify.so:devel/libnotify \
 		libpng.so:graphics/png \
@@ -33,7 +34,7 @@ GH_TUPLE=	wxWidgets:Catch:ee4acb6:wxWidgets_Catch/3rdparty/catch
 GNU_CONFIGURE=	yes
 USE_XORG=	x11 sm xxf86vm xtst
 USE_GL=		gl glu
-USE_GNOME=	cairo gdkpixbuf2 gtk30
+USE_GNOME=	cairo gdkpixbuf2
 USE_LDCONFIG=	yes
 USE_CXXSTD=	c++11
 CONFIGURE_ARGS=	--with-libpng=sys \
@@ -42,7 +43,6 @@ CONFIGURE_ARGS=	--with-libpng=sys \
 		--with-zlib=sys \
 		--with-expat=sys \
 		--with-opengl \
-		--with-gtk=3 \
 		--without-gnomevfs \
 		--disable-epollloop \
 		--disable-joystick \
@@ -57,8 +57,8 @@ CONFIGURE_ARGS=	--with-libpng=sys \
 CONFIGURE_ENV=	X11BASE="${LOCALBASE}" \
 		ac_cv_header_sys_inotify_h=no
 
-OPTIONS_DEFINE=		GSTREAMER MSPACK NLS WEBKIT
-OPTIONS_DEFAULT=	GSTREAMER MSPACK WEBKIT
+OPTIONS_DEFINE=		GSTREAMER MSPACK NLS
+OPTIONS_DEFAULT=	GSTREAMER MSPACK
 MSPACK_DESC=		Microsoft archives support
 OPTIONS_SUB=		yes
 
@@ -74,6 +74,27 @@ MSPACK_LIB_DEPENDS=		libmspack.so:archivers/libmspack
 WEBKIT_CONFIGURE_ENABLE=	webview
 WEBKIT_LIB_DEPENDS=		libwebkit2gtk-4.0.so:www/webkit2-gtk3
 
+FLAVORS=	gtk3 gtk2
+FLAVOR?=	${FLAVORS:[1]}
+
+.if ${FLAVOR} == gtk3
+USE_GNOME+=	gtk30
+CONFIGURE_ARGS+=	--with-gtk=3
+OPTIONS_DEFINE+=	WEBKIT
+OPTIONS_DEFAULT+=	WEBKIT
+PLIST_SUB+=	GTK2="@comment " GTK3=""
+.else
+USE_GNOME+=	gtk20
+CONFIGURE_ARGS+=	--with-gtk
+PLIST_SUB+=	GTK2="" GTK3="@comment " WEBKIT="@comment "
+.endif
+PLIST_SUB+=	GTKVER=${FLAVOR}
+
+_SHORT_WX_VER=	${PORTVERSION:S/./ /g:[1..2]:ts}
+
+gtk3_CONFLICTS_INSTALL=	${PORTNAME}${_SHORT_WX_VER}-gtk2
+gtk2_CONFLICTS_INSTALL=	${PORTNAME}${_SHORT_WX_VER}-gtk3
+
 .include <bsd.port.pre.mk>
 
 # TLS is broken on armv6/7, PR 229396
diff --git a/x11-toolkits/wxgtk31/pkg-plist b/x11-toolkits/wxgtk31/pkg-plist
index 8cb8477f38d4..53c6f30d7a66 100644
--- a/x11-toolkits/wxgtk31/pkg-plist
+++ b/x11-toolkits/wxgtk31/pkg-plist
@@ -1,4 +1,4 @@
-bin/wxgtk3u-3.1-config
+bin/wx%%GTKVER%%u-3.1-config
 bin/wxrc
 bin/wxrc-3.1
 include/wx-3.1/wx/aboutdlg.h
@@ -30,6 +30,7 @@ include/wx-3.1/wx/aui/dockart.h
 include/wx-3.1/wx/aui/floatpane.h
 include/wx-3.1/wx/aui/framemanager.h
 include/wx-3.1/wx/aui/tabart.h
+%%GTK2%%include/wx-3.1/wx/aui/tabartgtk.h
 include/wx-3.1/wx/aui/tabmdi.h
 include/wx-3.1/wx/bannerwindow.h
 include/wx-3.1/wx/base64.h
@@ -185,6 +186,7 @@ include/wx-3.1/wx/generic/dvrenderers.h
 include/wx-3.1/wx/generic/fdrepdlg.h
 include/wx-3.1/wx/generic/filectrlg.h
 include/wx-3.1/wx/generic/filepickerg.h
+%%GTK2%%include/wx-3.1/wx/generic/fontdlgg.h
 include/wx-3.1/wx/generic/fswatcher.h
 include/wx-3.1/wx/generic/grid.h
 include/wx-3.1/wx/generic/gridctrl.h
@@ -591,7 +593,7 @@ include/wx-3.1/wx/unix/evtloopsrc.h
 include/wx-3.1/wx/unix/fontutil.h
 include/wx-3.1/wx/unix/fswatcher_inotify.h
 include/wx-3.1/wx/unix/fswatcher_kqueue.h
-include/wx-3.1/wx/unix/glegl.h
+%%GTK3%%include/wx-3.1/wx/unix/glegl.h
 include/wx-3.1/wx/unix/glx11.h
 include/wx-3.1/wx/unix/joystick.h
 include/wx-3.1/wx/unix/mimetype.h
@@ -735,47 +737,47 @@ lib/libwx_baseu_net-3.1.so.5.0.0
 lib/libwx_baseu_xml-3.1.so
 lib/libwx_baseu_xml-3.1.so.5
 lib/libwx_baseu_xml-3.1.so.5.0.0
-lib/libwx_gtk3u_adv-3.1.so
-lib/libwx_gtk3u_adv-3.1.so.5
-lib/libwx_gtk3u_adv-3.1.so.5.0.0
-lib/libwx_gtk3u_aui-3.1.so
-lib/libwx_gtk3u_aui-3.1.so.5
-lib/libwx_gtk3u_aui-3.1.so.5.0.0
-lib/libwx_gtk3u_core-3.1.so
-lib/libwx_gtk3u_core-3.1.so.5
-lib/libwx_gtk3u_core-3.1.so.5.0.0
-lib/libwx_gtk3u_gl-3.1.so
-lib/libwx_gtk3u_gl-3.1.so.5
-lib/libwx_gtk3u_gl-3.1.so.5.0.0
-lib/libwx_gtk3u_html-3.1.so
-lib/libwx_gtk3u_html-3.1.so.5
-lib/libwx_gtk3u_html-3.1.so.5.0.0
-%%GSTREAMER%%lib/libwx_gtk3u_media-3.1.so
-%%GSTREAMER%%lib/libwx_gtk3u_media-3.1.so.5
-%%GSTREAMER%%lib/libwx_gtk3u_media-3.1.so.5.0.0
-lib/libwx_gtk3u_propgrid-3.1.so
-lib/libwx_gtk3u_propgrid-3.1.so.5
-lib/libwx_gtk3u_propgrid-3.1.so.5.0.0
-lib/libwx_gtk3u_qa-3.1.so
-lib/libwx_gtk3u_qa-3.1.so.5
-lib/libwx_gtk3u_qa-3.1.so.5.0.0
-lib/libwx_gtk3u_ribbon-3.1.so
-lib/libwx_gtk3u_ribbon-3.1.so.5
-lib/libwx_gtk3u_ribbon-3.1.so.5.0.0
-lib/libwx_gtk3u_richtext-3.1.so
-lib/libwx_gtk3u_richtext-3.1.so.5
-lib/libwx_gtk3u_richtext-3.1.so.5.0.0
-lib/libwx_gtk3u_stc-3.1.so
-lib/libwx_gtk3u_stc-3.1.so.5
-lib/libwx_gtk3u_stc-3.1.so.5.0.0
-%%WEBKIT%%lib/libwx_gtk3u_webview-3.1.so
-%%WEBKIT%%lib/libwx_gtk3u_webview-3.1.so.5
-%%WEBKIT%%lib/libwx_gtk3u_webview-3.1.so.5.0.0
-lib/libwx_gtk3u_xrc-3.1.so
-lib/libwx_gtk3u_xrc-3.1.so.5
-lib/libwx_gtk3u_xrc-3.1.so.5.0.0
+lib/libwx_%%GTKVER%%u_adv-3.1.so
+lib/libwx_%%GTKVER%%u_adv-3.1.so.5
+lib/libwx_%%GTKVER%%u_adv-3.1.so.5.0.0
+lib/libwx_%%GTKVER%%u_aui-3.1.so
+lib/libwx_%%GTKVER%%u_aui-3.1.so.5
+lib/libwx_%%GTKVER%%u_aui-3.1.so.5.0.0
+lib/libwx_%%GTKVER%%u_core-3.1.so
+lib/libwx_%%GTKVER%%u_core-3.1.so.5
+lib/libwx_%%GTKVER%%u_core-3.1.so.5.0.0
+lib/libwx_%%GTKVER%%u_gl-3.1.so
+lib/libwx_%%GTKVER%%u_gl-3.1.so.5
+lib/libwx_%%GTKVER%%u_gl-3.1.so.5.0.0
+lib/libwx_%%GTKVER%%u_html-3.1.so
+lib/libwx_%%GTKVER%%u_html-3.1.so.5
+lib/libwx_%%GTKVER%%u_html-3.1.so.5.0.0
+%%GSTREAMER%%lib/libwx_%%GTKVER%%u_media-3.1.so
+%%GSTREAMER%%lib/libwx_%%GTKVER%%u_media-3.1.so.5
+%%GSTREAMER%%lib/libwx_%%GTKVER%%u_media-3.1.so.5.0.0
+lib/libwx_%%GTKVER%%u_propgrid-3.1.so
+lib/libwx_%%GTKVER%%u_propgrid-3.1.so.5
+lib/libwx_%%GTKVER%%u_propgrid-3.1.so.5.0.0
+lib/libwx_%%GTKVER%%u_qa-3.1.so
+lib/libwx_%%GTKVER%%u_qa-3.1.so.5
+lib/libwx_%%GTKVER%%u_qa-3.1.so.5.0.0
+lib/libwx_%%GTKVER%%u_ribbon-3.1.so
+lib/libwx_%%GTKVER%%u_ribbon-3.1.so.5
+lib/libwx_%%GTKVER%%u_ribbon-3.1.so.5.0.0
+lib/libwx_%%GTKVER%%u_richtext-3.1.so
+lib/libwx_%%GTKVER%%u_richtext-3.1.so.5
+lib/libwx_%%GTKVER%%u_richtext-3.1.so.5.0.0
+lib/libwx_%%GTKVER%%u_stc-3.1.so
+lib/libwx_%%GTKVER%%u_stc-3.1.so.5
+lib/libwx_%%GTKVER%%u_stc-3.1.so.5.0.0
+%%WEBKIT%%lib/libwx_%%GTKVER%%u_webview-3.1.so
+%%WEBKIT%%lib/libwx_%%GTKVER%%u_webview-3.1.so.5
+%%WEBKIT%%lib/libwx_%%GTKVER%%u_webview-3.1.so.5.0.0
+lib/libwx_%%GTKVER%%u_xrc-3.1.so
+lib/libwx_%%GTKVER%%u_xrc-3.1.so.5
+lib/libwx_%%GTKVER%%u_xrc-3.1.so.5.0.0
 %%WEBKIT%%lib/wx/3.1.5/web-extensions/webkit2_extu-3.1.5.so
-lib/wx/include/gtk3-unicode-3.1/wx/setup.h
+lib/wx/include/%%GTKVER%%-unicode-3.1/wx/setup.h
 share/aclocal/wxwin31.m4
 share/bakefile/presets/wx31.bkl
 share/bakefile/presets/wx31_presets.py