Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add wpe simple launcher #23

Merged
merged 7 commits into from
Jan 25, 2025
Merged
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
Binary file modified .ci/robot_framework/images/pinch-gesture.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified .ci/robot_framework/images/zoom-gesture.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion .ci/robot_framework/libs/TestUtils.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def ssh_command_in_background(self, ip, command):
def ssh_force_kill(self, ip, text):
"""Force kill all related process."""
print(f"RUN: Killing all '{text}' related processes ...")
command = f"pgrep {text} && pgrep {text} | xargs kill -9 || echo '{text} not running'"
command = f"pgrep -f {text} && pgrep -f {text} | xargs kill -9 || echo '{text} not running'"
return self.ssh_command(ip, command, quiet=True)

def ssh_reboot_force_reboot(self, ip):
Expand Down
6 changes: 3 additions & 3 deletions .ci/robot_framework/tests/keywords_common.robot
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,12 @@ Webdriver Remote Start

# Force kill previous launchers
SSH Webdriver Remote Stop ${TEST_BOARD_IP}
SSH Force Kill ${TEST_BOARD_IP} cog
SSH Force Kill ${TEST_BOARD_IP} wpe-simple-launcher

SSH Webdriver Remote Start ${TEST_BOARD_IP} ${TEST_BOARD_WEBDRIVER_PORT}
Sleep 5

${wpe_options} = Create WPEWebKitOptions cog /usr/bin/cog-fdo-exported-wayland --automation @{other_params}
${wpe_options} = Create WPEWebKitOptions wpe-simple-launcher /usr/bin/wpe-exported-wayland --automation @{other_params}
Create Webdriver Remote command_executor=${TEST_BOARD_IP}:${TEST_BOARD_WEBDRIVER_PORT} options=${wpe_options}

Webdriver Remote Stop
Expand All @@ -73,4 +73,4 @@ Webdriver Remote Stop

Close All Browsers
SSH Webdriver Remote Stop ${TEST_BOARD_IP}
SSH Force Kill ${TEST_BOARD_IP} cog
SSH Force Kill ${TEST_BOARD_IP} wpe-simple-launcher
2 changes: 1 addition & 1 deletion .ci/robot_framework/tests/tests_011_navigation_bar.robot
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ ${HOME_SCREEN_IMAGE} home-screen.png
${SEARCH_SCREEN_IMAGE} search-screen.png

*** Settings ***
Test Timeout 60 seconds
Test Timeout 120 seconds

Suite Setup Configure Mockup Pages

Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,10 @@ CXX=arm-poky-linux-gnueabi-g++ ...
...
```

## Running Cog browser:
## Running WPE launcher:

* Cog with FDO backend in Weston: `/usr/bin/cog-fdo-exported-wayland https://wpewebkit.org`
* Cog with DRM backend directly in framebuffer: `/usr/bin/cog-drm-kill-weston https://wpewebkit.org`
* WPE with FDO backend in Weston: `/usr/bin/wpe-exported-wayland https://wpewebkit.org`
* WPE with DRM backend directly in framebuffer: `export WPE_DISPLAY="wpe-display-drm"; /usr/bin/wpe-exported-wayland https://wpewebkit.org`

All this commands will execute the browsers as `weston` user.

Expand Down
42 changes: 0 additions & 42 deletions recipes-browser/cog/cog_0.18.%.bbappend

This file was deleted.

This file was deleted.

3 changes: 0 additions & 3 deletions recipes-browser/cog/files/cog-drm

This file was deleted.

3 changes: 0 additions & 3 deletions recipes-browser/cog/files/cog-drm-kill-weston

This file was deleted.

30 changes: 0 additions & 30 deletions recipes-browser/cog/files/cog-fdo

This file was deleted.

5 changes: 0 additions & 5 deletions recipes-browser/cog/files/cog-fdo-ctl

This file was deleted.

12 changes: 0 additions & 12 deletions recipes-browser/cog/files/cog-fdo-exported-wayland

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash
CTL_FILE=/tmp/wpe-exported-wayland

echo "$@" > ${CTL_FILE}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/bin/sh

# Disable sandboxing for WebKit (dangerous, use with caution)
# export WEBKIT_DISABLE_SANDBOX_THIS_IS_DANGEROUS=1

# Lower rank of AV1 decoder to disable it
export GST_PLUGIN_FEATURE_RANK="avdec_av1:0"

# Set directory for GStreamer debug output
# export GST_DEBUG_DUMP_DOT_DIR=/tmp/gst-out/
# mkdir -p /tmp/gst-out
# chmod 777 /tmp/gst-out

# Temporary file to store Wayland control data
CTL_FILE="/tmp/wpe-exported-wayland"

# Enable DMA-BUF video sink in WebKit for efficient rendering.
# WebKitDMABufVideoSink sink that is able to accept decode
# dmabuf or raw data in a range of RGB-like or YUV formats.
# Bug: https://bugs.webkit.org/show_bug.cgi?id=279819
export WEBKIT_GST_DMABUF_SINK_ENABLED=1

# Ensure Wayland and XDG runtime environment variables are propagated
WAYLAND_DISPLAY=$(strings < "/proc/$(pidof weston-keyboard)/environ" | grep WAYLAND_DISPLAY)
XDG_RUNTIME_DIR=$(strings < "/proc/$(pidof weston-keyboard)/environ" | grep XDG_RUNTIME_DIR)
export "${WAYLAND_DISPLAY?}"
export "${XDG_RUNTIME_DIR?}"

# Check if the script is run as root and switch to the 'weston' user if needed
if [ "$(whoami)" = "root" ]; then
su weston -c "echo done > $CTL_FILE"
su weston -c "/usr/bin/wpe-simple-launcher --ctrl $CTL_FILE $*"
else
echo "done" > "$CTL_FILE"
/usr/bin/wpe-simple-launcher --ctrl "$CTL_FILE" "$@"
fi
29 changes: 29 additions & 0 deletions recipes-browser/wpe-simple-launcher/wpe-simple-launcher_git.bb
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
DESCRIPTION = "Simple WPE-based web launcher"

FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"

LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://LICENSE;md5=dd93f6e0496294f589c3d561f96ffee4"

inherit meson pkgconfig

DEPENDS = "glib-2.0-native wpewebkit"

SRCREV = "3bce76d2957527424c4e6c544b325321e39d0bda"
SRC_URI = "git://[email protected]/psaavedra/wpe-simple-launcher.git;protocol=ssh;branch=main \
file://wpe-ctl \
file://wpe-exported-wayland \
"

S = "${WORKDIR}/git"

EXTRA_OECMAKE = ""

do_install:append () {
install -d ${D}/${bindir}/
install -m 755 ${B}/wpe-simple-launcher ${D}/${bindir}/wpe-simple-launcher
install -m 755 ${WORKDIR}/wpe-ctl ${D}/${bindir}/wpe-ctl
install -m 755 ${WORKDIR}/wpe-exported-wayland ${D}/${bindir}/wpe-exported-wayland
}

RDEPENDS:${PN} += "bash"
5 changes: 2 additions & 3 deletions recipes-core/images/core-image-weston-wpe.bb
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
DESCRIPTION = "core-image-weston with Cog/WPEWebKit"
DESCRIPTION = "core-image-weston with WPEWebKit"

inherit image_browsers image_weston

IMAGE_INSTALL:append = " \
cog \
wpebackend-fdo \
wpewebkit \
wpe-simple-launcher \
python3-uinput \
"

Expand Down
4 changes: 1 addition & 3 deletions recipes-graphics/wayland/files/demo-wpe-duckduckgo
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
#!/bin/bash
/usr/bin/kill-demo
export COG_PLATFORM_WL_VIEW_WIDTH=$(journalctl -b | grep weston | grep current | cut -f 1 -d '@' | awk '{ print $6 }' | cut -d 'x' -f 1 | tail -n 1)
export COG_PLATFORM_WL_VIEW_HEIGHT=$(journalctl -b | grep weston | grep current | cut -f 1 -d '@' | awk '{ print $6 }' | cut -d 'x' -f 2 | tail -n 1)
export WEBKIT_SHOW_FPS=0 GALLIUM_HUD_TOGGLE_SIGNAL=10 GALLIUM_HUD_VISIBLE=0 GALLIUM_HUD=cpu+fps
/usr/bin/cog-fdo-exported-wayland https://duckduckgo.com/
/usr/bin/wpe-exported-wayland --maximized https://duckduckgo.com/
4 changes: 1 addition & 3 deletions recipes-graphics/wayland/files/demo-wpe-website
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
#!/bin/bash
/usr/bin/kill-demo
export COG_PLATFORM_WL_VIEW_WIDTH=$(journalctl -b | grep weston | grep current | cut -f 1 -d '@' | awk '{ print $6 }' | cut -d 'x' -f 1 | tail -n 1)
export COG_PLATFORM_WL_VIEW_HEIGHT=$(journalctl -b | grep weston | grep current | cut -f 1 -d '@' | awk '{ print $6 }' | cut -d 'x' -f 2 | tail -n 1)
export WEBKIT_SHOW_FPS=0 GALLIUM_HUD_TOGGLE_SIGNAL=10 GALLIUM_HUD_VISIBLE=0 GALLIUM_HUD=cpu+fps
/usr/bin/cog-fdo-exported-wayland https://www.wpewebkit.org
/usr/bin/wpe-exported-wayland --maximized https://www.wpewebkit.org
2 changes: 1 addition & 1 deletion recipes-graphics/wayland/files/kill-demo
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#! /bin/bash
/usr/bin/pkill -9 -f "cog"
/usr/bin/pkill -9 -f "wpe-simple-launcher"
/usr/bin/pkill -9 -O 1 -f "demo"

6 changes: 3 additions & 3 deletions recipes-graphics/wayland/files/weston.ini
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ path=/usr/bin/false
[launcher]
icon=/usr/share/go-next-symbolic-rtl.symbolic.png
displayname=Previous page
path=/usr/bin/cog-fdo-ctl previous
path=/usr/bin/wpe-ctl back

[launcher]
icon=/usr/share/24x24-blank.png
Expand All @@ -112,7 +112,7 @@ path=/usr/bin/false
[launcher]
icon=/usr/share/go-next-symbolic.symbolic.png
displayname=Next page
path=/usr/bin/cog-fdo-ctl next
path=/usr/bin/wpe-ctl forward

[launcher]
icon=/usr/share/24x24-blank.png
Expand All @@ -122,7 +122,7 @@ path=/usr/bin/false
[launcher]
icon=/usr/share/view-refresh-symbolic.symbolic.png
displayname=Page reload
path=/usr/bin/cog-fdo-ctl reload
path=/usr/bin/wpe-ctl reload

[launcher]
icon=/usr/share/24x24-blank.png
Expand Down
Loading
Loading