Merge branch 'next'
[AGL/meta-agl-demo.git] / recipes-graphics / web-runtime / web-runtime / web-runtime
index 80685eb..39f3781 100755 (executable)
@@ -1,2 +1,18 @@
-#!/bin/sh
-exec /usr/bin/qt5/qmlscene "$1" /usr/bin/web-runtime.qml
+#!/bin/bash
+export -n QT_WAYLAND_SHELL_INTEGRATION
+port=$(echo -n "$1" | sed 's,.*local.*:\([^/]*\)/.*,\1,')
+token=$(echo -n "$1" | sed 's,.*token=,,')
+export AFM_APP_INSTALL_DIR=$(mktemp -d)
+cat << EOC >  $AFM_APP_INSTALL_DIR/runxdg.toml
+[application]
+role = "WebBrowser"
+method = "POSIX"
+path = "/usr/bin/qt5/qmlscene"
+params = [
+     "$1",
+     "/usr/bin/web-runtime.qml"
+]
+EOC
+export LD_PRELOAD=/usr/lib/libEGL.so
+/usr/bin/runxdg "$port" "$token"
+rm -rf $AFM_APP_INSTALL_DIR