Skip to contentSkip to conversation

package/weston: needs headers >= 4.4

PATCH New Fabrice Fontaine 2 participants 3 messages Jun 9, 2019 – Jun 10, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/weston: needs headers >= 4.4

weston includes input-event-codes.h since version 5.0.91 and
https://github.com/wayland-project/weston/commit/6e229ca26381bc8191fd9af1e439c311da709aff

input-event-codes.h is available only since kernel 4.4 and
https://github.com/torvalds/linux/commit/f902dd893427eade90f7eaf858e5ff8b150a5a12

Fixes:
- http://autobuild.buildroot.org/results/210c2759900f15ea0030d088f6f45cd8bb199b29

---
 package/weston/Config.in | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
package/weston/Config.in +3 -3
index f874b0cc6a..1b1882b388 100644
@@ -1,6 +1,6 @@
-comment "weston needs udev and a toolchain w/ locale, threads, dynamic library, headers >= 3.0"
+comment "weston needs udev and a toolchain w/ locale, threads, dynamic library, headers >= 4.4"
 	depends on !BR2_PACKAGE_HAS_UDEV || !BR2_TOOLCHAIN_HAS_THREADS || \
-		!BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_0 || BR2_STATIC_LIBS || \
+		!BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_4 || BR2_STATIC_LIBS || \
 		!BR2_ENABLE_LOCALE
 
 config BR2_PACKAGE_WESTON
@@ -9,7 +9,7 @@ config BR2_PACKAGE_WESTON
 	depends on BR2_PACKAGE_HAS_UDEV
 	depends on !BR2_STATIC_LIBS # wayland
 	depends on BR2_TOOLCHAIN_HAS_THREADS # wayland
-	depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_0
+	depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_4 # input-event-codes.h
 	select BR2_PACKAGE_WAYLAND
 	select BR2_PACKAGE_WAYLAND_PROTOCOLS
 	select BR2_PACKAGE_LIBXKBCOMMON
Signature · 1 line
2.20.1
#1 lore raw

PATCH 1/1 package/weston: needs headers >= 4.4

Fabrice, All,

On 2019-06-10 00:27 +0200, Fabrice Fontaine spake thusly:

Quoted 2 lines

weston includes input-event-codes.h since version 5.0.91 and
https://github.com/wayland-project/weston/commit/6e229ca26381bc8191fd9af1e439c311da709aff

Actually, that include is in fact not needed. Just remove it, and it still builds! ;-)

The only #define that is needed from that header is EV_KEY, which before 4.4 was provided in linux/input.h

So, I'd rather we find a solution with upstream to include the correct header, along the lines of:

    diff --git a/compositor/main.c b/compositor/main.c
    index 945f99ae..d3fdb1e4 100644
    --- a/compositor/main.c
    +++ b/compositor/main.c
    @@ -42,7 +42,11 @@
     #include <sys/socket.h>
     #include <libinput.h>
     #include <libevdev/libevdev.h>
    +#if define HAS_LINUX_INPUT_EVENT_CODES_H
     #include <linux/input-event-codes.h>
    +#else
    +#include <linux/input.h>
    +#endif
     #include <sys/time.h>
     #include <linux/limits.h>

I'll let you come up with the meson part of that ;-)

(Note: it works if we just remove the include, because linux/input.h seems to be pulled by another header, but for correctness-sake, we have to include it explicitly.)

Regards,
Yann E. MORIN.

Quoted 36 lines

input-event-codes.h is available only since kernel 4.4 and
https://github.com/torvalds/linux/commit/f902dd893427eade90f7eaf858e5ff8b150a5a12

Fixes:
- http://autobuild.buildroot.org/results/210c2759900f15ea0030d088f6f45cd8bb199b29

---
 package/weston/Config.in | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
package/weston/Config.in +3 -3
index f874b0cc6a..1b1882b388 100644
@@ -1,6 +1,6 @@
-comment "weston needs udev and a toolchain w/ locale, threads, dynamic library, headers >= 3.0"
+comment "weston needs udev and a toolchain w/ locale, threads, dynamic library, headers >= 4.4"
 	depends on !BR2_PACKAGE_HAS_UDEV || !BR2_TOOLCHAIN_HAS_THREADS || \
-		!BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_0 || BR2_STATIC_LIBS || \
+		!BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_4 || BR2_STATIC_LIBS || \
 		!BR2_ENABLE_LOCALE
 
 config BR2_PACKAGE_WESTON
@@ -9,7 +9,7 @@ config BR2_PACKAGE_WESTON
 	depends on BR2_PACKAGE_HAS_UDEV
 	depends on !BR2_STATIC_LIBS # wayland
 	depends on BR2_TOOLCHAIN_HAS_THREADS # wayland
-	depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_0
+	depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_4 # input-event-codes.h
 	select BR2_PACKAGE_WAYLAND
 	select BR2_PACKAGE_WAYLAND_PROTOCOLS
 	select BR2_PACKAGE_LIBXKBCOMMON
Signature · 1 line
2.20.1
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#2 lore raw

PATCH 1/1 package/weston: needs headers >= 4.4

Fabrice, All,

On 2019-06-10 11:37 +0200, Yann E. MORIN spake thusly:

Quoted 6 lines

On 2019-06-10 00:27 +0200, Fabrice Fontaine spake thusly:

Quoted 2 lines

weston includes input-event-codes.h since version 5.0.91 and
https://github.com/wayland-project/weston/commit/6e229ca26381bc8191fd9af1e439c311da709aff

Actually, that include is in fact not needed. Just remove it, and it still builds! ;-)

So, even with a toolchain with headers 4.20, it is not needed to include linux/input-event-codes.h.

That's because it is pulled in from linux/input.h, which it self is pulled in from libevdev/libevdev.h.

So, the patch I suggested earlier is probably the better technically, but one that just includes linux/input.h instead is simpler.

Regards,
Yann E. MORIN.

Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'