-
Notifications
You must be signed in to change notification settings - Fork 53
/
0001-port-wpelauncher-from-stable.patch
executable file
·194 lines (194 loc) · 4.76 KB
/
0001-port-wpelauncher-from-stable.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
diff --git a/package/wpe/Config.in b/package/wpe/Config.in
index c5a84398ab..356fb2b017 100644
--- a/package/wpe/Config.in
+++ b/package/wpe/Config.in
@@ -7,4 +7,5 @@ source "package/wpe/wpewebkit/Config.in"
if BR2_PACKAGE_WPEWEBKIT
source "package/wpe/wpebackend/Config.in"
source "package/wpe/wpebackend-rdk/Config.in"
+source "package/wpe/wpelauncher/Config.in"
endif
diff --git a/package/wpe/wpelauncher/Config.in b/package/wpe/wpelauncher/Config.in
new file mode 100644
index 0000000000..974345b520
--- /dev/null
+++ b/package/wpe/wpelauncher/Config.in
@@ -0,0 +1,5 @@
+config BR2_PACKAGE_WPELAUNCHER
+ bool "wpelauncher"
+ depends on BR2_PACKAGE_WPEWEBKIT
+ help
+ WPE WebKit launcher app (will be deprecated soon).
diff --git a/package/wpe/wpelauncher/S90wpe b/package/wpe/wpelauncher/S90wpe
new file mode 100644
index 0000000000..dd83fb8a0c
--- /dev/null
+++ b/package/wpe/wpelauncher/S90wpe
@@ -0,0 +1,46 @@
+#!/bin/sh
+
+WPE_URL_FILE="/boot/wpe.txt"
+
+start() {
+ echo -n "Starting WPE: "
+ if [ -e "$WPE_URL_FILE" ]; then
+ URL=`head -1 $WPE_URL_FILE`
+ if [ -n "$URL" ]; then
+ /usr/bin/wpe --loop $URL &> /dev/null &
+ echo "OK"
+ else
+ echo "NO URL"
+ fi
+ else
+ echo "NO FILE"
+ fi
+}
+
+stop() {
+ echo -n "Stopping WPE: "
+ killall wpe WPELauncher WPEWebProcess WPENetworkProcess &> /dev/null
+ echo "OK"
+}
+
+restart() {
+ stop
+ start
+}
+
+case "$1" in
+ start)
+ start
+ ;;
+ stop)
+ stop
+ ;;
+ restart|reload)
+ restart
+ ;;
+ *)
+ echo "Usage: $0 {start|stop|restart}"
+ exit 1
+esac
+
+exit $?
diff --git a/package/wpe/wpelauncher/wpe b/package/wpe/wpelauncher/wpe
new file mode 100644
index 0000000000..c4f9cc7c72
--- /dev/null
+++ b/package/wpe/wpelauncher/wpe
@@ -0,0 +1,58 @@
+#!/bin/sh
+
+# Enable cookie persistent storage
+export WPE_SHELL_COOKIE_STORAGE=1
+
+# FIXME: gst-gl's dispmanx backend is messing up with our compositor
+# when it creates its initial 16x16px surface.
+export GST_GL_WINDOW=dummy
+
+# Use cairo noaa compositor
+export CAIRO_GL_COMPOSITOR=noaa
+
+# WebInspector
+export WEBKIT_INSPECTOR_SERVER=0.0.0.0:9998
+
+# FPS
+#export WPE_THREADED_COMPOSITOR_FPS=1
+
+# RPI mouse support
+#export WPE_BCMRPI_CURSOR=1
+
+# RPI touch support
+#export WPE_BCMRPI_TOUCH=1
+
+WPE_UPDATE="/usr/bin/wpe-update"
+if [ -e "$WPE_UPDATE" ];
+then
+ WPE_UPDATE_RESULT=$($WPE_UPDATE)
+fi
+
+#export TZ=$(wget -qO- http://jsonip.metrological.com/ | sed -e 's/^.*"tz":"\([^"]*\)".*$/\1/')
+
+WPE_CONF_FILE="/boot/wpe.conf"
+WPE_CONFIG=""
+if [ -e "$WPE_CONF_FILE" ];
+then
+ WPE_CONFIG=$(grep -v '^#' $WPE_CONF_FILE | tr -d "\r" | tr "\n" " " | tr -s " ")
+fi
+
+# Core dumps
+#echo 1 > /proc/sys/kernel/core_uses_pid
+#echo 2 > /proc/sys/fs/suid_dumpable
+#echo "/root/cores/core-pid_%p--process%E" > /proc/sys/kernel/core_pattern
+#mkdir -p /root/cores
+#ulimit -c unlimited
+
+# The PREFIX env var can be useful when debugging athol/WPELauncher with gdbserver.
+if [ "$1" = "--loop" ];
+then
+ export HOME=/root
+ mkdir -p $HOME
+ while true;
+ do
+ cd /root && eval "$WPE_CONFIG $PREFIX WPELauncher \"$2\""
+ done
+else
+ cd /root && eval "$WPE_CONFIG $PREFIX WPELauncher \"$1\""
+fi
diff --git a/package/wpe/wpelauncher/wpe.conf b/package/wpe/wpelauncher/wpe.conf
new file mode 100644
index 0000000000..61eee54771
--- /dev/null
+++ b/package/wpe/wpelauncher/wpe.conf
@@ -0,0 +1,11 @@
+# WebInspector
+WEBKIT_INSPECTOR_SERVER=0.0.0.0:9998
+
+# FPS
+WPE_THREADED_COMPOSITOR_FPS=1
+
+# RPI mouse support
+#WPE_BCMRPI_CURSOR=1
+
+# Timezone
+#TZ=CET-1CEST,M3.5.0,M10.5.0/3
diff --git a/package/wpe/wpelauncher/wpe.txt b/package/wpe/wpelauncher/wpe.txt
new file mode 100644
index 0000000000..234eeefe9b
--- /dev/null
+++ b/package/wpe/wpelauncher/wpe.txt
@@ -0,0 +1 @@
+http://youtube.com/tv
diff --git a/package/wpe/wpelauncher/wpelauncher.mk b/package/wpe/wpelauncher/wpelauncher.mk
new file mode 100644
index 0000000000..49b2de7e0a
--- /dev/null
+++ b/package/wpe/wpelauncher/wpelauncher.mk
@@ -0,0 +1,27 @@
+###############################################################################
+#
+# WPELauncher
+#
+################################################################################
+
+WPELAUNCHER_VERSION = 371d4b0bcd96723d1d8383317c365f0935be3023
+WPELAUNCHER_SITE = $(call github,WebPlatformForEmbedded,WPEWebKitLauncher,$(WPELAUNCHER_VERSION))
+
+WPELAUNCHER_DEPENDENCIES = wpewebkit
+
+define WPELAUNCHER_BINS
+ $(INSTALL) -D -m 0644 package/wpe/wpelauncher/wpe.{txt,conf} $(BINARIES_DIR)/
+ $(INSTALL) -D -m 0755 package/wpe/wpelauncher/wpe $(TARGET_DIR)/usr/bin
+endef
+
+define WPELAUNCHER_AUTOSTART
+ $(INSTALL) -D -m 0755 package/wpe/wpelauncher/S90wpe $(TARGET_DIR)/etc/init.d
+endef
+
+WPELAUNCHER_POST_INSTALL_TARGET_HOOKS += WPELAUNCHER_BINS
+
+ifeq ($(BR2_PACKAGE_PLUGIN_WEBKITBROWSER),)
+WPELAUNCHER_POST_INSTALL_TARGET_HOOKS += WPELAUNCHER_AUTOSTART
+endif
+
+$(eval $(cmake-package))