Skip to content

Commit

Permalink
Replaced Cog browser with a WPE launcher for running WPEWebKit
Browse files Browse the repository at this point in the history
... based on the new WPE platform API.

* [documentation,ci] Updated related scripts and documentation accordingly.
  • Loading branch information
psaavedra committed Jan 23, 2025
1 parent 0bce12d commit fe719ff
Show file tree
Hide file tree
Showing 19 changed files with 65 additions and 215 deletions.
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
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,33 @@
#! /bin/sh

# export WEBKIT_DISABLE_SANDBOX_THIS_IS_DANGEROUS=1
# export GST_PLUGIN_FEATURE_RANK="avdec_av1:0"
# export GST_DEBUG_DUMP_DOT_DIR=/tmp/gst-out/
# mkdir -p /tmp/gst-out
# chmod 777 /tmp/gst-out

CTL_FILE=/tmp/wpe-exported-wayland

# 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

export GST_PLUGIN_FEATURE_RANK="avdec_av1:0"

export "$(strings < /proc/"$(pidof weston-keyboard)"/environ | grep WAYLAND_DISPLAY)"
export "$(strings < /proc/"$(pidof weston-keyboard)"/environ | grep XDG_RUNTIME_DIR)"

for arg in "$@"; do
if [ "$arg" = "--maximized" ]; then
echo "maximized" > ${CTL_FILE}
fi
done

if [ "root" = "$(whoami)" ]; then
su weston -c "/usr/bin/wpe-simple-launcher ${CTL_FILE}"
else
/usr/bin/wpe-simple-launcher "${CTL_FILE}"
fi

echo "${arg}" > ${CTL_FILE}
12 changes: 11 additions & 1 deletion recipes-browser/wpe-simple-launcher/wpe-simple-launcher_git.bb
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
DESCRIPTION = "Simple WPE-based web launcher"

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

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

Expand All @@ -7,7 +10,10 @@ inherit meson pkgconfig
DEPENDS = "glib-2.0-native wpewebkit"

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

S = "${WORKDIR}/git"

Expand All @@ -16,4 +22,8 @@ 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"
2 changes: 0 additions & 2 deletions recipes-core/images/core-image-weston-wpe.bb
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ 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
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import sys
import time

## vars ########################################################################
launcher = 'cog'
launcher = 'wpe-simple-launcher'
urls = 'urls.conf'

## functions ###################################################################
Expand Down Expand Up @@ -54,7 +54,8 @@ if __name__ == "__main__":
lines = f.readlines()

try:
os.system("%s %s &" % (launcher, lines[0].split()[0]))
os.system("%s /tmp/wpe-demo-run" % launcher)
os.system("echo maximized > /tmp/wpe-demo-run" % lines[0].split()[0])
except Exception as e:
print("Error parsing first line: %s" % e)
sys.exit(2)
Expand All @@ -66,7 +67,7 @@ if __name__ == "__main__":
entry = l.split()
url = entry[0]
duration = entry[1]
call("%s-ctl open %s" % (launcher, url))
call("echo %s > /tmp/wpe-demo-run" % (launcher, url))
time.sleep(int(duration))
counter += 1
except Exception as e:
Expand Down
Loading

0 comments on commit fe719ff

Please sign in to comment.