pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/x11/gtk3 gtk3: Add Wayland support to options.mk.



details:   https://anonhg.NetBSD.org/pkgsrc/rev/ddda3c4a3272
branches:  trunk
changeset: 399909:ddda3c4a3272
user:      nia <nia%pkgsrc.org@localhost>
date:      Sun Aug 18 16:47:38 2019 +0000

description:
gtk3: Add Wayland support to options.mk.

This patch also allows multiple GDK backends to be selected (e.g. for
compiling with both X11 and Wayland support).

Previously only one backend could be enabled at a time, but the only
configuration where using multiple would be possible would be Quartz+X11
on macOS. I haven't tested this configuration on a macOS system, but it
would be interesting to know whether it works.

Builds with Wayland support on NetBSD...

diffstat:

 x11/gtk3/PLIST                                         |  13 +++++-
 x11/gtk3/distinfo                                      |   3 +-
 x11/gtk3/options.mk                                    |  37 ++++++++++++-----
 x11/gtk3/patches/patch-gdk_wayland_gdkdevice-wayland.c |  21 ++++++++++
 4 files changed, 60 insertions(+), 14 deletions(-)

diffs (158 lines):

diff -r 9833a97547da -r ddda3c4a3272 x11/gtk3/PLIST
--- a/x11/gtk3/PLIST    Sun Aug 18 16:36:11 2019 +0000
+++ b/x11/gtk3/PLIST    Sun Aug 18 16:47:38 2019 +0000
@@ -1,4 +1,4 @@
-@comment $NetBSD: PLIST,v 1.25 2019/04/18 09:59:34 adam Exp $
+@comment $NetBSD: PLIST,v 1.26 2019/08/18 16:47:38 nia Exp $
 bin/gtk-builder-tool
 bin/gtk-encode-symbolic-svg
 bin/gtk-launch
@@ -52,6 +52,7 @@
 include/gtk-3.0/gdk/gdktypes.h
 include/gtk-3.0/gdk/gdkversionmacros.h
 include/gtk-3.0/gdk/gdkvisual.h
+${PLIST.wayland}include/gtk-3.0/gdk/gdkwayland.h
 include/gtk-3.0/gdk/gdkwindow.h
 ${PLIST.x11}include/gtk-3.0/gdk/gdkx.h
 ${PLIST.quartz}include/gtk-3.0/gdk/quartz/gdkquartzcursor.h
@@ -67,6 +68,12 @@
 ${PLIST.quartz}include/gtk-3.0/gdk/quartz/gdkquartzutils.h
 ${PLIST.quartz}include/gtk-3.0/gdk/quartz/gdkquartzvisual.h
 ${PLIST.quartz}include/gtk-3.0/gdk/quartz/gdkquartzwindow.h
+${PLIST.wayland}include/gtk-3.0/gdk/wayland/gdkwaylanddevice.h
+${PLIST.wayland}include/gtk-3.0/gdk/wayland/gdkwaylanddisplay.h
+${PLIST.wayland}include/gtk-3.0/gdk/wayland/gdkwaylandglcontext.h
+${PLIST.wayland}include/gtk-3.0/gdk/wayland/gdkwaylandmonitor.h
+${PLIST.wayland}include/gtk-3.0/gdk/wayland/gdkwaylandselection.h
+${PLIST.wayland}include/gtk-3.0/gdk/wayland/gdkwaylandwindow.h
 ${PLIST.x11}include/gtk-3.0/gdk/x11/gdkx-autocleanups.h
 ${PLIST.x11}include/gtk-3.0/gdk/x11/gdkx11applaunchcontext.h
 ${PLIST.x11}include/gtk-3.0/gdk/x11/gdkx11cursor.h
@@ -428,6 +435,8 @@
 lib/gtk-3.0/3.0.0/immodules/im-ti-er.la
 lib/gtk-3.0/3.0.0/immodules/im-ti-et.la
 lib/gtk-3.0/3.0.0/immodules/im-viqr.la
+${PLIST.wayland}lib/gtk-3.0/3.0.0/immodules/im-wayland.la
+${PLIST.wayland}lib/gtk-3.0/3.0.0/immodules/im-waylandgtk.la
 ${PLIST.x11}lib/gtk-3.0/3.0.0/immodules/im-xim.la
 ${PLIST.cups}lib/gtk-3.0/3.0.0/printbackends/libprintbackend-cups.la
 lib/gtk-3.0/3.0.0/printbackends/libprintbackend-file.la
@@ -438,10 +447,12 @@
 lib/pkgconfig/gail-3.0.pc
 lib/pkgconfig/gdk-3.0.pc
 ${PLIST.quartz}lib/pkgconfig/gdk-quartz-3.0.pc
+${PLIST.wayland}lib/pkgconfig/gdk-wayland-3.0.pc
 ${PLIST.x11}lib/pkgconfig/gdk-x11-3.0.pc
 lib/pkgconfig/gtk+-3.0.pc
 ${PLIST.quartz}lib/pkgconfig/gtk+-quartz-3.0.pc
 lib/pkgconfig/gtk+-unix-print-3.0.pc
+${PLIST.wayland}lib/pkgconfig/gtk+-wayland-3.0.pc
 ${PLIST.x11}lib/pkgconfig/gtk+-x11-3.0.pc
 libdata/gtk-3.0/im-multipress.conf
 man/man1/broadwayd.1
diff -r 9833a97547da -r ddda3c4a3272 x11/gtk3/distinfo
--- a/x11/gtk3/distinfo Sun Aug 18 16:36:11 2019 +0000
+++ b/x11/gtk3/distinfo Sun Aug 18 16:47:38 2019 +0000
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.66 2019/04/18 09:59:34 adam Exp $
+$NetBSD: distinfo,v 1.67 2019/08/18 16:47:38 nia Exp $
 
 SHA1 (gtk+-3.24.8.tar.xz) = 03d12f8d4f8697d5f0c778f8f80ce262767e3d37
 RMD160 (gtk+-3.24.8.tar.xz) = 6fc0fbede3634cd1010a97cda7d7388eb425b4f3
@@ -8,6 +8,7 @@
 SHA1 (patch-config.h.in) = dc5f8741eed554f88c0b6834cadad95083e4dc8f
 SHA1 (patch-configure) = d531b33e52facf960058f1223b70db680da35300
 SHA1 (patch-configure.ac) = 68793f40752f25ccaecc958c72c23a504670bea5
+SHA1 (patch-gdk_wayland_gdkdevice-wayland.c) = 45dd3346f3adcb030b0d1ec60eeb43e0e6800ad4
 SHA1 (patch-gdk_x11_gdkscreen-x11.h) = 455d6c3de8421984ba3c99baf51cd31982a3df78
 SHA1 (patch-gdk_x11_gdkwindow-x11.h) = c80f7c9d5a570817e54fd74fa903a53400dc6f64
 SHA1 (patch-gtk_a11y_gtkaccessibility.c) = 13232c85bd570f21ea03153dacde4ca98c7c76a8
diff -r 9833a97547da -r ddda3c4a3272 x11/gtk3/options.mk
--- a/x11/gtk3/options.mk       Sun Aug 18 16:36:11 2019 +0000
+++ b/x11/gtk3/options.mk       Sun Aug 18 16:47:38 2019 +0000
@@ -1,13 +1,12 @@
-# $NetBSD: options.mk,v 1.13 2018/07/02 17:10:29 gdt Exp $
+# $NetBSD: options.mk,v 1.14 2019/08/18 16:47:38 nia Exp $
 
 PKG_OPTIONS_VAR=       PKG_OPTIONS.gtk3
-PKG_SUPPORTED_OPTIONS= gtk3-atk-bridge cups debug
-PKG_OPTIONS_REQUIRED_GROUPS=   gdk-target
-PKG_OPTIONS_GROUP.gdk-target=  x11
+PKG_SUPPORTED_OPTIONS+=        gtk3-atk-bridge cups debug
+PKG_SUPPORTED_OPTIONS+=        wayland x11
 .if exists(/System/Library/Frameworks/Quartz.framework)
-PKG_OPTIONS_GROUP.gdk-target+= quartz
+PKG_SUPPORTED_OPTIONS+=        quartz
 .endif
-PKG_SUGGESTED_OPTIONS=         gtk3-atk-bridge x11
+PKG_SUGGESTED_OPTIONS= gtk3-atk-bridge x11
 
 .include "../../mk/bsd.options.mk"
 
@@ -23,15 +22,28 @@
 CONFIGURE_ARGS+=       --enable-debug=yes
 .endif
 
-###
-### GDK target
-###
-PLIST_VARS+=           quartz x11
+PLIST_VARS+=           quartz
 .if !empty(PKG_OPTIONS:Mquartz)
-CONFIGURE_ARGS+=       --without-x
 CONFIGURE_ARGS+=       --enable-quartz-backend
 PLIST.quartz=          yes
 .else
+CONFIGURE_ARGS+=       --disable-quartz-backend
+.endif
+
+PLIST_VARS+=           wayland
+.if !empty(PKG_OPTIONS:Mwayland)
+PLIST.wayland=         yes
+.include "../../devel/wayland/buildlink3.mk"
+.include "../../devel/wayland-protocols/buildlink3.mk"
+.include "../../x11/libxkbcommon/buildlink3.mk"
+CONFIGURE_ARGS+=       --enable-wayland-backend
+.else
+CONFIGURE_ARGS+=       --disable-wayland-backend
+.endif
+
+PLIST_VARS+=           x11
+.if !empty(PKG_OPTIONS:Mx11)
+CONFIGURE_ARGS+=       --enable-x11-backend
 CONFIGURE_ENV+=                ac_cv_header_X11_extensions_Xinerama_h=no
 CONFIGURE_ENV+=                ac_cv_lib_Xinerama_XineramaQueryExtension=no
 PLIST.x11=             yes
@@ -57,5 +69,6 @@
 .include "../../x11/libXt/buildlink3.mk"
 .include "../../x11/libXext/buildlink3.mk"
 .include "../../x11/libXcomposite/buildlink3.mk"
-
+.else
+CONFIGURE_ARGS+=       --disable-x11-backend
 .endif
diff -r 9833a97547da -r ddda3c4a3272 x11/gtk3/patches/patch-gdk_wayland_gdkdevice-wayland.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/x11/gtk3/patches/patch-gdk_wayland_gdkdevice-wayland.c    Sun Aug 18 16:47:38 2019 +0000
@@ -0,0 +1,21 @@
+$NetBSD: patch-gdk_wayland_gdkdevice-wayland.c,v 1.1 2019/08/18 16:47:38 nia Exp $
+
+Allow building on systems without evdev.
+
+--- gdk/wayland/gdkdevice-wayland.c.orig       2019-04-10 19:30:43.000000000 +0000
++++ gdk/wayland/gdkdevice-wayland.c
+@@ -44,6 +44,14 @@
+ #include <dev/evdev/input.h>
+ #elif defined(HAVE_LINUX_INPUT_H)
+ #include <linux/input.h>
++#else
++#ifndef BTN_LEFT
++#define BTN_LEFT      (0)
++#define BTN_MIDDLE    (1)
++#define BTN_RIGHT     (2)
++#define BTN_STYLUS    (98)
++#define BTN_STYLUS2   (99)
++#endif
+ #endif
+ 
+ #define BUTTON_BASE (BTN_LEFT - 1) /* Used to translate to 1-indexed buttons */



Home | Main Index | Thread Index | Old Index