[packages/weston] - fix building with libinput 4.0+
baggins
baggins at pld-linux.org
Tue Jul 29 23:56:36 CEST 2014
commit 950d7b1177bc8905b696d7f9a60984d052129480
Author: Jan Rękorajski <baggins at pld-linux.org>
Date: Tue Jul 29 23:56:57 2014 +0200
- fix building with libinput 4.0+
libinput4.patch | 96 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
weston.spec | 2 ++
2 files changed, 98 insertions(+)
---
diff --git a/weston.spec b/weston.spec
index 3123ebf..9484bc0 100644
--- a/weston.spec
+++ b/weston.spec
@@ -20,6 +20,7 @@ License: MIT
Group: Applications
Source0: http://wayland.freedesktop.org/releases/%{name}-%{version}.tar.xz
# Source0-md5: 8eb40d230efc2411f083c20656534780
+Patch0: libinput4.patch
URL: http://wayland.freedesktop.org/
BuildRequires: Mesa-libEGL-devel >= 7.10
# GLESv2
@@ -122,6 +123,7 @@ Pliki nagłówkowe do tworzenia wtyczek dla Westona.
%prep
%setup -q
+%patch0 -p1
%build
%configure \
diff --git a/libinput4.patch b/libinput4.patch
new file mode 100644
index 0000000..d6061d1
--- /dev/null
+++ b/libinput4.patch
@@ -0,0 +1,96 @@
+From 3b843d3a61286d4b2a9552a3a2cae80c6b1cf8cd Mon Sep 17 00:00:00 2001
+From: Peter Hutterer <peter.hutterer at who-t.net>
+Date: Wed, 25 Jun 2014 04:07:36 +0000
+Subject: Require libinput 0.4.0
+
+No functional changes, just adjusting for API changes in libinput:
+- libinput_destroy() replaced by libinput_unref()
+- log functions now take a libinput context, userdata is gone
+- udev seat creation is now libinput_udev_create_context() and
+ libinput_udev_assign_seat()
+
+Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
+---
+diff --git a/configure.ac b/configure.ac
+index b4511fc..648bee8 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -160,7 +160,7 @@ AC_ARG_ENABLE(libinput-backend, [ --enable-libinput-backend],,
+ AM_CONDITIONAL([ENABLE_LIBINPUT_BACKEND], [test x$enable_libinput_backend = xyes])
+ if test x$enable_libinput_backend = xyes; then
+ AC_DEFINE([BUILD_LIBINPUT_BACKEND], [1], [Build the libinput input device backend])
+- PKG_CHECK_MODULES(LIBINPUT_BACKEND, [libinput >= 0.1.0])
++ PKG_CHECK_MODULES(LIBINPUT_BACKEND, [libinput >= 0.4.0])
+ fi
+
+
+diff --git a/src/libinput-seat.c b/src/libinput-seat.c
+index d59ae42..09cf7c7 100644
+--- a/src/libinput-seat.c
++++ b/src/libinput-seat.c
+@@ -252,8 +252,9 @@ udev_input_enable(struct udev_input *input)
+ }
+
+ static void
+-libinput_log_func(enum libinput_log_priority priority, void *user_data,
+- const char *format, va_list args)
++libinput_log_func(struct libinput *libinput,
++ enum libinput_log_priority priority,
++ const char *format, va_list args)
+ {
+ weston_vlog(format, args);
+ }
+@@ -268,25 +269,34 @@ udev_input_init(struct udev_input *input, struct weston_compositor *c, struct ud
+
+ input->compositor = c;
+
+- libinput_log_set_handler(&libinput_log_func, NULL);
+-
+ log_priority = getenv("WESTON_LIBINPUT_LOG_PRIORITY");
+
++ input->libinput = libinput_udev_create_context(&libinput_interface,
++ input, udev);
++ if (!input->libinput) {
++ return -1;
++ }
++
++ libinput_log_set_handler(input->libinput, &libinput_log_func);
++
+ if (log_priority) {
+ if (strcmp(log_priority, "debug") == 0) {
+- libinput_log_set_priority(LIBINPUT_LOG_PRIORITY_DEBUG);
++ libinput_log_set_priority(input->libinput,
++ LIBINPUT_LOG_PRIORITY_DEBUG);
+ } else if (strcmp(log_priority, "info") == 0) {
+- libinput_log_set_priority(LIBINPUT_LOG_PRIORITY_INFO);
++ libinput_log_set_priority(input->libinput,
++ LIBINPUT_LOG_PRIORITY_INFO);
+ } else if (strcmp(log_priority, "error") == 0) {
+- libinput_log_set_priority(LIBINPUT_LOG_PRIORITY_ERROR);
++ libinput_log_set_priority(input->libinput,
++ LIBINPUT_LOG_PRIORITY_ERROR);
+ }
+ }
+
+- input->libinput = libinput_udev_create_for_seat(&libinput_interface, input,
+- udev, seat_id);
+- if (!input->libinput) {
++ if (libinput_udev_assign_seat(input->libinput, seat_id) != 0) {
++ libinput_unref(input->libinput);
+ return -1;
+ }
++
+ process_events(input);
+
+ return udev_input_enable(input);
+@@ -300,7 +310,7 @@ udev_input_destroy(struct udev_input *input)
+ wl_event_source_remove(input->libinput_source);
+ wl_list_for_each_safe(seat, next, &input->compositor->seat_list, base.link)
+ udev_seat_destroy(seat);
+- libinput_destroy(input->libinput);
++ libinput_unref(input->libinput);
+ }
+
+ static void
+--
+cgit v0.9.0.2-2-gbebe
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/weston.git/commitdiff/950d7b1177bc8905b696d7f9a60984d052129480
More information about the pld-cvs-commit
mailing list