diff options
author | Tobias Kortkamp <tobik@FreeBSD.org> | 2018-03-26 22:49:58 +0000 |
---|---|---|
committer | Tobias Kortkamp <tobik@FreeBSD.org> | 2018-03-26 22:49:58 +0000 |
commit | 43e7d7076477309c00398ce8d67c6c39596c3377 (patch) | |
tree | eb9f3e7c30e7ec66342951c9ca4f46726a092b6b | |
parent | 9ee3100454ea2b6ff38549abe9466a2d01a55444 (diff) | |
download | freebsd-ports-43e7d7076477309c00398ce8d67c6c39596c3377.zip |
x11-toolkits/gtk30: Add new non-default WAYLAND option
It enables building of Gdk's Wayland backend.
PR: 219040
Submitted by: Johannes Lundberg <johalun0@gmail.com> (based on)
Approved by: gnome (maintainer timeout, ~9 months)
-rw-r--r-- | x11-toolkits/gtk30/Makefile | 11 | ||||
-rw-r--r-- | x11-toolkits/gtk30/files/patch-gdk_wayland_Makefile.in | 23 | ||||
-rw-r--r-- | x11-toolkits/gtk30/files/patch-gdk_wayland_gdkdevice-wayland.c | 15 | ||||
-rw-r--r-- | x11-toolkits/gtk30/pkg-plist | 9 |
4 files changed, 56 insertions, 2 deletions
diff --git a/x11-toolkits/gtk30/Makefile b/x11-toolkits/gtk30/Makefile index 7099d86966de..12791eacf9c4 100644 --- a/x11-toolkits/gtk30/Makefile +++ b/x11-toolkits/gtk30/Makefile @@ -44,7 +44,6 @@ USES+= compiler:c11 gettext gmake gnome libtool localbase \ USE_XORG= xext xrender x11 xinerama xi xrandr xcursor xfixes xdamage \ xcomposite CONFIGURE_ARGS= --enable-x11-backend \ - --disable-wayland-backend \ --enable-introspection CPPFLAGS+= -fno-omit-frame-pointer INSTALLS_ICONS= yes @@ -58,8 +57,9 @@ GLIB_SCHEMAS= org.gtk.Demo.gschema.xml \ org.gtk.Settings.Debug.gschema.xml \ org.gtk.Settings.FileChooser.gschema.xml -OPTIONS_DEFINE= CUPS CLOUDPRINT COLORD DEBUG BROADWAY +OPTIONS_DEFINE= CUPS CLOUDPRINT COLORD DEBUG BROADWAY WAYLAND OPTIONS_DEFAULT=CUPS COLORD BROADWAY +OPTIONS_EXCLUDE_FreeBSD_10= WAYLAND OPTIONS_SUB= yes BROADWAY_DESC= Enable GDK Broadway backend for showing GTK+ in the webbrowser using HTML5 and web sockets. @@ -80,6 +80,13 @@ CLOUDPRINT_LIB_DEPENDS= librest-0.7.so:devel/librest \ # don't explicitly disable debug, this causes segfaults. ports r437293 DEBUG_CONFIGURE_ON= --enable-debug=yes +WAYLAND_BUILD_DEPENDS= wayland-protocols>=0:graphics/wayland-protocols +WAYLAND_CONFIGURE_ENABLE= wayland-backend +WAYLAND_LIB_DEPENDS= libwayland-client.so:graphics/wayland \ + libwayland-egl.so:graphics/mesa-libs \ + libxkbcommon.so:x11/libxkbcommon +WAYLAND_RUN_DEPENDS= wayland-protocols>=0:graphics/wayland-protocols + post-patch: @${REINPLACE_CMD} -e 's|[{]libdir[}]/locale|{datadir}/locale|g' \ ${WRKSRC}/configure diff --git a/x11-toolkits/gtk30/files/patch-gdk_wayland_Makefile.in b/x11-toolkits/gtk30/files/patch-gdk_wayland_Makefile.in new file mode 100644 index 000000000000..b6e4b0a714f7 --- /dev/null +++ b/x11-toolkits/gtk30/files/patch-gdk_wayland_Makefile.in @@ -0,0 +1,23 @@ +Use portable sed syntax in gdk/wayland/Makefile.in + +Replace non-portable \<, \>, \+ with \(, \), \{, \} to avoid build +failure on systems not using GNU sed. + +https://git.gnome.org/browse/gtk/commit/gdk/wayland/Makefile.am?h=gtk-3-22&id=b68e55ecce38dec47c3f9119e603b81773e5294a + +--- gdk/wayland/Makefile.in.orig 2018-03-25 16:20:44 UTC ++++ gdk/wayland/Makefile.in +@@ -1028,11 +1028,11 @@ check-local: test-cwd + .SECONDEXPANSION: + + define protostability +-$(shell echo $1 | sed 's/.*\(\<unstable\>\|\<stable\>\).*/\1/') ++$(if $(findstring unstable,$1),unstable,stable) + endef + + define protoname +-$(shell echo $1 | sed 's/\([a-z\-]\+\)-[a-z]\+-v[0-9]\+/\1/') ++$(shell echo $1 | sed 's/\([a-z\-]\{1,\}\)-[a-z]\{1,\}-v[0-9]\{1,\}/\1/') + endef + + %-protocol.c : $(WAYLAND_PROTOCOLS_DATADIR)/$$(call protostability,$$*)/$$(call protoname,$$*)/$$*.xml diff --git a/x11-toolkits/gtk30/files/patch-gdk_wayland_gdkdevice-wayland.c b/x11-toolkits/gtk30/files/patch-gdk_wayland_gdkdevice-wayland.c new file mode 100644 index 000000000000..0fb5b0655623 --- /dev/null +++ b/x11-toolkits/gtk30/files/patch-gdk_wayland_gdkdevice-wayland.c @@ -0,0 +1,15 @@ +--- gdk/wayland/gdkdevice-wayland.c.orig 2018-03-25 16:25:12 UTC ++++ gdk/wayland/gdkdevice-wayland.c +@@ -38,11 +38,9 @@ + + #include <xkbcommon/xkbcommon.h> + +-#include <linux/input.h> +- + #include <sys/time.h> + #include <sys/mman.h> +-#include <linux/input.h> ++#include <dev/evdev/input.h> + + #define BUTTON_BASE (BTN_LEFT - 1) /* Used to translate to 1-indexed buttons */ + diff --git a/x11-toolkits/gtk30/pkg-plist b/x11-toolkits/gtk30/pkg-plist index 0e8cbac4dbf4..97fd0f9a0d22 100644 --- a/x11-toolkits/gtk30/pkg-plist +++ b/x11-toolkits/gtk30/pkg-plist @@ -58,8 +58,15 @@ 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 +%%WAYLAND%%include/gtk-3.0/gdk/gdkwayland.h include/gtk-3.0/gdk/gdkwindow.h include/gtk-3.0/gdk/gdkx.h +%%WAYLAND%%include/gtk-3.0/gdk/wayland/gdkwaylanddevice.h +%%WAYLAND%%include/gtk-3.0/gdk/wayland/gdkwaylanddisplay.h +%%WAYLAND%%include/gtk-3.0/gdk/wayland/gdkwaylandglcontext.h +%%WAYLAND%%include/gtk-3.0/gdk/wayland/gdkwaylandmonitor.h +%%WAYLAND%%include/gtk-3.0/gdk/wayland/gdkwaylandselection.h +%%WAYLAND%%include/gtk-3.0/gdk/wayland/gdkwaylandwindow.h include/gtk-3.0/gdk/x11/gdkx-autocleanups.h include/gtk-3.0/gdk/x11/gdkx11applaunchcontext.h include/gtk-3.0/gdk/x11/gdkx11cursor.h @@ -434,10 +441,12 @@ lib/libgtk-3.so.%%LIBVERSION%% libdata/pkgconfig/gail-3.0.pc libdata/pkgconfig/gdk-3.0.pc %%BROADWAY%%libdata/pkgconfig/gdk-broadway-3.0.pc +%%WAYLAND%%libdata/pkgconfig/gdk-wayland-3.0.pc libdata/pkgconfig/gdk-x11-3.0.pc libdata/pkgconfig/gtk+-3.0.pc %%BROADWAY%%libdata/pkgconfig/gtk+-broadway-3.0.pc libdata/pkgconfig/gtk+-unix-print-3.0.pc +%%WAYLAND%%libdata/pkgconfig/gtk+-wayland-3.0.pc libdata/pkgconfig/gtk+-x11-3.0.pc man/man1/gtk-query-immodules-3.0.1.gz share/aclocal/gtk-3.0.m4 |