-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
wpe-demos: Add WPE Demos Recipe and Integrate with Core Image
* Created a new recipe `wpe-demos.bb` to install multiple WPEWebKit demos, including SVG and video demos. * Added scripts for demo execution: `demo-videos-wolvic`, `demo-wpe-svg-tiger`, and `demo-wpe-svg-toggler`. * Included icons for each demo in the `wpe-demos` package. * Updated `core-image-weston-wpe.bb` to include the new demo packages: `wpe-demos-videos-wolvic`, `wpe-demos-svg-tiger`, and `wpe-demos-svg-toggler`. * Implemented a post-processing command to replace the default Apache2 htdocs with the demo directory. * Ensured proper ownership of the demo directory by the `weston` user.
- Loading branch information
Showing
8 changed files
with
131 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
SUMMARY = "Multiple WPE demo" | ||
DESCRIPTION = "This recipe installs multiple WPEWebKit demos" | ||
|
||
LICENSE = "MIT" | ||
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" | ||
|
||
FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" | ||
|
||
DEPENDS += "python3" | ||
|
||
HOSTTOOLS += "ffmpeg" | ||
|
||
SRC_URI = " \ | ||
file://bin/ \ | ||
file://htdocs/ \ | ||
file://icons/ \ | ||
" | ||
|
||
# demo-videos-wolvic | ||
SRC_URI:append = " git://gitlab.igalia.com/teams/core/misc/demo-wolvic-videos.git;branch=main;protocol=https;name=demo-videos-wolvic;destsuffix=${S}/htdocs/demo-videos-wolvic" | ||
SRCREV_demo-videos-wolvic = "${AUTOREV}" | ||
|
||
S = "${WORKDIR}" | ||
|
||
PACKAGES = "${PN}-svg-tiger ${PN}-svg-toggler ${PN}-videos-wolvic" | ||
|
||
FILES:${PN}-svg-tiger = " \ | ||
/usr/bin/demo-wpe-svg-tiger \ | ||
/mnt/wpe-demos/demo-wpe-svg-tiger/ \ | ||
/mnt/install/icons/demo-wpe-svg-tiger.png \ | ||
" | ||
|
||
FILES:${PN}-svg-toggler = " \ | ||
/usr/bin/demo-wpe-svg-toggler \ | ||
" | ||
|
||
FILES:${PN}-videos-wolvic = " \ | ||
/usr/bin/demo-videos-wolvic \ | ||
/mnt/wpe-demos/demo-videos-wolvic/ \ | ||
/mnt/install/icons/demo-videos-wolvic.png \ | ||
" | ||
|
||
RDEPENDS:${PN}-svg-toggler = "bash" | ||
RDEPENDS:${PN}-videos-wolvic = "perl" | ||
|
||
python do_fetch:append() { | ||
import os | ||
import subprocess | ||
|
||
s_path = d.getVar('S') | ||
demo_videos_dir = os.path.join(s_path, "demo-videos-wolvic") | ||
download_script = os.path.join(s_path, "htdocs", "demo-videos-wolvic", "download.py") | ||
os.makedirs(demo_videos_dir, exist_ok=True) | ||
|
||
if os.path.isfile(download_script): | ||
try: | ||
subprocess.check_call(["python3", download_script], | ||
cwd=os.path.dirname(download_script)) | ||
videos_dir = os.path.join(os.path.dirname(download_script), | ||
"videos") | ||
if os.path.isdir(videos_dir): | ||
subprocess.check_call(["mv", videos_dir, demo_videos_dir]) | ||
except subprocess.CalledProcessError as e: | ||
bb.fatal(f"Failed to execute {download_script}: {e}") | ||
} | ||
|
||
do_install() { | ||
install -d ${D}${bindir} | ||
install -m 0755 ${WORKDIR}/bin/demo-* ${D}${bindir}/ | ||
|
||
install -d ${D}/mnt/wpe-demos/ | ||
cp -r ${WORKDIR}/htdocs/demo-videos-wolvic ${D}/mnt/wpe-demos/ | ||
cp -r ${WORKDIR}/demo-videos-wolvic/videos ${D}/mnt/wpe-demos/demo-videos-wolvic/ | ||
cp -r ${WORKDIR}/htdocs/demo-wpe-svg-tiger ${D}/mnt/wpe-demos/ | ||
|
||
install -d ${D}/mnt/install/icons/ | ||
install -m 644 ${WORKDIR}/icons/demo-videos-wolvic.png ${D}/mnt/install/icons/ | ||
install -m 644 ${WORKDIR}/icons/demo-wpe-svg-tiger.png ${D}/mnt/install/icons/ | ||
} |
12 changes: 12 additions & 0 deletions
12
recipes-browser/wpe-demos/wpe-demos/bin/demo-videos-wolvic
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/bin/sh | ||
|
||
/usr/bin/kill-demo | ||
|
||
export WEBKIT_INSPECTOR_SERVER=0.0.0.0:12321 | ||
#export WAYLAND_DEBUG=1 | ||
|
||
export WEBKIT_SHOW_FPS=0 | ||
export GALLIUM_HUD_TOGGLE_SIGNAL=10 GALLIUM_HUD_VISIBLE=0 GALLIUM_HUD=cpu+fps | ||
export LAYER_BASED_SVG_ENGINE_TOGGLER=/mnt/wpe-demos/LAYER_BASED_SVG_ENGINE_TOGGLER | ||
|
||
/usr/bin/wpe-exported-wayland --maximize 'http://localhost/wpe-demos/demo-videos-wolvic/index.html' |
12 changes: 12 additions & 0 deletions
12
recipes-browser/wpe-demos/wpe-demos/bin/demo-wpe-svg-tiger
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/bin/sh | ||
|
||
/usr/bin/kill-demo | ||
|
||
export WEBKIT_INSPECTOR_SERVER=0.0.0.0:12321 | ||
#export WAYLAND_DEBUG=1 | ||
|
||
export WEBKIT_SHOW_FPS=0 | ||
export GALLIUM_HUD_TOGGLE_SIGNAL=10 GALLIUM_HUD_VISIBLE=0 GALLIUM_HUD=cpu+fps | ||
export LAYER_BASED_SVG_ENGINE_TOGGLER=/mnt/wpe-demos/LAYER_BASED_SVG_ENGINE_TOGGLER | ||
|
||
/usr/bin/wpe-exported-wayland --maximize http://localhost/wpe-demos/demo-wpe-svg-tiger/igalia.html |
13 changes: 13 additions & 0 deletions
13
recipes-browser/wpe-demos/wpe-demos/bin/demo-wpe-svg-toggler
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/bin/bash | ||
|
||
TOGGLER=/mnt/wpe-demos/LAYER_BASED_SVG_ENGINE_TOGGLER | ||
|
||
if [ -f "$TOGGLER" ] | ||
then | ||
rm $TOGGLER | ||
else | ||
touch $TOGGLER | ||
fi | ||
|
||
/usr/bin/wpe-ctl reload | ||
|
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters