Mir

Merge lp:~vanvugt/mir/fix-1549152 into lp:mir

Proposed by Daniel van Vugt
Status: Merged
Approved by: Daniel van Vugt
Approved revision: no longer in the source branch.
Merged at revision: 3336
Proposed branch: lp:~vanvugt/mir/fix-1549152
Merge into: lp:mir
Diff against target: 173 lines (+36/-3)
8 files modified
CMakeLists.txt (+7/-0)
cmake/FindLibHardware.cmake (+1/-1)
src/platforms/evdev/CMakeLists.txt (+6/-0)
src/platforms/evdev/libinput_device.cpp (+8/-1)
tests/include/mir/test/doubles/mock_libinput.h (+2/-0)
tests/mir_test_doubles/mock_libinput.cpp (+4/-0)
tests/unit-tests/input/evdev/test_libinput_device.cpp (+6/-0)
tools/setup-partial-armhf-chroot.sh (+2/-1)
To merge this branch: bzr merge lp:~vanvugt/mir/fix-1549152
Reviewer Review Type Date Requested Status
Mir CI Bot continuous-integration Approve
Cemil Azizoglu (community) Approve
Andreas Pokorny (community) Approve
Alan Griffiths Approve
PS Jenkins bot (community) continuous-integration Needs Fixing
Review via email: mp+286986@code.launchpad.net

Commit message

Restore support for cross-compiling to vivid & wily (LP: #1549152)

Description of the change

Two reasons for this:
  1. Mir should be buildable on the latest stable Ubuntu release,
     which is wily.
  2. I would like to be able to cross compile to vivid too, because
     that will give us clang support from a xenial host in CI.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Mir CI Bot (mir-ci-bot) wrote :

PASSED: Continuous integration, rev:3335
https://mir-jenkins.ubuntu.com/job/mir-ci/387/
Executed test runs:
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-mir/179
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/192
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/188
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial/188
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial/184
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial/184/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/184
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/184/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/184
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/184/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial/184
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial/184/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://mir-jenkins.ubuntu.com/job/mir-ci/387/rebuild

review: Approve (continuous-integration)
Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

+ add_definitions(-DLIBINPUT_HAS_ACCEL_PROFILE=0)

We have a tendency to "namespace" our macros by prefixing "MIR_" it might be good to use this here before "LIBINPUT_".

Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

> + add_definitions(-DLIBINPUT_HAS_ACCEL_PROFILE=0)
>
> We have a tendency to "namespace" our macros by prefixing "MIR_" it might be
> good to use this here before "LIBINPUT_".

Apart from the (small) risk of someone else using LIBINPUT_XXX this seems a reasonable response to a poor feature detection scenario.

review: Approve
Revision history for this message
Andreas Pokorny (andreas-pokorny) wrote :

oh fakeroot helps with that

review: Approve
Revision history for this message
Cemil Azizoglu (cemil-azizoglu) wrote :

Looks good modulo Alan's request.

review: Approve
Revision history for this message
Mir CI Bot (mir-ci-bot) wrote :

PASSED: Continuous integration, rev:3337
https://mir-jenkins.ubuntu.com/job/mir-ci/395/
Executed test runs:
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-mir/189
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/206
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/202
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial/202
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial/194
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial/194/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/194
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/194/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/194
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/194/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial/194
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial/194/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://mir-jenkins.ubuntu.com/job/mir-ci/395/rebuild

review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'CMakeLists.txt'
2--- CMakeLists.txt 2016-02-23 14:31:34 +0000
3+++ CMakeLists.txt 2016-02-25 03:47:23 +0000
4@@ -214,6 +214,13 @@
5 add_subdirectory(src/)
6 include_directories(${MIR_GENERATED_INCLUDE_DIRECTORIES})
7
8+# This copy is used by users of mirplatforminputevdev
9+if ("${LIBINPUT_VERSION}" VERSION_LESS "1.1")
10+ add_definitions(-DMIR_LIBINPUT_HAS_ACCEL_PROFILE=0)
11+else ()
12+ add_definitions(-DMIR_LIBINPUT_HAS_ACCEL_PROFILE=1)
13+endif ()
14+
15 option(MIR_ENABLE_TESTS "Build tests" ON)
16
17 add_subdirectory(benchmarks/)
18
19=== modified file 'cmake/FindLibHardware.cmake'
20--- cmake/FindLibHardware.cmake 2016-01-29 04:07:19 +0000
21+++ cmake/FindLibHardware.cmake 2016-02-25 03:47:23 +0000
22@@ -7,7 +7,7 @@
23 INCLUDE(FindPackageHandleStandardArgs)
24
25 find_package( PkgConfig )
26-pkg_search_module(ANDROID_HEADERS REQUIRED android-headers-19 android-headers)
27+pkg_search_module(ANDROID_HEADERS REQUIRED android-headers)
28 set(LIBHARDWARE_INCLUDE_DIRS ${ANDROID_HEADERS_INCLUDE_DIRS})
29
30 find_library(LIBHARDWARE_LIBRARY
31
32=== modified file 'src/platforms/evdev/CMakeLists.txt'
33--- src/platforms/evdev/CMakeLists.txt 2016-02-22 03:59:29 +0000
34+++ src/platforms/evdev/CMakeLists.txt 2016-02-25 03:47:23 +0000
35@@ -1,5 +1,11 @@
36 pkg_check_modules(LIBINPUT REQUIRED libinput)
37
38+if ("${LIBINPUT_VERSION}" VERSION_LESS "1.1")
39+ add_definitions(-DMIR_LIBINPUT_HAS_ACCEL_PROFILE=0)
40+else ()
41+ add_definitions(-DMIR_LIBINPUT_HAS_ACCEL_PROFILE=1)
42+endif ()
43+
44 include_directories(
45 ${LIBINPUT_CFLAGS}
46 ${PROJECT_SOURCE_DIR}/include/platform
47
48=== modified file 'src/platforms/evdev/libinput_device.cpp'
49--- src/platforms/evdev/libinput_device.cpp 2016-02-22 03:59:29 +0000
50+++ src/platforms/evdev/libinput_device.cpp 2016-02-25 03:47:23 +0000
51@@ -368,11 +368,14 @@
52 auto dev = device();
53 auto const left_handed = (libinput_device_config_left_handed_get(dev) == 1);
54 settings.handedness = left_handed? mir_pointer_handedness_left : mir_pointer_handedness_right;
55+#if MIR_LIBINPUT_HAS_ACCEL_PROFILE
56 if (libinput_device_config_accel_get_profile(dev) == LIBINPUT_CONFIG_ACCEL_PROFILE_FLAT)
57+#endif
58 settings.acceleration = mir_pointer_acceleration_none;
59+#if MIR_LIBINPUT_HAS_ACCEL_PROFILE
60 else
61 settings.acceleration = mir_pointer_acceleration_adaptive;
62-
63+#endif
64 settings.cursor_acceleration_bias = libinput_device_config_accel_get_speed(dev);
65 settings.vertical_scroll_scale = vertical_scroll_scale;
66 settings.horizontal_scroll_scale = horizontal_scroll_scale;
67@@ -386,14 +389,18 @@
68
69 auto dev = device();
70
71+#if MIR_LIBINPUT_HAS_ACCEL_PROFILE
72 auto accel_profile = settings.acceleration == mir_pointer_acceleration_adaptive ?
73 LIBINPUT_CONFIG_ACCEL_PROFILE_ADAPTIVE :
74 LIBINPUT_CONFIG_ACCEL_PROFILE_FLAT;
75+#endif
76 libinput_device_config_accel_set_speed(dev, settings.cursor_acceleration_bias);
77 libinput_device_config_left_handed_set(dev, mir_pointer_handedness_left == settings.handedness);
78 vertical_scroll_scale = settings.vertical_scroll_scale;
79 horizontal_scroll_scale = settings.horizontal_scroll_scale;
80+#if MIR_LIBINPUT_HAS_ACCEL_PROFILE
81 libinput_device_config_accel_set_profile(dev, accel_profile);
82+#endif
83 }
84
85 mir::optional_value<mi::TouchpadSettings> mie::LibInputDevice::get_touchpad_settings() const
86
87=== modified file 'tests/include/mir/test/doubles/mock_libinput.h'
88--- tests/include/mir/test/doubles/mock_libinput.h 2016-02-22 03:59:29 +0000
89+++ tests/include/mir/test/doubles/mock_libinput.h 2016-02-25 03:47:23 +0000
90@@ -138,8 +138,10 @@
91 MOCK_METHOD2(libinput_device_config_accel_set_speed, libinput_config_status(libinput_device*, double speed));
92 MOCK_METHOD1(libinput_device_config_accel_get_speed, double(libinput_device*));
93 MOCK_METHOD1(libinput_device_config_accel_get_default_speed, double(libinput_device*));
94+#if MIR_LIBINPUT_HAS_ACCEL_PROFILE
95 MOCK_METHOD2(libinput_device_config_accel_set_profile, libinput_config_status(libinput_device*, libinput_config_accel_profile));
96 MOCK_METHOD1(libinput_device_config_accel_get_profile, libinput_config_accel_profile(libinput_device*));
97+#endif
98 MOCK_METHOD1(libinput_device_config_scroll_has_natural_scroll, int(libinput_device*));
99 MOCK_METHOD2(libinput_device_config_scroll_set_natural_scroll_enabled, libinput_config_status(libinput_device*, int enable));
100 MOCK_METHOD1(libinput_device_config_scroll_get_natural_scroll_enabled, int(libinput_device*));
101
102=== modified file 'tests/mir_test_doubles/mock_libinput.cpp'
103--- tests/mir_test_doubles/mock_libinput.cpp 2016-02-22 03:59:29 +0000
104+++ tests/mir_test_doubles/mock_libinput.cpp 2016-02-25 03:47:23 +0000
105@@ -61,8 +61,10 @@
106 .WillByDefault(Return(LIBINPUT_CONFIG_STATUS_SUCCESS));
107 ON_CALL(*this, libinput_device_config_middle_emulation_set_enabled(_, _))
108 .WillByDefault(Return(LIBINPUT_CONFIG_STATUS_SUCCESS));
109+#if MIR_LIBINPUT_HAS_ACCEL_PROFILE
110 ON_CALL(*this, libinput_device_config_accel_set_profile(_, _))
111 .WillByDefault(Return(LIBINPUT_CONFIG_STATUS_SUCCESS));
112+#endif
113 }
114
115 void mtd::MockLibInput::wake()
116@@ -492,6 +494,7 @@
117 return global_libinput->libinput_device_config_accel_get_default_speed(device);
118 }
119
120+#if MIR_LIBINPUT_HAS_ACCEL_PROFILE
121 libinput_config_status libinput_device_config_accel_set_profile(libinput_device* dev, libinput_config_accel_profile profile)
122 {
123 return global_libinput->libinput_device_config_accel_set_profile(dev, profile);
124@@ -501,6 +504,7 @@
125 {
126 return global_libinput->libinput_device_config_accel_get_profile(dev);
127 }
128+#endif
129
130 int libinput_device_config_scroll_has_natural_scroll(libinput_device *device)
131 {
132
133=== modified file 'tests/unit-tests/input/evdev/test_libinput_device.cpp'
134--- tests/unit-tests/input/evdev/test_libinput_device.cpp 2016-02-22 03:59:29 +0000
135+++ tests/unit-tests/input/evdev/test_libinput_device.cpp 2016-02-25 03:47:23 +0000
136@@ -175,10 +175,14 @@
137 .WillByDefault(Return(accel_speed));
138 ON_CALL(env.mock_libinput, libinput_device_config_left_handed_get(dev))
139 .WillByDefault(Return(handedness == mir_pointer_handedness_left));
140+#if MIR_LIBINPUT_HAS_ACCEL_PROFILE
141 ON_CALL(env.mock_libinput, libinput_device_config_accel_get_profile(dev))
142 .WillByDefault(Return((profile == mir_pointer_acceleration_none) ?
143 LIBINPUT_CONFIG_ACCEL_PROFILE_FLAT :
144 LIBINPUT_CONFIG_ACCEL_PROFILE_ADAPTIVE));
145+#else
146+ (void)profile;
147+#endif
148 }
149
150 void setup_touchpad_configuration(libinput_device* dev,
151@@ -623,7 +627,9 @@
152 settings.acceleration = mir_pointer_acceleration_none;
153
154 EXPECT_CALL(env.mock_libinput, libinput_device_config_accel_set_speed(mouse.device(), 1.1)).Times(1);
155+#if MIR_LIBINPUT_HAS_ACCEL_PROFILE
156 EXPECT_CALL(env.mock_libinput, libinput_device_config_accel_set_profile(mouse.device(), LIBINPUT_CONFIG_ACCEL_PROFILE_FLAT)).Times(1);
157+#endif
158 EXPECT_CALL(env.mock_libinput, libinput_device_config_left_handed_set(mouse.device(), true)).Times(1);
159
160 mouse.apply_settings(settings);
161
162=== modified file 'tools/setup-partial-armhf-chroot.sh'
163--- tools/setup-partial-armhf-chroot.sh 2016-01-29 08:18:22 +0000
164+++ tools/setup-partial-armhf-chroot.sh 2016-02-25 03:47:23 +0000
165@@ -132,7 +132,8 @@
166 " >> mstrap.conf
167 done
168
169-multistrap -f mstrap.conf
170+# Fakeroot is required to stop the apt update command giving up
171+fakeroot multistrap -f mstrap.conf
172
173 rm -f var/cache/apt/archives/lock
174

Subscribers

People subscribed via source and target branches