Bug 342893 - Build fails with libinput-0.8.0
Summary: Build fails with libinput-0.8.0
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: core (show other bugs)
Version: 5.1.95
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-01-16 01:38 UTC by Armin K.
Modified: 2015-03-20 11:44 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.2.1
Sentry Crash Report:


Attachments
Fix build (1.64 KB, patch)
2015-01-16 01:38 UTC, Armin K.
Details
Add a max version check (506 bytes, patch)
2015-01-16 12:35 UTC, Martin Flöser
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Armin K. 2015-01-16 01:38:24 UTC
When using libinput-0.8.0, the build fails due to API incompatible changes in pointer axis handing code.

Reproducible: Always

Steps to Reproduce:
1. Install libinput-0.8.0
2. Try to compile KWin-5.1.95

Actual Results:  
Build failed with the following output:

/home/armin/src/kwin-5.1.95/libinput/events.cpp: In member function ‘KWin::InputRedirection::PointerAxis KWin::LibInput::PointerEvent::axis() const’:
/home/armin/src/kwin-5.1.95/libinput/events.cpp:149:59: error: ‘libinput_event_pointer_get_axis’ was not declared in this scope
     switch (libinput_event_pointer_get_axis(m_pointerEvent)) {
                                                           ^
/home/armin/src/kwin-5.1.95/libinput/events.cpp: In member function ‘qreal KWin::LibInput::PointerEvent::axisValue() const’:
/home/armin/src/kwin-5.1.95/libinput/events.cpp:161:64: error: too few arguments to function ‘double libinput_event_pointer_get_axis_value(libinput_event_pointer*, libinput_pointer_axis)’
     return libinput_event_pointer_get_axis_value(m_pointerEvent);
                                                                ^
In file included from /home/armin/src/kwin-5.1.95/libinput/events.h:25:0,
                 from /home/armin/src/kwin-5.1.95/libinput/events.cpp:20:
/usr/include/libinput.h:693:1: note: declared here
 libinput_event_pointer_get_axis_value(struct libinput_event_pointer *event,
 ^


Expected Results:  
Build completed sucessfully

I have created a small patch mirroring what was done in Weston. I don't think it follows KWin's style, but at least it compiles now and could be used as reference - that's why I'm posting here instead on reviewboard (I don't know C++, sorry and it's painful to get familiar with such a large codebase such as KWin).
Comment 1 Armin K. 2015-01-16 01:38:57 UTC
Created attachment 90441 [details]
Fix build
Comment 2 Martin Flöser 2015-01-16 06:53:03 UTC
thanks for the patch. That makes it easier as a starting point. Unfortunately the patch would break building with libinput < 0.8 and as we are after feature freeze that's not possible.

I'll try improving the version check to set libinput to false if the version is 0.8 and integrate the patch for master.
Comment 3 Martin Flöser 2015-01-16 12:35:18 UTC
Created attachment 90449 [details]
Add a max version check

Please give a try to this patch. It should disable the build of libinput support if 0.8 is found. That's probably the most suitable solution for the stable branch right now. Unfortunately my distribution doesn't provide a more recent libinput than 0.5 currently, so I could only test that it still builds.

I'll try to compile libinput myself next week and get it into a state that it can build both.
Comment 4 Armin K. 2015-01-28 15:09:04 UTC
Your patch allows KWin-5.2.0 to build fine when libinput-0.8.0 is present.
Comment 5 Martin Flöser 2015-01-28 15:22:43 UTC
Git commit a93a2ab1918630c6d571b5a24379c15a0458d1fa by Martin Gräßlin.
Committed on 28/01/2015 at 15:20.
Pushed by graesslin into branch 'Plasma/5.2'.

Disable libinput integration if >= 0.8 is found

libinput 0.8 is incompatible causing the build to fail. As we are in
dependency freeze the only option is to disable the build.
FIXED-IN: 5.2.1

M  +1    -1    CMakeLists.txt

http://commits.kde.org/kwin/a93a2ab1918630c6d571b5a24379c15a0458d1fa
Comment 6 Antonis G. 2015-03-16 07:46:55 UTC
https://paste.kde.org/pfjdsnzsx it still fails for me with this error message. I have libinput 0.11.0 from arch linux packages.
Comment 7 Martin Flöser 2015-03-16 08:04:50 UTC
> https://paste.kde.org/pfjdsnzsx it still fails for me with this error
> message. I have libinput 0.11.0 from arch linux packages.

which kwin version? This should be fixed in master and 5.2 branch.
Comment 8 Antonis G. 2015-03-16 08:17:41 UTC
Master
Comment 9 Martin Flöser 2015-03-20 11:44:10 UTC
Git commit e886bd7c78b036a04ef6acba8cf641eed4a52e78 by Martin Gräßlin.
Committed on 20/03/2015 at 11:42.
Pushed by graesslin into branch 'master'.

Adjust to newer libinput and require at least 0.10

There was API changes regarding axis event handling.

M  +2    -2    CMakeLists.txt
M  +4    -1    libinput/connection.cpp
M  +13   -9    libinput/events.cpp
M  +2    -2    libinput/events.h

http://commits.kde.org/kwin/e886bd7c78b036a04ef6acba8cf641eed4a52e78