diff options
author | nia <nia@pkgsrc.org> | 2019-08-18 16:47:38 +0000 |
---|---|---|
committer | nia <nia@pkgsrc.org> | 2019-08-18 16:47:38 +0000 |
commit | 089f195fb8847b9e8ad8d3be09f52061083d8726 (patch) | |
tree | 764c859c76f94352e46fe6734cec0ee42dbcc9dd /x11/gtk3 | |
parent | 5c6a742a8b6af889be93a688baf7097779d99e85 (diff) | |
download | pkgsrc-089f195fb8847b9e8ad8d3be09f52061083d8726.tar.gz |
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 (limited to 'x11/gtk3')
-rw-r--r-- | x11/gtk3/PLIST | 13 | ||||
-rw-r--r-- | x11/gtk3/distinfo | 3 | ||||
-rw-r--r-- | x11/gtk3/options.mk | 37 | ||||
-rw-r--r-- | x11/gtk3/patches/patch-gdk_wayland_gdkdevice-wayland.c | 21 |
4 files changed, 60 insertions, 14 deletions
diff --git a/x11/gtk3/PLIST b/x11/gtk3/PLIST index 7ed90f3185a..a6392c7f493 100644 --- a/x11/gtk3/PLIST +++ b/x11/gtk3/PLIST @@ -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/gdkthreads.h 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/gdkquartzscreen.h ${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-thai.la 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/libgtk-3.la 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 --git a/x11/gtk3/distinfo b/x11/gtk3/distinfo index c309aac1ffd..85888d1596c 100644 --- a/x11/gtk3/distinfo +++ b/x11/gtk3/distinfo @@ -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-aj) = cbfab43f27352f7c6bc57a7c562c2d84c69da07a 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 --git a/x11/gtk3/options.mk b/x11/gtk3/options.mk index 63350858aa1..402943eff55 100644 --- a/x11/gtk3/options.mk +++ b/x11/gtk3/options.mk @@ -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_ENV+= ac_cv_path_CUPS_CONFIG=no 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 @@ BUILDLINK_API_DEPENDS.Xft2+= Xft2>=2.1.2nb2 .include "../../x11/libXt/buildlink3.mk" .include "../../x11/libXext/buildlink3.mk" .include "../../x11/libXcomposite/buildlink3.mk" - +.else +CONFIGURE_ARGS+= --disable-x11-backend .endif diff --git a/x11/gtk3/patches/patch-gdk_wayland_gdkdevice-wayland.c b/x11/gtk3/patches/patch-gdk_wayland_gdkdevice-wayland.c new file mode 100644 index 00000000000..de438cafc67 --- /dev/null +++ b/x11/gtk3/patches/patch-gdk_wayland_gdkdevice-wayland.c @@ -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 */ |