Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion conf/distro/include/thunder_generic.conf
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ DISTROOVERRIDES .= ":${DISTRO_CODENAME}"

PREFERRED_VERSION_wpewebkit = "2.28%"
PREFERRED_VERSION_libwpe = "1.6.0%"
PREFERRED_VERSION_wpebackend-rdk = "git%"
PREFERRED_VERSION_wpebackend-rdk = "0.1%"
PREFERRED_VERSION_icu = "65.%"
PREFERRED_PROVIDER_virtual/wpebackend = "wpebackend-rdk"

Expand Down
8 changes: 8 additions & 0 deletions recipes-wpe/libwpe/libwpe_1.14.0.bb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
require libwpe.inc

LICENSE = "BSD"
LIC_FILES_CHKSUM = "file://COPYING;md5=371a616eb4903c6cb79e9893a5f615cc"

SRC_URI = "https://wpewebkit.org/releases/${BPN}-${PV}.tar.xz"
SRC_URI[sha256sum] = "c073305bbac5f4402cc1c8a4753bfa3d63a408901f86182051eaa5a75dd89c00"

74 changes: 74 additions & 0 deletions recipes-wpe/wpebackend-rdk/wpebackend-rdk.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
SUMMARY = "WPE Backend for RDK"
DESCRIPTION = "Backend for WPE with specific support for embedded devices used on the RDK"
HOMEPAGE = "https://github.com/WebPlatformForEmbedded/WPEBackend-rdk"
BUGTRACKER = "https://github.com/WebPlatformForEmbedded/WPEBackend-rdk/issues"

DEPENDS_append = " libwpe glib-2.0"
PROVIDES += "virtual/wpebackend"

RECIPE_BRANCH ?= "master"
PV = "git${SRCPV}"
SRC_URI = "git://github.com/WebPlatformForEmbedded/WPEBackend-rdk.git;branch=${RECIPE_BRANCH};protocol=https"
S = "${WORKDIR}/git"

inherit cmake pkgconfig

# BACKEND has too many flavors to pick on through conventional methods
# By default we'll take wpeframework when compositor is enabled in DISTRO_FEATURES.
# However if that is not available take westeros when wayland is there, if all that is not take the EGLFS for SOC
# which in our case most commonly is RPI
def backendselector(d):
wayland = bb.utils.contains('DISTRO_FEATURES', 'wayland', True, False, d)
compositor = bb.utils.contains('DISTRO_FEATURES', 'compositor', True, False, d)

if compositor == False and wayland == False:
return 'platform'
elif compositor == False and wayland == True:
return 'westeros'
else:
return 'wpeframework'


# Default back end selections. Please override in your machine config using WPE_BACKEND=<> to meet your machine required
WPE_BACKEND_SELECTED = "${@backendselector(d)}"
WPE_BACKEND ??= " ${@bb.utils.contains('WPE_BACKEND_SELECTED', 'platform', '${WPE_BACKEND_PLATFORM}', '${WPE_BACKEND_SELECTED}', d)}"

PACKAGECONFIG ?= "${WPE_BACKEND} virtualinput"

# device specific backends
PACKAGECONFIG[intelce] = "-DUSE_BACKEND_INTEL_CE=ON -DUSE_KEY_INPUT_HANDLING_LINUX_INPUT=ON,,intelce-display"
PACKAGECONFIG[nexus] = "-DUSE_BACKEND_BCM_NEXUS=ON -DUSE_KEY_INPUT_HANDLING_LINUX_INPUT=ON,,broadcom-refsw"
PACKAGECONFIG[rpi] = "-DUSE_BACKEND_BCM_RPI=ON -DUSE_KEY_INPUT_HANDLING_LINUX_INPUT=ON,,userland"
PACKAGECONFIG[stm] = "-DUSE_BACKEND_STM=ON -DUSE_KEY_INPUT_HANDLING_LINUX_INPUT=OFF,,libxkbcommon xkeyboard-config"
PACKAGECONFIG[imx6] = "-DUSE_BACKEND_VIV_IMX6_EGL=ON -DUSE_KEY_INPUT_HANDLING_LINUX_INPUT=ON,,imx-gpu-viv"

# Wayland selectors
PACKAGECONFIG[wayland] = "-DUSE_BACKEND_WAYLAND_EGL=ON -DUSE_KEY_INPUT_HANDLING_LINUX_INPUT=OFF,,wayland libxkbcommon xkeyboard-config"
PACKAGECONFIG[realtek] = "-DUSE_BACKEND_REALTEK=ON -DUSE_KEY_INPUT_HANDLING_LINUX_INPUT=OFF,,wayland libxkbcommon xkeyboard-config"
PACKAGECONFIG[westeros] = "-DUSE_BACKEND_WESTEROS=ON -DUSE_BACKEND_BCM_RPI=OFF -DUSE_KEY_INPUT_HANDLING_LINUX_INPUT=OFF -DUSE_WESTEROS_SINK=ON,,wayland westeros libxkbcommon xkeyboard-config"
PACKAGECONFIG[bcm-weston] = "-DUSE_BACKEND_BCM_NEXUS_WAYLAND=ON,-DUSE_BACKEND_BCM_NEXUS_WAYLAND=OFF,,"
PACKAGECONFIG[westeros-mesa] = "-DUSE_BACKEND_WESTEROS_MESA=ON,,"
PACKAGECONFIG[wpeframework] = "-DUSE_BACKEND_WPEFRAMEWORK=ON -DUSE_KEY_INPUT_HANDLING_LINUX_INPUT=OFF -DUSE_INPUT_LIBINPUT=OFF,,wpeframework-clientlibraries wpeframework-plugins libxkbcommon xkeyboard-config"

# MESA
PACKAGECONFIG[westeros-mesa] = "-DUSE_BACKEND_WESTEROS_MESA=ON,,"

# other switches
PACKAGECONFIG[debug] = "-DCMAKE_BUILD_TYPE=Debug,-DCMAKE_BUILD_TYPE=Release,"
PACKAGECONFIG[libinput] = "-DUSE_INPUT_LIBINPUT=ON,-DUSE_INPUT_LIBINPUT=OFF,libinput,"
PACKAGECONFIG[libinput-udev] = "-DUSE_INPUT_UDEV=ON,-DUSE_INPUT_UDEV=OFF,libinput,"
PACKAGECONFIG[virtualinput] = "-DUSE_VIRTUAL_KEYBOARD=ON,-DUSE_VIRTUAL_KEYBOARD=OFF,wpeframework-clientlibraries,"

do_install() {
install -d ${D}${libdir}
install -m 0755 ${B}/libWPEBackend-*.so ${D}${libdir}/
}

FILES_SOLIBSDEV = ""

FILES_${PN} += "${libdir}/libWPEBackend-default.so ${libdir}/libWPEBackend-rdk.so"
INSANE_SKIP = "dev-so"

# FIXME RDEPENDS on PACKAGECONFIG is not behaving as it should
RDEPENDS_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'wpeframework', 'xkeyboard-config', '', d)}"
RPROVIDES_${PN} += "virtual/wpebackend"
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
From 953a3ede1e8aa23f47ee8c49eccb70184956f426 Mon Sep 17 00:00:00 2001
From: Adrian Perez de Castro <aperez@igalia.com>
Date: Sat, 24 Sep 2022 22:41:22 +0300
Subject: [PATCH] libinput: Add missing xkbcommon/xkbcommon.h header

Signed-off-by: Adrian Perez de Castro <aperez@igalia.com>
[Upstream status: https://github.com/WebPlatformForEmbedded/WPEBackend-rdk/pull/86]
---
src/input/Libinput/LibinputServer.cpp | 1 +
1 file changed, 1 insertion(+)

diff --git a/src/input/Libinput/LibinputServer.cpp b/src/input/Libinput/LibinputServer.cpp
index 0530368..be1e125 100644
--- a/src/input/Libinput/LibinputServer.cpp
+++ b/src/input/Libinput/LibinputServer.cpp
@@ -28,6 +28,7 @@
#include "LibinputServer.h"

#include "KeyboardEventRepeating.h"
+#include <xkbcommon/xkbcommon.h>
#include <cstdio>
#include <fcntl.h>
#include <unistd.h>
--
2.37.3

Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
From 0f18abd62a4c07c2ecdc2d1da55eb9e22123b867 Mon Sep 17 00:00:00 2001
From: Adrian Perez de Castro <aperez@igalia.com>
Date: Sat, 24 Sep 2022 22:42:42 +0300
Subject: [PATCH] cmake: Fix FindWPE module, use imported target

Populate WPE_CFLAGS from the value of PC_WPE_CFLAGS_OTHER, in order
to bring in additional compilation flags defined in the .pc file;
and define WPE_ENABLE_XKB by hand for versions of libwpe <1.14.0.

Using imported targets automatically propagates compilation flags
properly without needing to use additional variables, which is much
less error prone. Targets are good, so is using them more. But fix
them first: with older versions of CMake which do not support global
alias targets, use UNKNOWN IMPORTED GLOBAL to ensure the created
target gets hoisted to the global scope instead of IMPORTED SHARED
because otherwise the target is only visible inside FindWPE.cmake
and its descendants. The CMake scoping rules are... quite something.
Last but not least, only IMPORTED_LOCATION can contain the path of
the library, while INTERFACE_LINK_LIBRARIES can only be used in
interface library targets to declare dependencies on other targets,
so drop the latter. By now we have established that CMake is anything
by confusing.

While at it, add a fallback method to obtain the libwpe version which
reads the values from wpe/version.h for the sake of completeness.

Signed-off-by: Adrian Perez de Castro <aperez@igalia.com>
[Upstream status: https://github.com/WebPlatformForEmbedded/WPEBackend-rdk/pull/86]
---
CMakeLists.txt | 3 +--
cmake/FindWPE.cmake | 53 ++++++++++++++++++++++++++++++++++++++++-----
2 files changed, 48 insertions(+), 8 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 603292e..9f5f48c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -41,15 +41,14 @@ set(WPE_PLATFORM_INCLUDE_DIRECTORIES
"${CMAKE_SOURCE_DIR}/src/util"
${GIO_UNIX_INCLUDE_DIRS}
${GLIB_INCLUDE_DIRS}
- ${WPE_INCLUDE_DIRS}
)

set(WPE_PLATFORM_LIBRARIES
${GLIB_GIO_LIBRARIES}
${GLIB_GOBJECT_LIBRARIES}
${GLIB_LIBRARIES}
- ${WPE_LIBRARIES}
${LIBXKBCOMMON_LIBRARIES}
+ WPE::WPE
)

if (USE_VIRTUAL_KEYBOARD)
diff --git a/cmake/FindWPE.cmake b/cmake/FindWPE.cmake
index 32f24f2..0ea25b4 100644
--- a/cmake/FindWPE.cmake
+++ b/cmake/FindWPE.cmake
@@ -42,12 +42,53 @@ find_path(WPE_INCLUDE_DIRS
HINTS ${PC_WPE_INCLUDEDIR} ${PC_WPE_INCLUDE_DIRS}
)

-find_library(WPE_LIBRARIES
- NAMES ${PC_WPE_LIBRARIES}
- HINTS ${PC_WPE_LIBDIR} ${PC_WPE_LIBRARY_DIRS}
-)
+if(PC_WPE_FOUND)
+ set(WPE_VERSION ${PC_WPE_VERSION} CACHE INTERNAL "")
+ set(WPE_CFLAGS ${PC_WPE_CFLAGS_OTHER})

-mark_as_advanced(WPE_INCLUDE_DIRS WPE_LIBRARIES)
+ find_library(WPE_LIBRARIES
+ NAMES ${PC_WPE_LIBRARIES}
+ HINTS ${PC_WPE_LIBDIR} ${PC_WPE_LIBRARY_DIRS}
+ )
+else()
+ message(FATAL_ERROR "libwpe not found!")
+endif()
+
+if (WPE_INCLUDE_DIR AND NOT WPE_VERSION)
+ if (EXISTS "${WPE_INCLUDE_DIR}/wpe/version.h")
+ file(READ "${WPE_INCLUDE_DIR}/wpe/version.h" WPE_VERSION_CONTENT)
+
+ string(REGEX MATCH "#define +WPE_MAJOR_VERSION +\\(([0-9]+)\\)" _dummy "${WPE_VERSION_CONTENT}")
+ set(WPE_VERSION_MAJOR "${CMAKE_MATCH_1}")
+
+ string(REGEX MATCH "#define +WPE_MINOR_VERSION +\\(([0-9]+)\\)" _dummy "${WPE_VERSION_CONTENT}")
+ set(WPE_VERSION_MINOR "${CMAKE_MATCH_1}")
+
+ string(REGEX MATCH "#define +WPE_MICRO_VERSION +\\(([0-9]+)\\)" _dummy "${WPE_VERSION_CONTENT}")
+ set(WPE_VERSION_PATCH "${CMAKE_MATCH_1}")
+
+ set(WPE_VERSION "${WPE_VERSION_MAJOR}.${WPE_VERSION_MINOR}.${WPE_VERSION_PATCH}")
+ endif ()
+endif ()
+
+# Version 1.12.0 is the last release where XKB support was always present
+if (WPE_VERSION VERSION_LESS_EQUAL 1.12.0)
+ list(APPEND WPE_CFLAGS -DWPE_ENABLE_XKB=1)
+endif ()

include(FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(WPE REQUIRED_VARS WPE_INCLUDE_DIRS WPE_LIBRARIES)
+find_package_handle_standard_args(WPE
+ FOUND_VAR WPE_FOUND
+ REQUIRED_VARS WPE_LIBRARIES WPE_INCLUDE_DIRS
+ VERSION_VAR WPE_VERSION
+)
+mark_as_advanced(WPE_INCLUDE_DIRS WPE_LIBRARIES)
+
+if(WPE_LIBRARIES AND NOT TARGET WPE::WPE)
+ add_library(WPE::WPE UNKNOWN IMPORTED GLOBAL)
+ set_target_properties(WPE::WPE PROPERTIES
+ IMPORTED_LOCATION "${WPE_LIBRARIES}"
+ INTERFACE_COMPILE_OPTIONS "${WPE_CFLAGS}"
+ INTERFACE_INCLUDE_DIRECTORIES "${WPE_INCLUDE_DIRS}"
+ )
+endif()
--
2.37.3

8 changes: 8 additions & 0 deletions recipes-wpe/wpebackend-rdk/wpebackend-rdk_0.1.bb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
require wpebackend-rdk.inc
LICENSE = "BSD"
LIC_FILES_CHKSUM = "file://src/wayland/display.h;;beginline=5;endline=24;md5=b1c8cb6b0857048a21b33611f01c575a"

PV = "0.1+git${SRCPV}"

SRCREV ?= "196f75360b8643b119d8d96208d914998e5d4fc9"

11 changes: 11 additions & 0 deletions recipes-wpe/wpebackend-rdk/wpebackend-rdk_1.0.bb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
require wpebackend-rdk.inc
LICENSE = "BSD"
LIC_FILES_CHKSUM = "file://src/wayland/display.h;;beginline=5;endline=24;md5=b1c8cb6b0857048a21b33611f01c575a"

PV = "1.0+git${SRCPV}"
SRC_URI += "\
file://0001-libinput-Add-missing-xkbcommon-xkbcommon.h-header.patch \
file://0002-cmake-Fix-FindWPE-module-use-imported-target.patch \
"
SRCREV ?= "6083f2b58f6a6e43ed4d51b1489b4d55425bda29"

5 changes: 5 additions & 0 deletions recipes-wpe/wpewebkit/wpewebkit.inc
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ PACKAGECONFIG ?= "\
${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', '' ,d)} \
thunder ${WPE_PLATFORM} \
"

PACKAGECONFIG_append_dunfell = " woff2"

# Mesa only offscreen target support for Westeros backend
Expand Down Expand Up @@ -106,6 +107,10 @@ PACKAGECONFIG[playready] = "-DENABLE_PLAYREADY=ON,-DENABLE_PLAYREADY=OFF,playrea

PACKAGECONFIG[gst_httpsrc] = "-DUSE_GSTREAMER_WEBKIT_HTTP_SRC=ON,,"
PACKAGECONFIG[gst_holepunch] = "-DUSE_HOLE_PUNCH_GSTREAMER=ON -DUSE_GSTREAMER_HOLEPUNCH=ON,,"
PACKAGECONFIG[doc] = "-DENABLE_DOCUMENTATION=ON, -DENABLE_DOCUMENTATION=OFF,,"
PACKAGECONFIG[introspection] = "-DENABLE_INTROSPECTION=ON, -DENABLE_INTROSPECTION=OFF,,"
PACKAGECONFIG[journald_log] = "-DENABLE_JOURNALD_LOG=ON, -DENABLE_JOURNALD_LOG=OFF,,"
PACKAGECONFIG[streamer_native_video] = "-DUSE_GSTREAMER_NATIVE_VIDEO=ON, -DUSE_GSTREAMER_NATIVE_VIDEO=OFF,,"

EXTRA_OECMAKE += "\
-DCMAKE_BUILD_TYPE=Release \
Expand Down
15 changes: 15 additions & 0 deletions recipes-wpe/wpewebkit/wpewebkit_2.38.bb
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
require wpewebkit.inc
DEPENDS_append = " libsoup-3.0"

PV = "2.38+git${SRCPV}"
PR = "r0"
RECIPE_BRANCH ?= "wpe-2.38"
SRC_URI = "\
git://github.com/WebPlatformForEmbedded/WPEWebKit.git;branch=${RECIPE_BRANCH};protocol=https \
"

SRCREV ?= "5ded44c824881b2193a2d7561a851e73d660586a"

PACKAGECONFIG_append_dunfell = " streamer_native_video"
RCONFLICTS_${PN} = "libwpe (< 1.4) wpebackend-fdo (< 1.6)"