Title: [233362] trunk
Revision
233362
Author
[email protected]
Date
2018-06-29 10:47:17 -0700 (Fri, 29 Jun 2018)

Log Message

[GTK][WPE]: Add a way to setup our development environment inside flatpak
https://bugs.webkit.org/show_bug.cgi?id=186771

Patch by Thibault Saunier <[email protected]> on 2018-06-29
Reviewed by Carlos Alberto Lopez Perez.

Tools:

This patch introduce a way to setup the development environment inside flatpak[0]
removing the need for jhbuild when doing so. Anything needed to build/run minibrowser/ run
layout tests is provided either but the org.gnome.Sdk runtime or built with flatpak-builder.

The workflow is very similar to the "jhbuild based" one except that you should use update-webkit$PORTNAME-flatpak instead
of update-webkit$PORTNAME-libs and that script requires to specify a build configuration (--release is default).

Our scripts have been updated to be able to run inside that new build environment.

Since everything runs inside a flatpak sandbox, gdb needs to be run from within the sandbox, the script exposes a way to do it
easily with the `--gdb` option:

  $ webkit-flatpak --gdb [-m COREDUMPCTL MATCHES]

The Layout test `GDBCrashLogGenerator` has been taugth how to use that and is able to retrieve stacktrace as with the jhbuild based workflow.

[0] http://flatpak.org

* Scripts/build-webkit:
* Scripts/generate-jsc-bundle:
(main):
* Scripts/run-gtk-tests:
* Scripts/run-minibrowser:
* Scripts/run-webdriver-tests:
* Scripts/run-webkit-tests:
* Scripts/run-wpe-tests:
* Scripts/update-webkitgtk-libs:
* Scripts/update-webkitwpe-libs:
* Scripts/webkit-flatpak: Added.
* Scripts/webkitdirs.pm:
(getJhbuildPath):
(getFlatpakPath):
(inFlatpakSandbox):
(runInFlatpak):
(runInFlatpakIfAvalaible):
(wrapperPrefixIfNeeded):
(shouldUseFlatpak):
* Scripts/webkitpy/port/base.py:
(Port._path_to_apache):
(Port._is_flatpak):
(Port._apache_config_file_name_for_platform):
(Port._should_use_flatpak):
(Port):
(Port._in_flatpak_sandbox):
(Port._should_use_jhbuild):
* Scripts/webkitpy/port/gtk.py:
(GtkPort.setup_environ_for_server):
* Scripts/webkitpy/port/linux_get_crash_log.py:
(GDBCrashLogGenerator._get_trace_from_systemd):
(GDBCrashLogGenerator.generate_crash_log):
* Scripts/webkitpy/port/wpe.py:
(WPEPort.setup_environ_for_server):
* Scripts/webkitpy/w3c/wpt_runner.py:
(main):
* flatpak/files/default.xkm: Added.
* flatpak/files/httpd-autogen.sh: Added.
* flatpak/flatpakutils.py: Added.
(Colors):
(Console):
(Console.message):
(remove_extension_points):
(remove_comments):
(remove_comments._replacer):
(load_manifest):
(expand_manifest):
(FlatpakObject):
(FlatpakObject.__init__):
(FlatpakObject.flatpak):
(FlatpakPackages):
(FlatpakPackages.__init__):
(FlatpakPackages.__detect_packages):
(FlatpakPackages.__detect_packages.in):
(FlatpakPackages.__detect_runtimes):
(FlatpakPackages.__detect_apps):
(FlatpakPackages.__iter__):
(FlatpakRepos):
(FlatpakRepos.__init__):
(FlatpakRepos.update):
(FlatpakRepos.add):
(FlatpakRepo):
(FlatpakRepo.__init__):
(FlatpakRepo.repo_file):
(FlatpakPackage):
(FlatpakPackage.__init__):
(FlatpakPackage.__str__):
(FlatpakPackage.is_installed):
(FlatpakPackage.install):
(FlatpakPackage.update):
(WebkitFlatpak):
(WebkitFlatpak.load_from_args):
(WebkitFlatpak.__init__):
(WebkitFlatpak.check_flatpak):
(WebkitFlatpak.check_flatpak.comparable_version):
(WebkitFlatpak.clean_args):
(WebkitFlatpak.run_in_sandbox):
(WebkitFlatpak.run):
(WebkitFlatpak.has_environment):
(WebkitFlatpak.setup_dev_env):
(WebkitFlatpak.install_all):
(WebkitFlatpak.run_gdb):
(WebkitFlatpak.update_all):
(is_sandboxed):
(run_in_sandbox_if_available):
* flatpak/org.webkit.GTK.yaml: Added.
* flatpak/org.webkit.WPE.yaml: Added.
* flatpak/org.webkit.WebKit.yaml: Added.
* flatpak/patches/httpd-0001-configure-use-pkg-config-for-PCRE-detection.patch: Added.
* flatpak/patches/xvfb-0001-HACK-Avoid-compiling-a-kbm-file.patch: Added.

LayoutTests:

* http/conf/flatpak-httpd.conf: Added. Apache configuration file to be used inside flaptak.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (233361 => 233362)


--- trunk/LayoutTests/ChangeLog	2018-06-29 17:42:00 UTC (rev 233361)
+++ trunk/LayoutTests/ChangeLog	2018-06-29 17:47:17 UTC (rev 233362)
@@ -1,3 +1,12 @@
+2018-06-29  Thibault Saunier  <[email protected]>
+
+        [GTK][WPE]: Add a way to setup our development environment inside flatpak
+        https://bugs.webkit.org/show_bug.cgi?id=186771
+
+        Reviewed by Carlos Alberto Lopez Perez.
+
+        * http/conf/flatpak-httpd.conf: Added. Apache configuration file to be used inside flaptak.
+
 2018-06-29  David Fenton  <[email protected]>
 
         Unreviewed, rolling out r233349.

Added: trunk/LayoutTests/http/conf/flatpak-httpd.conf (0 => 233362)


--- trunk/LayoutTests/http/conf/flatpak-httpd.conf	                        (rev 0)
+++ trunk/LayoutTests/http/conf/flatpak-httpd.conf	2018-06-29 17:47:17 UTC (rev 233362)
@@ -0,0 +1,153 @@
+ServerTokens OS
+ServerRoot "/app/"
+
+PidFile "/tmp/WebKit/httpd.pid"
+ScoreBoardFile "/tmp/WebKit/httpd.scoreboard"
+
+Timeout 300
+KeepAlive On
+MaxKeepAliveRequests 100
+KeepAliveTimeout 15
+
+MinSpareServers 1
+MaxSpareServers 5
+StartServers 1
+MaxClients 150
+MaxRequestsPerChild 100000
+
+LoadModule mpm_prefork_module   modules/mod_mpm_prefork.so
+LoadModule authz_core_module    modules/mod_authz_core.so
+LoadModule authz_host_module    modules/mod_authz_host.so
+LoadModule include_module       modules/mod_include.so
+LoadModule headers_module       modules/mod_headers.so
+LoadModule mime_module          modules/mod_mime.so
+LoadModule negotiation_module   modules/mod_negotiation.so
+LoadModule actions_module       modules/mod_actions.so
+LoadModule alias_module         modules/mod_alias.so
+LoadModule rewrite_module       modules/mod_rewrite.so
+LoadModule unixd_module         modules/mod_unixd.so
+LoadModule cgi_module           modules/mod_cgi.so
+#LoadModule access_compat_module modules/mod_access_compat.so
+LoadModule log_config_module    modules/mod_log_config.so
+#LoadModule imagemap_module      modules/mod_imagemap.so
+LoadModule ssl_module           modules/mod_ssl.so
+LoadModule php7_module          modules/libphp7.so
+LoadModule asis_module          modules/mod_asis.so
+
+ServerName 127.0.0.1
+
+<Directory />
+    Options Indexes FollowSymLinks MultiViews ExecCGI Includes
+    AllowOverride All
+    Require all granted
+</Directory>
+
+AccessFileName .htaccess
+
+<Files ~ "^\.([Hh][Tt]|[Dd][Ss]_[Ss])">
+    Require all denied
+</Files>
+
+UseCanonicalName On
+HostnameLookups Off
+
+TypesConfig /etc/mime.types
+
+LogLevel warn
+LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
+LogFormat "%h %l %u %t \"%r\" %>s %b" common
+LogFormat "%{Referer}i -> %U" referer
+LogFormat "%{User-agent}i" agent
+ErrorLog /tmp/WebKit/error_log
+
+ServerSignature On
+
+AddLanguage ca .ca
+AddLanguage cs .cz .cs
+AddLanguage da .dk
+AddLanguage de .de
+AddLanguage el .el
+AddLanguage en .en
+AddLanguage eo .eo
+AddLanguage es .es
+AddLanguage et .et
+AddLanguage fr .fr
+AddLanguage he .he
+AddLanguage hr .hr
+AddLanguage it .it
+AddLanguage ja .ja
+AddLanguage ko .ko
+AddLanguage ltz .ltz
+AddLanguage nl .nl
+AddLanguage nn .nn
+AddLanguage no .no
+AddLanguage pl .po
+AddLanguage pt .pt
+AddLanguage pt-BR .pt-br
+AddLanguage ru .ru
+AddLanguage sv .sv
+AddLanguage zh-CN .zh-cn
+AddLanguage zh-TW .zh-tw
+AddCharset Big5         .Big5    .big5
+AddCharset WINDOWS-1251 .cp-1251
+AddCharset CP866        .cp866
+AddCharset ISO-8859-5   .iso-ru
+AddCharset KOI8-R       .koi8-r
+AddCharset UCS-2        .ucs2
+AddCharset UCS-4        .ucs4
+AddCharset UTF-8        .utf8
+
+<IfModule mod_negotiation.c>
+    LanguagePriority en ca cs da de el eo es et fr he hr it ja ko ltz nl nn no pl pt pt-BR ru sv zh-CN zh-TW
+</IfModule>
+
+AddType application/x-tar .tgz
+
+AddEncoding x-compress .Z
+AddEncoding x-gzip .gz .tgz
+
+AddType application/x-x509-ca-cert .crt
+AddType application/x-pkcs7-crl    .crl
+
+AddHandler cgi-script .cgi .pl
+
+AddType text/html .shtml
+AddOutputFilter INCLUDES .shtml
+
+AddHandler send-as-is asis
+
+<IfModule mod_php7.c>
+    AddType application/x-httpd-php .php
+    AddType application/x-httpd-php .bat
+    AddType application/x-httpd-php-source .phps
+
+    <IfModule mod_dir.c>
+        DirectoryIndex index.html index.php
+    </IfModule>
+
+    php_flag log_errors on
+    php_flag short_open_tag on
+</IfModule>
+
+<IfModule mod_rewrite.c>
+    RewriteEngine On
+    RewriteCond %{REQUEST_METHOD} ^TRACE
+    RewriteRule .* - [F]
+</IfModule>
+
+<VirtualHost *:8443>
+    ServerName 127.0.0.1
+    SSLEngine On
+</VirtualHost>
+
+#
+# Apple-specific filesystem protection.
+#
+<Files "rsrc">
+    Require all denied
+</Files>
+
+<Directory  ~ ".*\.\.namedfork">
+    Require all denied
+</Directory>
+

Modified: trunk/Tools/ChangeLog (233361 => 233362)


--- trunk/Tools/ChangeLog	2018-06-29 17:42:00 UTC (rev 233361)
+++ trunk/Tools/ChangeLog	2018-06-29 17:47:17 UTC (rev 233362)
@@ -1,3 +1,119 @@
+2018-06-29  Thibault Saunier  <[email protected]>
+
+        [GTK][WPE]: Add a way to setup our development environment inside flatpak
+        https://bugs.webkit.org/show_bug.cgi?id=186771
+
+        Reviewed by Carlos Alberto Lopez Perez.
+
+        This patch introduce a way to setup the development environment inside flatpak[0]
+        removing the need for jhbuild when doing so. Anything needed to build/run minibrowser/ run
+        layout tests is provided either but the org.gnome.Sdk runtime or built with flatpak-builder.
+
+        The workflow is very similar to the "jhbuild based" one except that you should use update-webkit$PORTNAME-flatpak instead
+        of update-webkit$PORTNAME-libs and that script requires to specify a build configuration (--release is default).
+
+        Our scripts have been updated to be able to run inside that new build environment.
+
+        Since everything runs inside a flatpak sandbox, gdb needs to be run from within the sandbox, the script exposes a way to do it
+        easily with the `--gdb` option:
+
+          $ webkit-flatpak --gdb [-m COREDUMPCTL MATCHES]
+
+        The Layout test `GDBCrashLogGenerator` has been taugth how to use that and is able to retrieve stacktrace as with the jhbuild based workflow.
+
+        [0] http://flatpak.org
+
+        * Scripts/build-webkit:
+        * Scripts/generate-jsc-bundle:
+        (main):
+        * Scripts/run-gtk-tests:
+        * Scripts/run-minibrowser:
+        * Scripts/run-webdriver-tests:
+        * Scripts/run-webkit-tests:
+        * Scripts/run-wpe-tests:
+        * Scripts/update-webkitgtk-libs:
+        * Scripts/update-webkitwpe-libs:
+        * Scripts/webkit-flatpak: Added.
+        * Scripts/webkitdirs.pm:
+        (getJhbuildPath):
+        (getFlatpakPath):
+        (inFlatpakSandbox):
+        (runInFlatpak):
+        (runInFlatpakIfAvalaible):
+        (wrapperPrefixIfNeeded):
+        (shouldUseFlatpak):
+        * Scripts/webkitpy/port/base.py:
+        (Port._path_to_apache):
+        (Port._is_flatpak):
+        (Port._apache_config_file_name_for_platform):
+        (Port._should_use_flatpak):
+        (Port):
+        (Port._in_flatpak_sandbox):
+        (Port._should_use_jhbuild):
+        * Scripts/webkitpy/port/gtk.py:
+        (GtkPort.setup_environ_for_server):
+        * Scripts/webkitpy/port/linux_get_crash_log.py:
+        (GDBCrashLogGenerator._get_trace_from_systemd):
+        (GDBCrashLogGenerator.generate_crash_log):
+        * Scripts/webkitpy/port/wpe.py:
+        (WPEPort.setup_environ_for_server):
+        * Scripts/webkitpy/w3c/wpt_runner.py:
+        (main):
+        * flatpak/files/default.xkm: Added.
+        * flatpak/files/httpd-autogen.sh: Added.
+        * flatpak/flatpakutils.py: Added.
+        (Colors):
+        (Console):
+        (Console.message):
+        (remove_extension_points):
+        (remove_comments):
+        (remove_comments._replacer):
+        (load_manifest):
+        (expand_manifest):
+        (FlatpakObject):
+        (FlatpakObject.__init__):
+        (FlatpakObject.flatpak):
+        (FlatpakPackages):
+        (FlatpakPackages.__init__):
+        (FlatpakPackages.__detect_packages):
+        (FlatpakPackages.__detect_packages.in):
+        (FlatpakPackages.__detect_runtimes):
+        (FlatpakPackages.__detect_apps):
+        (FlatpakPackages.__iter__):
+        (FlatpakRepos):
+        (FlatpakRepos.__init__):
+        (FlatpakRepos.update):
+        (FlatpakRepos.add):
+        (FlatpakRepo):
+        (FlatpakRepo.__init__):
+        (FlatpakRepo.repo_file):
+        (FlatpakPackage):
+        (FlatpakPackage.__init__):
+        (FlatpakPackage.__str__):
+        (FlatpakPackage.is_installed):
+        (FlatpakPackage.install):
+        (FlatpakPackage.update):
+        (WebkitFlatpak):
+        (WebkitFlatpak.load_from_args):
+        (WebkitFlatpak.__init__):
+        (WebkitFlatpak.check_flatpak):
+        (WebkitFlatpak.check_flatpak.comparable_version):
+        (WebkitFlatpak.clean_args):
+        (WebkitFlatpak.run_in_sandbox):
+        (WebkitFlatpak.run):
+        (WebkitFlatpak.has_environment):
+        (WebkitFlatpak.setup_dev_env):
+        (WebkitFlatpak.install_all):
+        (WebkitFlatpak.run_gdb):
+        (WebkitFlatpak.update_all):
+        (is_sandboxed):
+        (run_in_sandbox_if_available):
+        * flatpak/org.webkit.GTK.yaml: Added.
+        * flatpak/org.webkit.WPE.yaml: Added.
+        * flatpak/org.webkit.WebKit.yaml: Added.
+        * flatpak/patches/httpd-0001-configure-use-pkg-config-for-PCRE-detection.patch: Added.
+        * flatpak/patches/xvfb-0001-HACK-Avoid-compiling-a-kbm-file.patch: Added.
+
 2018-06-28  Wenson Hsieh  <[email protected]>
 
         [iOS] DataTransfer.getData always returns the empty string when dropping text

Modified: trunk/Tools/Scripts/build-webkit (233361 => 233362)


--- trunk/Tools/Scripts/build-webkit	2018-06-29 17:42:00 UTC (rev 233361)
+++ trunk/Tools/Scripts/build-webkit	2018-06-29 17:47:17 UTC (rev 233362)
@@ -48,6 +48,15 @@
 sub cMakeArgsFromFeatures();
 sub writeCongrats();
 
+checkRequiredSystemConfig();
+setConfiguration();
+
+if (shouldUseFlatpak()) {
+    print "Building flatpak based environment\n";
+
+    runInFlatpak("/app/webkit/Tools/Scripts/build-webkit");
+}
+
 my $originalWorkingDirectory = getcwd();
 chdirWebKit();
 
@@ -167,8 +176,6 @@
     $ENV{'WK_USE_CCACHE'} = "NO";
 }
 
-checkRequiredSystemConfig();
-setConfiguration();
 
 my $productDir = productDir();
 

Modified: trunk/Tools/Scripts/generate-jsc-bundle (233361 => 233362)


--- trunk/Tools/Scripts/generate-jsc-bundle	2018-06-29 17:42:00 UTC (rev 233361)
+++ trunk/Tools/Scripts/generate-jsc-bundle	2018-06-29 17:47:17 UTC (rev 233362)
@@ -35,8 +35,10 @@
 import zipfile
 
 top_level_directory = os.path.normpath(os.path.join(os.path.dirname(__file__), '..', '..'))
+sys.path.insert(0, os.path.join(top_level_directory, 'Tools', 'flatpak'))
 sys.path.insert(0, os.path.join(top_level_directory, 'Tools', 'jhbuild'))
 import jhbuildutils
+import flatpakutils
 
 
 # Ideally we should use something like lddtree or create our own version of that
@@ -229,7 +231,9 @@
     platform = options.platform.lower()
     configuration = options.configuration.lower()
     if platform == 'gtk':
-        jhbuildutils.enter_jhbuild_environment_if_available(platform)
+        flatpakutils.run_in_sandbox_if_available(sys.argv)
+        if not flatpakutils.is_sandboxed():
+            jhbuildutils.enter_jhbuild_environment_if_available("gtk")
     else:
         raise NotImplementedError('Unsupported platform')
 

Modified: trunk/Tools/Scripts/run-gtk-tests (233361 => 233362)


--- trunk/Tools/Scripts/run-gtk-tests	2018-06-29 17:42:00 UTC (rev 233361)
+++ trunk/Tools/Scripts/run-gtk-tests	2018-06-29 17:47:17 UTC (rev 233362)
@@ -25,10 +25,12 @@
 from gi.repository import Gio, GLib
 
 top_level_directory = os.path.normpath(os.path.join(os.path.dirname(__file__), "..", ".."))
+sys.path.insert(0, os.path.join(top_level_directory, "Tools", "flatpak"))
 sys.path.insert(0, os.path.join(top_level_directory, "Tools", "jhbuild"))
 sys.path.insert(0, os.path.join(top_level_directory, "Tools", "glib"))
 import common
 import jhbuildutils
+import flatpakutils
 from api_test_runner import TestRunner, add_options
 
 class GtkTestRunner(TestRunner):
@@ -124,13 +126,15 @@
         return os.path.basename(os.path.dirname(test_program)) in ["WebKit", "WTF", "WebCore",  "WebCoreGtk"]
 
 if __name__ == "__main__":
-    if not jhbuildutils.enter_jhbuild_environment_if_available("gtk"):
-        print "***"
-        print "*** Warning: jhbuild environment not present. Run update-webkitgtk-libs before build-webkit to ensure proper testing."
-        print "***"
+    flatpakutils.run_in_sandbox_if_available(sys.argv)
+    if not flatpakutils.is_sandboxed() and not jhbuildutils.enter_jhbuild_environment_if_available("gtk"):
+        print '***'
+        print '*** Warning: jhbuild environment not present and not running in flatpak.'
+        print '*** Run update-webkitgtk-libs or update-webkitgtk-flatpak before build-webkit to ensure proper testing..'
+        print '***'
 
     option_parser = optparse.OptionParser(usage='usage: %prog [options] [test...]')
-    add_options(option_parser);
+    add_options(option_parser)
     option_parser.add_option('--display-server', choices=['xvfb', 'xorg', 'weston', 'wayland'], default='xvfb',
                              help='"xvfb": Use a virtualized X11 server. "xorg": Use the current X11 session. '
                                   '"weston": Use a virtualized Weston server. "wayland": Use the current wayland session.'),

Modified: trunk/Tools/Scripts/run-minibrowser (233361 => 233362)


--- trunk/Tools/Scripts/run-minibrowser	2018-06-29 17:42:00 UTC (rev 233361)
+++ trunk/Tools/Scripts/run-minibrowser	2018-06-29 17:47:17 UTC (rev 233362)
@@ -45,6 +45,8 @@
 setConfiguration();
 
 if (isGtk() || isWPE()) {
+    runInFlatpakIfAvalaible("/app/webkit/Tools/Scripts/run-minibrowser");
+
     # Check to see that all the frameworks are built.
     checkFrameworks();
 

Modified: trunk/Tools/Scripts/run-webdriver-tests (233361 => 233362)


--- trunk/Tools/Scripts/run-webdriver-tests	2018-06-29 17:42:00 UTC (rev 233361)
+++ trunk/Tools/Scripts/run-webdriver-tests	2018-06-29 17:47:17 UTC (rev 233362)
@@ -66,14 +66,20 @@
 
 if port.name() in ['gtk', 'wpe']:
     import os
+
     top_level_directory = os.path.normpath(os.path.join(os.path.dirname(__file__), '..', '..'))
-    sys.path.insert(0, os.path.join(top_level_directory, 'Tools', 'jhbuild'))
-    import jhbuildutils
+    sys.path.insert(0, os.path.join(top_level_directory, 'Tools', 'flatpak'))
+    import flatpakutils
+    flatpakutils.run_in_sandbox_if_available(sys.argv)
+    if not flatpakutils.is_sandboxed():
+        sys.path.insert(0, os.path.join(top_level_directory, 'Tools', 'jhbuild'))
+        import jhbuildutils
 
-    if not jhbuildutils.enter_jhbuild_environment_if_available(port.name()):
-        print '***'
-        print '*** Warning: jhbuild environment not present. Run update-webkitgtk-libs before build-webkit to ensure proper testing.'
-        print '***'
+        if not jhbuildutils.enter_jhbuild_environment_if_available(port.name()):
+            print '***'
+            print '*** Warning: jhbuild environment not present and not running in flatpak.'
+            print '*** Run update-webkitgtk-libs or update-webkitgtk-flatpak before build-webkit to ensure proper testing..'
+            print '***'
 
 port._display_server = options.display_server
 runner = WebDriverTestRunner(port)

Modified: trunk/Tools/Scripts/run-webkit-tests (233361 => 233362)


--- trunk/Tools/Scripts/run-webkit-tests	2018-06-29 17:42:00 UTC (rev 233361)
+++ trunk/Tools/Scripts/run-webkit-tests	2018-06-29 17:47:17 UTC (rev 233362)
@@ -28,6 +28,14 @@
 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 """Wrapper around webkitpy/layout_tests/run_webkit_tests.py"""
+import os
+import sys
+
 from webkitpy.common import multiprocessing_bootstrap
 
-multiprocessing_bootstrap.run('webkitpy', 'layout_tests', 'run_webkit_tests.py')
+top_level_directory = os.path.normpath(os.path.join(os.path.dirname(__file__), '..', '..'))
+sys.path.insert(0, os.path.join(top_level_directory, 'Tools', 'flatpak'))
+import flatpakutils
+flatpakutils.run_in_sandbox_if_available(sys.argv)
+
+multiprocessing_bootstrap.run('webkitpy', 'layout_tests', 'run_webkit_tests.py')
\ No newline at end of file

Modified: trunk/Tools/Scripts/run-wpe-tests (233361 => 233362)


--- trunk/Tools/Scripts/run-wpe-tests	2018-06-29 17:42:00 UTC (rev 233361)
+++ trunk/Tools/Scripts/run-wpe-tests	2018-06-29 17:47:17 UTC (rev 233362)
@@ -24,8 +24,10 @@
 
 top_level_directory = os.path.normpath(os.path.join(os.path.dirname(__file__), "..", ".."))
 sys.path.insert(0, os.path.join(top_level_directory, "Tools", "jhbuild"))
+sys.path.insert(0, os.path.join(top_level_directory, "Tools", "flatpak"))
 sys.path.insert(0, os.path.join(top_level_directory, "Tools", "glib"))
 import jhbuildutils
+import flatpakutils
 from api_test_runner import TestRunner, add_options
 
 class WPETestRunner(TestRunner):
@@ -46,10 +48,12 @@
 
 
 if __name__ == "__main__":
-    if not jhbuildutils.enter_jhbuild_environment_if_available("wpe"):
-        print "***"
-        print "*** Warning: jhbuild environment not present. Run update-webkitgtk-libs before build-webkit to ensure proper testing."
-        print "***"
+    flatpakutils.run_in_sandbox_if_available(sys.argv)
+    if not flatpakutils.is_sandboxed() and not jhbuildutils.enter_jhbuild_environment_if_available("wpe"):
+        print '***'
+        print '*** Warning: jhbuild environment not present and not running in flatpak.'
+        print '*** Run update-webkitgtk-libs or update-webkitgtk-flatpak before build-webkit to ensure proper testing..'
+        print '***'
 
     option_parser = optparse.OptionParser(usage='usage: %prog [options] [test...]')
     add_options(option_parser);

Added: trunk/Tools/Scripts/update-webkitgtk-flatpak (0 => 233362)


--- trunk/Tools/Scripts/update-webkitgtk-flatpak	                        (rev 0)
+++ trunk/Tools/Scripts/update-webkitgtk-flatpak	2018-06-29 17:47:17 UTC (rev 233362)
@@ -0,0 +1,28 @@
+#!/usr/bin/env python
+# Copyright (C) 2018 Igalia S.L.
+# Copyright (c) 2018, Thibault Saunier <[email protected]>
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this program; if not, write to the
+# Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301, USA.
+# pylint: disable=missing-docstring,invalid-name
+import os
+import sys
+
+top_level_directory = os.path.normpath(os.path.join(os.path.dirname(__file__), "..", ".."))
+sys.path.insert(0, os.path.join(top_level_directory, "Tools", "flatpak"))
+from flatpakutils import WebkitFlatpak
+
+if __name__ == "__main__":
+    WebkitFlatpak.load_from_args(["--gtk", "--update"] + sys.argv[1:]).run()
Property changes on: trunk/Tools/Scripts/update-webkitgtk-flatpak
___________________________________________________________________

Added: svn:executable

+* \ No newline at end of property

Added: trunk/Tools/Scripts/update-webkitwpe-flatpak (0 => 233362)


--- trunk/Tools/Scripts/update-webkitwpe-flatpak	                        (rev 0)
+++ trunk/Tools/Scripts/update-webkitwpe-flatpak	2018-06-29 17:47:17 UTC (rev 233362)
@@ -0,0 +1,28 @@
+#!/usr/bin/env python
+# Copyright (C) 2018 Igalia S.L.
+# Copyright (c) 2018, Thibault Saunier <[email protected]>
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this program; if not, write to the
+# Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301, USA.
+# pylint: disable=missing-docstring,invalid-name
+import os
+import sys
+
+top_level_directory = os.path.normpath(os.path.join(os.path.dirname(__file__), "..", ".."))
+sys.path.insert(0, os.path.join(top_level_directory, "Tools", "flatpak"))
+from flatpakutils import WebkitFlatpak
+
+if __name__ == "__main__":
+    WebkitFlatpak.load_from_args(["--wpe", "--update"] + sys.argv[1:]).run()
Property changes on: trunk/Tools/Scripts/update-webkitwpe-flatpak
___________________________________________________________________

Added: svn:executable

+* \ No newline at end of property

Added: trunk/Tools/Scripts/webkit-flatpak (0 => 233362)


--- trunk/Tools/Scripts/webkit-flatpak	                        (rev 0)
+++ trunk/Tools/Scripts/webkit-flatpak	2018-06-29 17:47:17 UTC (rev 233362)
@@ -0,0 +1,28 @@
+#!/usr/bin/env python
+# Copyright (C) 2018 Igalia S.L.
+# Copyright (c) 2018, Thibault Saunier <[email protected]>
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this program; if not, write to the
+# Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301, USA.
+# pylint: disable=missing-docstring,invalid-name
+import os
+import sys
+
+top_level_directory = os.path.normpath(os.path.join(os.path.dirname(__file__), "..", ".."))
+sys.path.insert(0, os.path.join(top_level_directory, "Tools", "flatpak"))
+from flatpakutils import WebkitFlatpak
+
+if __name__ == "__main__":
+    sys.exit(WebkitFlatpak.load_from_args().run())
\ No newline at end of file
Property changes on: trunk/Tools/Scripts/webkit-flatpak
___________________________________________________________________

Added: svn:executable

+* \ No newline at end of property

Modified: trunk/Tools/Scripts/webkitdirs.pm (233361 => 233362)


--- trunk/Tools/Scripts/webkitdirs.pm	2018-06-29 17:42:00 UTC (rev 233361)
+++ trunk/Tools/Scripts/webkitdirs.pm	2018-06-29 17:47:17 UTC (rev 233362)
@@ -1681,6 +1681,9 @@
 {
     my $relativeScriptsPath = relativeScriptsDir();
     if (isGtk() || isWPE()) {
+        if (inFlatpakSandbox()) {
+            return "Tools/Scripts/run-minibrowser";
+        }
         return "$relativeScriptsPath/run-minibrowser";
     } elsif (isAppleWebKit()) {
         return "$relativeScriptsPath/run-safari";
@@ -1994,11 +1997,27 @@
     } elsif (isWPE()) {
         push(@jhbuildPath, "DependenciesWPE");
     } else {
-        die "Cannot get JHBuild path for platform that isn't GTK+.\n";
+        die "Cannot get JHBuild path for platform that isn't GTK+ or WPE.\n";
     }
     return File::Spec->catdir(@jhbuildPath);
 }
 
+sub getFlatpakPath()
+{
+    my @flatpakBuildPath = File::Spec->splitdir(baseProductDir());
+    if (isGtk()) {
+        push(@flatpakBuildPath, "GTK");
+    } elsif (isWPE()) {
+        push(@flatpakBuildPath, "WPE");
+    } else {
+        die "Cannot get Flatpak path for platform that isn't GTK+ or WPE.\n";
+    }
+    my @configuration = configuration();
+    push(@flatpakBuildPath, "FlatpakTree$configuration");
+
+    return File::Spec->catdir(@flatpakBuildPath);
+}
+
 sub isCachedArgumentfileOutOfDate($@)
 {
     my ($filename, $currentContents) = @_;
@@ -2021,8 +2040,43 @@
     return 0;
 }
 
+sub inFlatpakSandbox()
+{
+    if (-f "/usr/manifest.json") {
+        return 1;
+    }
+
+    return 0;
+}
+
+sub runInFlatpak(@)
+{
+    my @arg = @_;
+    my @command = (File::Spec->catfile(sourceDir(), "Tools", "Scripts", "webkit-flatpak"));
+    exec @command, argumentsForConfiguration(), "--command", @_, argumentsForConfiguration(), @ARGV or die;
+}
+
+sub runInFlatpakIfAvalaible(@)
+{
+    if (inFlatpakSandbox()) {
+        return 0;
+    }
+
+    my @command = (File::Spec->catfile(sourceDir(), "Tools", "Scripts", "webkit-flatpak"));
+    if (system(@command, "--avalaible") != 0) {
+        return 0;
+    }
+
+    if (! -e getFlatpakPath()) {
+        return 0;
+    }
+
+    runInFlatpak(@_)
+}
+
 sub wrapperPrefixIfNeeded()
 {
+
     if (isAnyWindows() || isJSCOnly()) {
         return ();
     }
@@ -2049,6 +2103,11 @@
     return ((isGtk() or isWPE()) and -e getJhbuildPath());
 }
 
+sub shouldUseFlatpak()
+{
+    return ((isGtk() or isWPE()) and ! inFlatpakSandbox() and -e getFlatpakPath());
+}
+
 sub cmakeCachePath()
 {
     return File::Spec->catdir(baseProductDir(), configuration(), "CMakeCache.txt");

Modified: trunk/Tools/Scripts/webkitpy/port/base.py (233361 => 233362)


--- trunk/Tools/Scripts/webkitpy/port/base.py	2018-06-29 17:42:00 UTC (rev 233361)
+++ trunk/Tools/Scripts/webkitpy/port/base.py	2018-06-29 17:47:17 UTC (rev 233362)
@@ -1225,7 +1225,7 @@
         This is needed only by ports that use the apache_http_server module."""
         # The Apache binary path can vary depending on OS and distribution
         # See http://wiki.apache.org/httpd/DistrosDefaultLayout
-        for path in ["/usr/sbin/httpd", "/usr/sbin/apache2"]:
+        for path in ["/usr/sbin/httpd", "/usr/sbin/apache2", "/app/bin/httpd"]:
             if self._filesystem.exists(path):
                 return path
         _log.error("Could not find apache. Not installed or unknown path.")
@@ -1251,6 +1251,9 @@
     def _is_arch_based(self):
         return self._filesystem.exists('/etc/arch-release')
 
+    def _is_flatpak(self):
+        return self._filesystem.exists('/usr/manifest.json')
+
     def _apache_version(self):
         config = self._executive.run_command([self._path_to_apache(), '-v'])
         return re.sub(r'(?:.|\n)*Server version: Apache/(\d+\.\d+)(?:.|\n)*', r'\1', config)
@@ -1288,6 +1291,8 @@
                 return 'debian-httpd-' + self._apache_version() + self._debian_php_version() + '.conf'
             if self._is_arch_based():
                 return 'archlinux-httpd.conf'
+            if self._is_flatpak():
+                return 'flatpak-httpd.conf'
         # All platforms use apache2 except for CYGWIN (and Mac OS X Tiger and prior, which we no longer support).
         return 'apache' + self._apache_version() + '-httpd.conf'
 
@@ -1440,7 +1445,19 @@
         # --pixel-test-directory is not specified.
         return True
 
+    def _should_use_flatpak(self):
+        suffix = ""
+        if self.port_name:
+            suffix = self.port_name.upper()
+        return self._filesystem.exists(self.path_from_webkit_base('WebKitBuild', suffix, "FlatpakTree"))
+
+    def _in_flatpak_sandbox(self):
+        return os.path.exists("/usr/manifest.json")
+
     def _should_use_jhbuild(self):
+        if self._in_flatpak_sandbox():
+            return False
+
         suffix = ""
         if self.port_name:
             suffix = self.port_name.upper()

Modified: trunk/Tools/Scripts/webkitpy/port/gtk.py (233361 => 233362)


--- trunk/Tools/Scripts/webkitpy/port/gtk.py	2018-06-29 17:42:00 UTC (rev 233361)
+++ trunk/Tools/Scripts/webkitpy/port/gtk.py	2018-06-29 17:47:17 UTC (rev 233362)
@@ -122,6 +122,7 @@
         environment['TEST_RUNNER_INJECTED_BUNDLE_FILENAME'] = self._build_path('lib', 'libTestRunnerInjectedBundle.so')
         environment['TEST_RUNNER_TEST_PLUGIN_PATH'] = self._build_path('lib', 'plugins')
         self._copy_value_from_environ_if_set(environment, 'WEBKIT_OUTPUTDIR')
+        self._copy_value_from_environ_if_set(environment, 'WEBKIT_TOP_LEVEL')
         self._copy_value_from_environ_if_set(environment, 'USE_PLAYBIN3')
         self._copy_value_from_environ_if_set(environment, 'GST_DEBUG')
         self._copy_value_from_environ_if_set(environment, 'GST_DEBUG_DUMP_DOT_DIR')
@@ -128,9 +129,13 @@
         self._copy_value_from_environ_if_set(environment, 'GST_DEBUG_FILE')
 
         # Configure the software libgl renderer if jhbuild ready and we test inside a virtualized window system
-        if self._driver_class() in [XvfbDriver, WestonDriver] and self._should_use_jhbuild():
-            llvmpipe_libgl_path = self.host.executive.run_command(self._jhbuild_wrapper + ['printenv', 'LLVMPIPE_LIBGL_PATH'],
-                                                                  ignore_errors=True).strip()
+        if self._driver_class() in [XvfbDriver, WestonDriver] and (self._should_use_jhbuild() or self._is_flatpak()):
+            if self._should_use_jhbuild():
+                llvmpipe_libgl_path = self.host.executive.run_command(self._jhbuild_wrapper + ['printenv', 'LLVMPIPE_LIBGL_PATH'],
+                                                                    ignore_errors=True).strip()
+            else:  # in flatpak
+                llvmpipe_libgl_path = "/app/softGL/lib"
+
             dri_libgl_path = os.path.join(llvmpipe_libgl_path, "dri")
             if os.path.exists(os.path.join(llvmpipe_libgl_path, "libGL.so")) and os.path.exists(os.path.join(dri_libgl_path, "swrast_dri.so")):
                 # Make sure va-api support gets disabled because it's incompatible with Mesa's softGL driver.
@@ -142,7 +147,7 @@
                 if os.environ.get('LD_LIBRARY_PATH'):
                     environment['LD_LIBRARY_PATH'] += ':%s' % os.environ.get('LD_LIBRARY_PATH')
             else:
-                _log.warning("Can't find Gallium llvmpipe driver. Try to run update-webkitgtk-libs")
+                _log.warning("Can't find Gallium llvmpipe driver. Try to run update-webkitgtk-libs or update-webkitgtk-flatpak")
         if self.get_option("leaks"):
             # Turn off GLib memory optimisations https://wiki.gnome.org/Valgrind.
             environment['G_SLICE'] = 'always-malloc'

Modified: trunk/Tools/Scripts/webkitpy/port/linux_get_crash_log.py (233361 => 233362)


--- trunk/Tools/Scripts/webkitpy/port/linux_get_crash_log.py	2018-06-29 17:42:00 UTC (rev 233361)
+++ trunk/Tools/Scripts/webkitpy/port/linux_get_crash_log.py	2018-06-29 17:47:17 UTC (rev 233362)
@@ -58,7 +58,7 @@
             stdout = ('ERROR: The gdb process exited with non-zero return code %s\n\n' % proc.returncode) + stdout
         return (stdout.decode('utf8', 'ignore'), errors)
 
-    def _get_trace_from_systemd(self, pid):
+    def _get_trace_from_systemd(self, coredumpctl, pid):
         # Letting up to 5 seconds for the backtrace to be generated on the systemd side
         for try_number in range(5):
             if try_number != 0:
@@ -66,25 +66,23 @@
                 time.sleep(1)
 
             try:
-                info = self._executive.run_command(['coredumpctl', 'info', str(pid)], return_stderr=True)
+                info = self._executive.run_command(coredumpctl + ['info', "--since=" + time.strftime("%a %Y-%m-%d %H:%M:%S %Z", time.localtime(self.newer_than))],
+                    return_stderr=True)
             except ScriptError, OSError:
                 continue
 
-            if self.newer_than:
-                found_newer = False
-                # Coredumpctl will use the latest core dump with the specified PID
-                # assume it is the right one.
-                for timestamp in re.findall(r'Timestamp:.*(\d{4}-\d+-\d+ \d+:\d+:\d+)', info):
-                    date = time.mktime(datetime.datetime.strptime(timestamp, "%Y-%m-%d %H:%M:%S").timetuple())
-                    if date > self.newer_than:
-                        found_newer = True
-                        break
+            found_newer = False
+            # Coredumpctl will use the latest core dump with the specified PID
+            # assume it is the right one.
+            pids = re.findall(r'PID: (\d+) \(.*\)', info)
+            if not pids:
+                print(self.name + "\n" + info)
+                continue
 
-                if not found_newer:
-                    continue
+            pid = pids[0]
 
             temp_file = tempfile.NamedTemporaryFile()
-            if self._executive.run_command(['coredumpctl', 'dump', pid, '--output', temp_file.name], return_exit_code=True):
+            if self._executive.run_command(coredumpctl + ['dump', pid, '--output', temp_file.name], return_exit_code=True):
                 continue
 
             return self._get_gdb_output(temp_file.name)
@@ -105,10 +103,12 @@
             return filename.find(self.name) > -1
 
         # Poor man which, ignore any failure.
-        try:
-            coredumpctl = not self._executive.run_command(['coredumpctl', '--version'], return_exit_code=True)
-        except:
-            coredumpctl = False
+        for coredumpctl in [['coredumpctl'], ['flatpak-spawn', '--host', 'coredumpctl'], []]:
+            try:
+                if not self._executive.run_command(coredumpctl, return_exit_code=True):
+                    break
+            except:
+                continue
 
         if log_directory:
             dumps = self._filesystem.files_under(
@@ -119,7 +119,7 @@
                 if not self.newer_than or self._filesystem.mtime(coredump_path) > self.newer_than:
                     crash_log, errors = self._get_gdb_output(coredump_path)
         elif coredumpctl:
-            crash_log, errors = self._get_trace_from_systemd(pid_representation)
+            crash_log, errors = self._get_trace_from_systemd(coredumpctl, pid_representation)
 
         stderr_lines = errors + str(stderr or '<empty>').decode('utf8', 'ignore').splitlines()
         errors_str = '\n'.join(('STDERR: ' + stderr_line) for stderr_line in stderr_lines)

Modified: trunk/Tools/Scripts/webkitpy/port/wpe.py (233361 => 233362)


--- trunk/Tools/Scripts/webkitpy/port/wpe.py	2018-06-29 17:42:00 UTC (rev 233361)
+++ trunk/Tools/Scripts/webkitpy/port/wpe.py	2018-06-29 17:47:17 UTC (rev 233362)
@@ -76,6 +76,12 @@
         environment['TEST_RUNNER_INJECTED_BUNDLE_FILENAME'] = self._build_path('lib', 'libTestRunnerInjectedBundle.so')
         environment['TEST_RUNNER_TEST_PLUGIN_PATH'] = self._build_path('lib', 'plugins')
         environment['WEBKIT_EXEC_PATH'] = self._build_path('bin')
+        self._copy_value_from_environ_if_set(environment, 'WEBKIT_OUTPUTDIR')
+        self._copy_value_from_environ_if_set(environment, 'WEBKIT_TOP_LEVEL')
+        self._copy_value_from_environ_if_set(environment, 'USE_PLAYBIN3')
+        self._copy_value_from_environ_if_set(environment, 'GST_DEBUG')
+        self._copy_value_from_environ_if_set(environment, 'GST_DEBUG_DUMP_DOT_DIR')
+        self._copy_value_from_environ_if_set(environment, 'GST_DEBUG_FILE')
         return environment
 
     def check_sys_deps(self, needs_http):

Modified: trunk/Tools/Scripts/webkitpy/w3c/wpt_runner.py (233361 => 233362)


--- trunk/Tools/Scripts/webkitpy/w3c/wpt_runner.py	2018-06-29 17:42:00 UTC (rev 233361)
+++ trunk/Tools/Scripts/webkitpy/w3c/wpt_runner.py	2018-06-29 17:47:17 UTC (rev 233362)
@@ -53,11 +53,16 @@
     # If necessary, inject the jhbuild wrapper.
     if port.name() in ['gtk', 'wpe']:
         filesystem = host.filesystem
+
         top_level_directory = filesystem.normpath(filesystem.join(filesystem.dirname(__file__), '..', '..', '..', '..'))
+        sys.path.insert(0, filesystem.join(top_level_directory, 'Tools', 'flatpak'))
+        import flatpakutils
+        flatpakutils.run_in_sandbox_if_available(sys.argv)
+
         sys.path.insert(0, filesystem.join(top_level_directory, 'Tools', 'jhbuild'))
         import jhbuildutils
 
-        if not jhbuildutils.enter_jhbuild_environment_if_available(port.name()):
+        if flatpakutils.is_sandboxed() and not jhbuildutils.enter_jhbuild_environment_if_available(port.name()):
             _log.warning('jhbuild environment not present. Run update-webkitgtk-libs before build-webkit to ensure proper testing.')
 
     # Create the Port-specific driver.

Added: trunk/Tools/flatpak/files/default.xkm (0 => 233362)


--- trunk/Tools/flatpak/files/default.xkm	                        (rev 0)
+++ trunk/Tools/flatpak/files/default.xkm	2018-06-29 17:47:17 UTC (rev 233362)
@@ -0,0 +1,248 @@
+mkx\xFF����������\x8C��D������\xD0��������\x8C\xDC����\xD4h����\xE8<����P$%����\x8Ct&����\x8C��D������\xFF��NumLock��������Alt������
+��LevelThree��LAlt������RAlt������RControl������LControl����
+��ScrollLock	��LevelFive����AltGr����Meta������Super����Hyper������\xD0����evdev+aliases(qwerty)��\xFF!����������ESC��AE01AE02AE03AE04AE05AE06AE07AE08AE09AE10AE11AE12BKSPTAB��AD01AD02AD03AD04AD05AD06AD07AD08AD09AD10AD11AD12RTRNLCTLAC01AC02AC03AC04AC05AC06AC07AC08AC09AC10AC11TLDELFSHBKSLAB01AB02AB03AB04AB05AB06AB07AB08AB09AB10RTSHKPMULALTSPCECAPSFK01FK02FK03FK04FK05FK06FK07FK08FK09FK10NMLKSCLKKP7��KP8��KP9��KPSUKP4��KP5��KP6��KPADKP1��KP2��KP3��KP0��KPDLLVL3��������LSGTFK11FK12AB11KATAHIRAHENKHKTGMUHEJPCMKPENRCTLKPDVPRSCRALTLNFDHOMEUP����PGUPLEFTRGHTEND��DOWNPGDNINS��DELEI120MUTEVOL-VOL+POWRKPEQI126PAUSI128I129HNGLHJCVAE13LWINRWINCOMPSTOPAGAIPROPUNDOFRNTCOPYOPENPASTFINDCUT��HELPI147I148I149I150I151I152I153I154I155I156I157I158I159I160I161I162I163I164I165I166I167I168I169I170I171I172I173I174I175I176I177I178I179I180I181I182I183I184I185I186I187I188I189I190FK13FK14FK15FK16FK17FK18FK19FK20FK21FK22FK23FK24MDSWALT��METASUPRHYPRI208I209I210I211I212I213I214I215I216I217I218I219I220I221
 I222I223I224I225I226I227I228I229I230I231I232
 I233I234I235I236I237I238I239I240I241I242I243I244I245I246I247I248I249I250I251I252I253I254I255BKSLAC12COMPMENUTLDEHZTGLWINLMTARWINRMTARALTALGRI129KPPTAD01LatQAD02LatWAD03LatEAD04LatRAD05LatTAD06LatYAD07LatUAD08LatIAD09LatOAD10LatPAC01LatAAC02LatSAC03LatDAC04LatFAC05LatGAC06LatHAC07LatJAC08LatKAC09LatLAB01LatZAB02LatXAB03LatCAB04LatVAB05LatBAB06LatNAB07LatM������\x8C\xDC��complete����������������������	��ONE_LEVEL����Any������������������	��TWO_LEVEL����Base������Shift������������������
+��ALPHABETIC��Base������Caps��������������������KEYPAD��Base������Number��������	��SHIFT+ALT����Base����	��Shift+Alt��@��������@������PC_SUPER_LEVEL2��������Base������Super����������������PC_CONTROL_LEVEL2����Base������Control��������@��������@����PC_LCONTROL_LEVEL2��Base������LControl������ �������� ����PC_RCONTROL_LEVEL2��Base������RControl����������������+��PC_ALT_LEVEL2����Base������Alt��������������������PC_LALT_LEVEL2��Base������LAlt������������������PC_RALT_LEVEL2��Base������RAlt����������������������CTRL+ALT����������������������������������Base������Shift����Alt Base����	��Shift Alt����Ctrl+Alt������������������������������������������������������������LOCAL_EIGHT_LEVEL����Base������Shift����Level3��Shift Level3������Ctrl����
+��Shift Ctrl��Level3 Ctrl��������Shift Level3 Ctrl��������������������THREE_LEVEL��������Base������Shift����Level3������������������������EIGHT_LEVEL��������Base������Shift����Alt Base����	��Shift Alt����X����X Shift������
+��X Alt Base��X Shift Alt������+����������������������������������EIGHT_LEVEL_ALPHABETIC��Base������Shift����Alt Base����	��Shift Alt����X����X Shift������
+��X Alt Base��X Shift Alt��������������������������������������������������������������EIGHT_LEVEL_LEVEL_FIVE_LOCK��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������Base������Shift����Alt Base����	��Shift Alt����X����X Shift������
+��X Alt Base��X Shift Alt������������������������������������������������������������&��EIGHT_LEVEL_ALPHABETIC_LEVEL_FIVE_LOCK������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������Base������Shift����Alt Base����	��Shift Alt����X����X Shift������
+��X Alt Base��X Shift Alt����������������������������������������EIGHT_LEVEL_SEMIALPHABETIC������������������������������������������������������������������������������������������������������Base������Shift����Alt Base����	��Shift Alt����X����X Shift������
+��X Alt Base��X Shift Alt����������������������
+��FOUR_LEVEL��Base������Shift����Alt Base����	��Shift Alt����������������������������FOUR_LEVEL_ALPHABETIC����Base������Shift����Alt Base����	��Shift Alt��������������������������FOUR_LEVEL_SEMIALPHABETIC������������������������������������������������Base������Shift����Alt Base����	��Shift Alt����������������������������������FOUR_LEVEL_MIXED_KEYPAD��������Base������Number��Alt Base����	��Shift Alt������������������FOUR_LEVEL_X������Base������Alt Base����	��Shift Alt����Ctrl+Alt��������������������������"��SEPARATE_CAPS_AND_SHIFT_ALPHABETIC����������������������������������������������Base������Shift��
+��AltGr Base��Shift AltGr������������������������������������FOUR_LEVEL_PLUS_LOCK������Base������Shift����Alt Base����	��Shift Alt����Lock��������������������������������FOUR_LEVEL_KEYPAD����Base������Number��Alt Base����
+��Alt Number����\xD4h��complete����{����\xFE����\x84\xFF����������\xE6\xFF����\xFF������������\xFF����\xFF����������������\xFE����\xFF\x82������������\xFE����\xFF\x82������������\xFE����\xFF\x82��������������\xE9\xFF����\xFF��������������\xEA\xFF����\xFF��������������\xE7\xFF����\xFF
+��������������\xE8\xFF����\xFF
+��������������\xEB\xFF����\xFF��������������\xEC\xFF����\xFF��������������\xED\xFF����\xFF��������������\xEE\xFF����\xFF��������������\xFF����\xFF��������������\xFE����\xFF\x82������������\xFE����\xFF\x82������������\xFE����\xFF\x82��������������~\xFF����\xFF\x81	��������������\xFE����\xFF\xFF������������\xFE����\xFF\xFF������������\xFE����\xFF\xFF��������������\xFE����\xFF\x81	������������\xFE����\xFF\x81	��������������
+\xFE����\xFF\x81	����\xFF����������\xFE����\xFF\xFF��������������\xFE����\xFF\xFF������������\xB1\xFF����\xFF\xFF��\xFF\xFF������\x9C\xFF����\xFF\xFF��\xFF\xFF������\xB2\xFF����\xFF\xFF������������\x99\xFF����\xFF\xFF������������\xB3\xFF����\xFF\xFF����������\x9B\xFF����\xFF\xFF����������\xB4\xFF����\xFF\xFF��\xFF\xFF��������\x96\xFF����\xFF\xFF��\xFF\xFF��������\xB6\xFF����\xFF\xFF������������\x98\xFF����\xFF\xFF������������\xB7\xFF����\xFF\xFF��\xFF\xFF\xFF\xFF����\x95\xFF����\xFF\xFF��\xFF\xFF\xFF\xFF����\xB8\xFF����\xFF\xFF������\xFF\xFF����\x97\xFF����\xFF\xFF������\xFF\xFF����\xB9\xFF����\xFF\xFF����\xFF\xFF����\x9A\xFF����\xFF\xFF����\xFF\xFF����\xB5\xFF����\xFF\xFF��������������\x9D\xFF����\xFF\xFF��������������\x92\xFF����\xFF\xFF
+��������\xAF\xFF����\xFF\xFF
+��������\x93\xFF����\xFF\xFF
+��������\xAA\xFF����\xFF\xFF
+��������\x94\xFF����\xFF\xFF
+��������\xAD\xFF����\xFF\xFF
+��������\xAC\xFF����\xFF\xFF������������\xAB\xFF����\xFF\xFF������������\xB0\xFF����\xFF\xFF	������������\x9E\xFF����\xFF\xFF	������������\xAE\xFF����\xFF\xFF	������������\x9F\xFF����\xFF\xFF	������������\xD6\xFF����\xFF\xFF
+��������\xD7\xFF����\xFF\xFF
+��������\xD8\xFF����\xFF\xFF��\xFF\xFF\xFF\xFF����\xDA\xFF����\xFF\xFF����\xFF\xFF����\xDC\xFF����\xFF\xFF��������������\xDE\xFF����\xFF\xFF��\xFF\xFF������\xE0\xFF����\xFF\xFF����������\xE8\xFE����\xFF\xFF����������������\xE9\xFE����\xFF\xFF��������������\xEA\xFE����\xFF\xFF��������������\xEB\xFE����\xFF\xFF��������������\xEE\xFE����\xFF\xFF��������������\xEF\xFE����\xFF\xFF������������\xF0\xFE����\xFF\xFF������������\xF1\xFE����\xFF\xFF������������\xF4\xFE����\xFF\xFF��	��������������\xF5\xFE����\xFF\xFF��	������������\xF6\xFE����\xFF\xFF��	������������\xF7\xFE����\xFF\xFF��	������������\xF9\xFE����\xFF\xFF��������������\xFA\xFE����\xFF\xFF���������� ����\xFB\xFE����\xFF\xFF��
+����������\xFC\xFE����\xFF\xFF��
+��\xFF��������p\xFE����\xFF\xFF����������@����q\xFE����\xFF\xFF��������������r\xFE����\xFF\xFF��������������s\xFE����\xFF\xFF��������������t\xFE����\xFF\xFF��������������u\xFE����\xFF\xFF��������������v\xFE����\xFF\xFF��������������w\xFE����\xFF\xFF���������� ����x\xFE����\xFF\xFF��������������y\xFE����\xFF\xFF��������������z\xFE����\xFF\xFF��������������\xD5\xFE����\xFF\xFF����������������\xE9\xFF����\xFF\xFF������������\xEA\xFF����\xFF\xFF������������\xE7\xFF����\xFF\xFF������������\xE8\xFF����\xFF\xFF������������\xEB\xFF����\xFF\xFF������������\xEC\xFF����\xFF\xFF������������\xED\xFF����\xFF\xFF������������\xEE\xFF����\xFF\xFF������������\xE1\xFF����\xFF\xFF����������\xFE\xFF\xFF+����������\xFE\xFF\xFF+����������\xFE\xFF\xFF+����������\xFE\xFF\xFF+����������\xFE\xFF\xFF+����������\xFE\xFF\xFF+����������\xFE\xFF\xFF+����������\xFE\xFF\xFF+����������	\xFE
 \xFF\xFF+	����������
+\xFE\xFF\xFF+
+����������\xFE\xFF\xFF+����������\xFE\xFF\xFF+����������%\xFE\xFF\xFF\x86PrGrbs��$\xFE\xFF\xFF\x86PrWins��"\xFE\xFF\xFF\x86+VMode��#\xFE\xFF\xFF\x86-VMode��\xFE����\xFF\xFF������������\xFE����\xFF\xFF������������\xFE����\xFF\xFF��������������\xE5\xFF����\xFF\xFF��������������������\xFF��������������������\xFF\xFF������������������������������������\xE8<��pc+us+inet(evdev)��\xFF����English (US)����������������\xFF��������1������!����������2������@����������3������#����������4������$����������5������%����������6������^����������7������&����������8������*����������9������(����������0������)����������-������_����������=������+����������\xFF����\xFF��������	\xFF���� \xFE������
+��ALPHABETICq������Q��������
+��ALPHABETICw������W��������
+��ALPHABETICe������E��������
+��ALPHABETICr������R��������
+��ALPHABETICt������T��������
+��ALPHABETICy������Y��������
+��ALPHABETICu������U��������
+��ALPHABETICi������I��������
+��ALPHABETICo������O��������
+��ALPHABETICp������P����������[������{����������]������}����������+\xFF������\xE3\xFF������
+��ALPHABETICa������A��������
+��ALPHABETICs������S��������
+��ALPHABETICd������D��������
+��ALPHABETICf������F��������
+��ALPHABETICg������G��������
+��ALPHABETICh������H��������
+��ALPHABETICj������J��������
+��ALPHABETICk������K��������
+��ALPHABETICl������L����������;������:����������'������"����������`������~��������\xE1\xFF��������\������|��������
+��ALPHABETICz������Z��������
+��ALPHABETICx������X��������
+��ALPHABETICc������C��������
+��ALPHABETICv������V��������
+��ALPHABETICb������B��������
+��ALPHABETICn������N��������
+��ALPHABETICm������M����������,������<����������.������>����������/������?��������\xE2\xFF��������CTRL+ALT����\xAA\xFF����\xAA\xFF����\xAA\xFF����\xAA\xFF����!\xFE��\xE9\xFF����\xE7\xFF�������� ��������\xE5\xFF��������CTRL+ALT����\xBE\xFF����\xBE\xFF����\xBE\xFF����\xBE\xFF����\xFE����CTRL+ALT����\xBF\xFF����\xBF\xFF����\xBF\xFF����\xBF\xFF����\xFE����CTRL+ALT����\xC0\xFF����\xC0\xFF����\xC0\xFF����\xC0\xFF����\xFE����CTRL+ALT����\xC1\xFF����\xC1\xFF����\xC1\xFF����\xC1\xFF����\xFE����CTRL+ALT����\xC2\xFF����\xC2\xFF����\xC2\xFF����\xC2\xFF����\xFE����CTRL+ALT����\xC3\xFF����\xC3\xFF����\xC3\xFF����\xC3\xFF����\xFE����CTRL+ALT����\xC4\xFF����\xC4\xFF����\xC4\xFF����\xC4\xFF����\xFE����CTRL+ALT����\xC5\xFF����\xC5\xFF����\xC5\xFF����\xC5\xFF����\xFE����CTRL+ALT����\xC6\xFF����\xC6\xFF����\xC6\xFF����\xC6\xFF����	\xFE����CTRL+ALT����\xC7\xFF����\xC7\xFF����\xC7\xFF����\xC7\xFF����
+\xFE��\xFF��������\xFF��������\x95\xFF����\xB7\xFF��������\x97\xFF����\xB8\xFF��������\x9A\xFF����\xB9\xFF��������CTRL+ALT����\xAD\xFF����\xAD\xFF����\xAD\xFF����\xAD\xFF����#\xFE����\x96\xFF����\xB4\xFF��������\x9D\xFF����\xB5\xFF��������\x98\xFF����\xB6\xFF��������CTRL+ALT����\xAB\xFF����\xAB\xFF����\xAB\xFF����\xAB\xFF����"\xFE����\x9C\xFF����\xB1\xFF��������\x99\xFF����\xB2\xFF��������\x9B\xFF����\xB3\xFF��������\x9E\xFF����\xB0\xFF��������\x9F\xFF����\xAE\xFF����\x80��\xFE��������������
+��FOUR_LEVEL<������>������|������\xA6����������CTRL+ALT����\xC8\xFF����\xC8\xFF����\xC8\xFF����\xC8\xFF����\xFE����CTRL+ALT����\xC9\xFF����\xC9\xFF����\xC9\xFF����\xC9\xFF����\xFE������������&\xFF��������%\xFF��������#\xFF��������'\xFF��������"\xFF����������������\x8D\xFF������\xE4\xFF��������CTRL+ALT����\xAF\xFF����\xAF\xFF����\xAF\xFF����\xAF\xFF���� \xFE��+��PC_ALT_LEVEL2��a\xFF����\xFF����	��TWO_LEVEL��\xEA\xFF����\xE8\xFF��������
+\xFF��������P\xFF��������R\xFF��������U\xFF��������Q\xFF��������S\xFF��������W\xFF��������T\xFF��������V\xFF��������c\xFF��������\xFF\xFF����������������\xFF����\xFF����\xFF����*\xFF����\xBD\xFF��������\xB1����������PC_CONTROL_LEVEL2��\xFF����k\xFF��������J\xFF����\xAE\xFF����\xAE\xFF��������1\xFF��������4\xFF������������@��\xEB\xFF����@��\xEC\xFF��������g\xFF��������i\xFF��������f\xFF��������p\xFF����e\xFF��������q\xFF����W\xFF����k\xFF����m\xFF����h\xFF��������X\xFF����j\xFF��������e\xFF����\xFF������������/\xFF����+\xFF����]\xFF����{\xFF������������\x8A\xFF����A\xFF����B\xFF����.\xFF����Z\xFF����-\xFF����t\xFF����\xFF����\xFF����0\xFF����3\xFF����&\xFF����'\xFF������������,\xFF����,\xFF,\xFF����\xFF����\xFF1\xFF����\xFF����\xFF,\xFF����\xFF����>\xFF����n\
 xFF������������\x81\xFF����\xFF����s\xFF����V\xFF��������������������x\xFF����y\xFF����(����������)����������h\xFF����f\xFF��������\x81\xFF����E\xFF����F\xFF����G\xFF����H\xFF����I\xFF����������
 ��\xB2\xFF����\xA9\xFF����\xB0\xFF����\xB1\xFF��������\x80��~\xFF����������������\xE9\xFF��������������\xE7\xFF����@����������\xEB\xFF����@����������\xED\xFF��������\xFF����1\xFF����C\xFF����D\xFF����K\xFF����\xA7\xFF����V\xFF����\xFF����\x97\xFF������������a\xFF����������������\x8F\xFF��������������������\xFF����\x8E\xFF����\xFF����_\xFF����<\xFF����^\xFF����6\xFF������������i\xFF��������\xFF����\xFF����2\xFF����Y\xFF����\xFF����\xFF����\xFF����{\xFF����r\xFF����\x90\xFF����w\xFF����[\xFF����\x93\xFF����\x94\xFF����\x95\xFF������������������������������������������������������������������������������������P$%������\xFF����	��Caps Lock��\x80������������������Num Lock����\x80������������������Scroll Lock����������\x80����������������Compose������������������������������Kana����������������������
 ������Sleep��������������������������Suspend������������������������������Mute����������������������������Misc����	������������������������Mail����
+������������������������Charging��������������������������
+��Shift Lock\x80������������������Group 2������+\x80��������\xFE��������
+��Mouse Keys ����������������������\x8Ct&	��pc(pc105)��\������������������5��-*-helvetica-medium-r-normal--*-120-*-*-*-*-iso8859-1����description��������Generic 105��������black����white����grey20��grey10��green����green30��������NORM����\xFF\xFF��
+����\xB4��\xB4��
+������
+��\xA0��\xA0����BKSP����\xFF\xFF��
+����|\xB4��
+������
+��h\xA0����TABK����\xFF\xFF��
+����\xB4��
+������
+��\xA0����BKSL����\xFF\xFF��
+����\xB4��
+������
+��\xA0����RTRN����\xFF��
+����������������r2��r2��\xB4������\xB4��
+������
+��
+��^F��^F��\xA0����\xA0��
+����2������r��CAPS����\xFF\xFF��
+����J\xB4��
+������
+��6\xA0����LFSH����\xFF\xFF��
+����\xFA��\xB4��
+������
+��\xE6��\xA0����RTSH����\xFF\xFF��
+����\xF4\xB4��
+������
+��\xE0\xA0����MODK����\xFF\xFF��
+����\xB4��
+������
+��\xFA��\xA0����SMOD����\xFF\xFF��
+����\xE6��\xB4��
+������
+��\xD2��\xA0����SPCE����\xFF\xFF��
+����j\xB4��
+������
+��V\xA0����KP0������\xFF\xFF��
+����r\xB4��
+������
+��^\xA0����KPAD����\xFF\xFF��
+����\xB4��r
+������
+��\xA0��^��LEDS����\xFF\xFF��������\xEE\xC8����LED������\xFF\xFF��������2��
+����Function����\xDC��\xBE��\xB6+\xBE��������������
+��
+��������ESC��
+����FK01\xC8����FK02
+����FK03
+����FK04
+����FK05n����FK06
+����FK07
+����FK08
+����FK09n����FK10
+����FK11
+����FK12
+����PRSCP����SCLK
+����PAUS
+������Alpha��b\xBE��6\xB6������������
+��
+��������TLDE
+����AE01
+����AE02
+����AE03
+����AE04
+����AE05
+����AE06
+����AE07
+����AE08
+����AE09
+����AE10
+����AE11
+����AE12
+����BKSP
+��\xC8��
+��������TAB��
+��AD01
+����AD02
+����AD03
+����AD04
+����AD05
+����AD06
+����AD07
+����AD08
+����AD09
+����AD10
+����AD11
+����AD12
+����RTRN
+��\x86
+��+������CAPS
+��AC01
+����AC02
+����AC03
+����AC04
+����AC05
+����AC06
+����AC07
+����AC08
+����AC09
+����AC10
+����AC11
+����BKSL
+����D
+��+������LFSH
+��LSGT
+����AB01
+����AB02
+����AB03
+����AB04
+����AB05
+����AB06
+����AB07
+����AB08
+����AB09
+����AB10
+����RTSH
+��
+��������LCTL
+��LWIN
+��	LALT
+��	SPCE
+��
+RALT
+��	RWIN
+��	MENU
+��	RCTL
+��	��Editing������b0D\xB6����	��������
+��
+��������INS��
+����HOME
+����PGUP
+����\xC8��
+��������DELE
+����END��
+����PGDN
+����D\xC8��������UP����
+����
+��������LEFT
+����DOWN
+����RGHT
+������Keypadb\xB0\xB6����
+��������
+��
+��������NMLK
+����KPDV
+����KPMU
+����KPSU
+����\xC8��
+��������KP7��
+����KP8��
+����KP9��
+����KPAD
+��\x86
+��������KP4��
+����KP5��
+����KP6��
+����D
+��������KP1��
+����KP2��
+����KP3��
+����KPEN
+��
+��������KP0��
+��KPDL
+������LedPanel������\xDC��\xBA����+��������������Num Lock����r\xEC��������������	��Caps Lock��r\xE6����������������Scroll Lock������r\xEA����������������NumLockLabel����\xFA��\xC4����\xC6��d������������Num
+Lock����5��-*-helvetica-medium-r-normal--*-120-*-*-*-*-iso8859-1��+��CapsLockLabel��\xFA��\xBE����d����������	��Caps
+Lock��5��-*-helvetica-medium-r-normal--*-120-*-*-*-*-iso8859-1����ScrollLockLabel������\xFA��\xB8����\x8Cd������������Scroll
+Lock������5��-*-helvetica-medium-r-normal--*-120-*-*-*-*-iso8859-1��CAPSAC00LCTLAA00
\ No newline at end of file

Added: trunk/Tools/flatpak/files/httpd-autogen.sh (0 => 233362)


--- trunk/Tools/flatpak/files/httpd-autogen.sh	                        (rev 0)
+++ trunk/Tools/flatpak/files/httpd-autogen.sh	2018-06-29 17:47:17 UTC (rev 233362)
@@ -0,0 +1 @@
+autoreconf
\ No newline at end of file
Property changes on: trunk/Tools/flatpak/files/httpd-autogen.sh
___________________________________________________________________

Added: svn:executable

+* \ No newline at end of property

Added: trunk/Tools/flatpak/flatpakutils.py (0 => 233362)


--- trunk/Tools/flatpak/flatpakutils.py	                        (rev 0)
+++ trunk/Tools/flatpak/flatpakutils.py	2018-06-29 17:47:17 UTC (rev 233362)
@@ -0,0 +1,823 @@
+# Copyright (C) 2017 Igalia S.L.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this program; if not, write to the
+# Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301, USA.
+import argparse
+try:
+    import configparser
+except ImportError:
+    import ConfigParser as configparser
+import errno
+import json
+import os
+import shlex
+import shutil
+import subprocess
+import sys
+import tempfile
+import re
+
+try:
+    from urllib.parse import urlparse  # pylint: disable=E0611
+except ImportError:
+    from urlparse import urlparse
+
+try:
+    from urllib.request import urlretrieve  # pylint: disable=E0611
+except ImportError:
+    from urllib import urlretrieve
+
+FLATPAK_REQ = [
+    ("flatpak", "0.10.0"),
+    ("flatpak-builder", "0.10.0"),
+]
+
+scriptdir = os.path.abspath(os.path.dirname(__file__))
+
+
+class Colors:
+    HEADER = "\033[95m"
+    OKBLUE = "\033[94m"
+    OKGREEN = "\033[92m"
+    WARNING = "\033[93m"
+    FAIL = "\033[91m"
+    ENDC = "\033[0m"
+
+
+class Console:
+
+    quiet = False
+
+    @classmethod
+    def message(cls, str_format, *args):
+        if cls.quiet:
+            return
+
+        if args:
+            print(str_format % args)
+        else:
+            print(str_format)
+
+        # Flush so that messages are printed at the right time
+        # as we use many subprocesses.
+        sys.stdout.flush()
+
+
+def check_flatpak():
+    # Flatpak is only supported on Linux.
+    if not sys.platform.startswith("linux"):
+        return False
+
+    for app, required_version in FLATPAK_REQ:
+        try:
+            output = subprocess.check_output([app, "--version"])
+        except subprocess.CalledProcessError, OSError:
+            Console.message("\n%sYou need to install %s >= %s"
+                            " to be able to use the '%s' script.\n\n"
+                            "You can find some informations about"
+                            " how to install it for your distribution at:\n"
+                            "    * http://flatpak.org/%s\n", Colors.FAIL,
+                            app, required_version, sys.argv[0], Colors.ENDC)
+            return False
+
+        def comparable_version(version):
+            return tuple(map(int, (version.split("."))))
+
+        version = output.decode("utf-8").split(" ")[1].strip("\n")
+        if comparable_version(version) < comparable_version(required_version):
+            Console.message("\n%s%s %s required but %s found."
+                            " Please update and try again%s\n", Colors.FAIL,
+                            app, required_version, version, Colors.ENDC)
+            return False
+
+    return True
+
+
+def remove_extension_points(array):
+    result_args = []
+    for arg in array:
+        if(not arg.startswith('--extension')):
+            result_args.append(arg)
+    return result_args
+
+
+def remove_comments(string):
+    pattern = r"(\".*?\"|\'.*?\')|(/\*.*?\*/|//[^\r\n]*$)"
+    # first group captures quoted strings (double or single)
+    # second group captures comments (//single-line or /* multi-line */)
+    regex = re.compile(pattern, re.MULTILINE | re.DOTALL)
+
+    def _replacer(match):
+        # if the 2nd group (capturing comments) is not None,
+        # it means we have captured a non-quoted (real) comment string.
+        if match.group(2) is not None:
+            return ""  # so we will return empty to remove the comment
+        else:  # otherwise, we will return the 1st group
+            return match.group(1)  # captured quoted-string
+    return regex.sub(_replacer, string)
+
+
+def load_manifest(manifest_path, port_name=None, command=None):
+    is_yaml = manifest_path.endswith('.yaml')
+    with open(manifest_path, "r") as mr:
+        contents = mr.read()
+
+        contents = contents % {"COMMAND": command, "PORTNAME": port_name}
+        if is_yaml:
+            import yaml
+
+            manifest = yaml.load(contents)
+        else:
+            contents = remove_comments(contents)
+            manifest = json.loads(contents)
+
+    return manifest
+
+
+def expand_manifest(manifest_path, outfile, port_name, source_root, command):
+    """Creates the manifest file."""
+    try:
+        os.remove(outfile)
+    except OSError:
+        pass
+
+    manifest = load_manifest(manifest_path, port_name, command)
+    if not manifest:
+        return False
+
+    if "sdk-hash" in manifest:
+        del manifest["sdk-hash"]
+    if "runtime-hash" in manifest:
+        del manifest["runtime-hash"]
+    i = 0
+    all_modules = []
+
+    overriden_modules = []
+    if "WEBKIT_EXTRA_MODULESETS" in os.environ:
+        overriden_modules = load_manifest(os.environ["WEBKIT_EXTRA_MODULESETS"])
+        if not overriden_modules:
+            overriden_modules = []
+    for modules in manifest["modules"]:
+        submanifest_path = None
+        if type(modules) is str:
+            submanifest_path = os.path.join(os.path.dirname(manifest_path), modules)
+            modules = load_manifest(submanifest_path, port_name, command)
+
+        if not isinstance(modules, list):
+            modules = [modules]
+
+        for module in modules:
+            for overriden_module in overriden_modules:
+                if module['name'] == overriden_module['name']:
+                    module = overriden_module
+                    overriden_modules.remove(module)
+                    break
+
+            all_modules.append(module)
+
+    # And add overriden modules right before the webkit port build def.
+    for overriden_module in overriden_modules:
+        all_modules.insert(-1, overriden_module)
+
+    manifest["modules"] = all_modules
+    for module in manifest["modules"]:
+        if not module.get("sources"):
+            continue
+
+        if module["sources"][0]["type"] == "git":
+            if port_name == module["name"]:
+                repo = "file://" + source_root
+                module["sources"][0]["url"] = repo
+
+        for source in module["sources"]:
+            if source["type"] == "patch" or (source["type"] == "file" and source.get('path')):
+                source["path"] = os.path.join(os.path.dirname(manifest_path), source["path"])
+        i += 1
+
+    with open(outfile, "w") as of:
+        of.write(json.dumps(manifest, indent=4))
+
+    return True
+
+
+class FlatpakObject:
+
+    def __init__(self, user):
+        self.user = user
+
+    def flatpak(self, command, *args, **kwargs):
+        show_output = kwargs.pop("show_output", False)
+        comment = kwargs.pop("commend", None)
+        if comment:
+            Console.message(comment)
+
+        command = ["flatpak", command]
+        if self.user:
+            res = subprocess.check_output(command + ["--help"]).decode("utf-8")
+            if "--user" in res:
+                command.append("--user")
+        command.extend(args)
+
+        if not show_output:
+            return subprocess.check_output(command).decode("utf-8")
+
+        return subprocess.check_call(command)
+
+
+class FlatpakPackages(FlatpakObject):
+
+    def __init__(self, repos, user=True):
+        FlatpakObject.__init__(self, user=user)
+
+        self.repos = repos
+
+        self.runtimes = self.__detect_runtimes()
+        self.apps = self.__detect_apps()
+        self.packages = self.runtimes + self.apps
+
+    def __detect_packages(self, *args):
+        packs = []
+        package_defs = [rd
+                        for rd in self.flatpak("list", "-d", "--all", *args).split("\n")
+                        if rd]
+        for package_def in package_defs:
+            splited_packaged_def = package_def.split()
+            name, arch, branch = splited_packaged_def[0].split("/")
+
+            # If installed from a file, the package is in no repo
+            repo_name = splited_packaged_def[1]
+            repo = self.repos.repos.get(repo_name)
+
+            packs.append(FlatpakPackage(name, branch, repo, arch))
+
+        return packs
+
+    def __detect_runtimes(self):
+        return self.__detect_packages("--runtime")
+
+    def __detect_apps(self):
+        return self.__detect_packages()
+
+    def __iter__(self):
+        for package in self.packages:
+            yield package
+
+
+class FlatpakRepos(FlatpakObject):
+
+    def __init__(self, user=True):
+        FlatpakObject.__init__(self, user=user)
+        self.repos = {}
+        self.update()
+
+    def update(self):
+        self.repos = {}
+        remotes = [row
+                   for row in self.flatpak("remote-list", "-d").split("\n")
+                   if row]
+        for repo in remotes:
+            for components in [repo.split(" "), repo.split("\t")]:
+                if len(components) == 1:
+                    components = repo.split("\t")
+                name = components[0]
+                desc = ""
+                url = ""
+                for elem in components[1:]:
+                    if not elem:
+                        continue
+                    parsed_url = urlparse(elem)
+                    if parsed_url.scheme:
+                        url = ""
+                        break
+
+                    if desc:
+                        desc += " "
+                    desc += elem
+
+                if url:
+                    break
+
+            if not url:
+                Console.message("No valid URI found for: %s", repo)
+                continue
+
+            self.repos[name] = FlatpakRepo(name, url, desc, repos=self)
+
+        self.packages = FlatpakPackages(self)
+
+    def add(self, repo, override=True):
+        same_name = None
+        for name, tmprepo in self.repos.items():
+            if repo.url == tmprepo.url:
+                return tmprepo
+            elif repo.name == name:
+                same_name = tmprepo
+
+        if same_name:
+            if override:
+                self.flatpak("remote-modify", repo.name, "--url="" + repo.url,
+                             comment="Setting repo %s URL from %s to %s"
+                             % (repo.name, same_name.url, repo.url))
+                same_name.url = ""
+
+                return same_name
+            else:
+                return None
+        else:
+            self.flatpak("remote-add", repo.name, "--from", repo.repo_file.name,
+                         "--if-not-exists",
+                         comment="Adding repo %s" % repo.name)
+
+        repo.repos = self
+        return repo
+
+
+class FlatpakRepo(FlatpakObject):
+
+    def __init__(self, name, desc=None, url=""
+                 repo_file=None, user=True, repos=None):
+        FlatpakObject.__init__(self, user=user)
+
+        self.name = name
+        self.url = ""
+        self.desc = desc
+        self.repo_file_name = repo_file
+        self._repo_file = None
+        self.repos = repos
+        assert name
+        if repo_file and not url:
+            repo = configparser.ConfigParser()
+            repo.read(self.repo_file.name)
+            self.url = "" Repo"]["Url"]
+        else:
+            assert url
+
+    @property
+    def repo_file(self):
+        if self._repo_file:
+            return self._repo_file
+
+        assert self.repo_file_name
+        self._repo_file = tempfile.NamedTemporaryFile(mode="w")
+        urlretrieve(self.repo_file_name, self._repo_file.name)
+
+        return self._repo_file
+
+
+class FlatpakPackage(FlatpakObject):
+    """A flatpak app."""
+
+    def __init__(self, name, branch, repo, arch, user=True, hash=None, assumeyes=False):
+        FlatpakObject.__init__(self, user=user)
+
+        self.name = name
+        self.branch = str(branch)
+        self.repo = repo
+        self.arch = arch
+        self.hash = hash
+        self.assumeyes = assumeyes
+
+    def __str__(self):
+        return "%s/%s/%s %s" % (self.name, self.arch, self.branch, self.repo.name)
+
+    def is_installed(self, branch):
+        if not self.repo:
+            # Bundle installed from file
+            return True
+
+        self.repo.repos.update()
+        for package in self.repo.repos.packages:
+            if package.name == self.name and \
+                    package.branch == branch and \
+                    package.arch == self.arch:
+                return True
+
+        return False
+
+    def install(self):
+        if not self.repo:
+            return False
+
+        args = ["install", self.repo.name, self.name, "--reinstall", self.branch]
+
+        if self.assumeyes:
+            args.append("--assumeyes")
+
+        self.flatpak(*args, show_output=True,
+                     comment="Installing from " + self.repo.name + " " +
+                             self.name + " " + self.arch + " " + self.branch)
+
+    def update(self):
+        if not self.is_installed(self.branch):
+            return self.install()
+
+        extra_args = []
+        comment = "Updating %s" % self.name
+        if self.hash:
+            extra_args = ["--commit", self.hash]
+            comment += " to %s" % self.hash
+
+        if self.assumeyes:
+            extra_args.append("--assumeyes")
+
+        self.flatpak("update", self.name, self.branch, show_output=True,
+                    *extra_args, comment=comment)
+
+
+class WebkitFlatpak:
+
+    @staticmethod
+    def load_from_args(args=None):
+        self = WebkitFlatpak()
+
+        parser = argparse.ArgumentParser(prog="webkit-flatpak")
+        general = parser.add_argument_group("General")
+        general.add_argument("--debug",
+                            help="Compile with Debug configuration, also installs Sdk debug symboles.",
+                            action=""
+        general.add_argument("--release", help="Compile with Release configuration.", action=""
+        general.add_argument('--platform', action='', help='Platform to use (e.g., "mac-lion")'),
+        general.add_argument('--gtk', action='', dest='platform', const='gtk',
+                             help='Alias for --platform=gtk')
+        general.add_argument('--wpe', action='', dest='platform', const='wpe',
+                            help=('Alias for --platform=wpe'))
+        general.add_argument("-nf", "--no-flatpak-update", dest="no_flatpak_update",
+                            action=""
+                            help="Do not update flaptak runtime/sdk")
+        general.add_argument("-u", "--update", dest="update",
+                            action=""
+                            help="Update the runtime/sdk/app and rebuild the development environment if needed")
+        general.add_argument("-b", "--build-webkit", dest="build_webkit",
+                            action=""
+                            help="Force rebuilding the app.")
+        general.add_argument("-ba", "--build-all", dest="build_all",
+                            action=""
+                            help="Force rebuilding the app and its dependencies.")
+        general.add_argument("-q", "--quiet", dest="quiet",
+                            action=""
+                            help="Do not print anything")
+        general.add_argument("-t", "--tests", dest="run_tests",
+                            nargs=argparse.REMAINDER,
+                            help="Run LayoutTests")
+        general.add_argument("-c", "--command",
+                            nargs=argparse.REMAINDER,
+                            help="The command to run in the sandbox",
+                            dest="user_command")
+        general.add_argument("-y", "--assumeyes",
+                            help="Automatically answer yes for all questions.",
+                            action=""
+        general.add_argument("args",
+                            nargs=argparse.REMAINDER,
+                            help="Arguments passed when starting %s" % self.name)
+        general.add_argument('--avalaible', action='', dest="check_avalaible", help='Check if required dependencies are avalaible.'),
+
+        debugoptions = parser.add_argument_group("Debugging")
+        debugoptions.add_argument("--gdb", nargs="?", help="Activate gdb, passing extra args to it if wanted.")
+        debugoptions.add_argument("-m", "--coredumpctl-matches", default="", help='Arguments to pass to gdb.')
+
+        buildoptions = parser.add_argument_group("Extra build arguments")
+        buildoptions.add_argument("--makeargs", help="Optional Makefile flags")
+        buildoptions.add_argument("--cmakeargs",
+                                help="One or more optional CMake flags (e.g. --cmakeargs=\"-DFOO=bar -DCMAKE_PREFIX_PATH=/usr/local\")")
+
+        general.add_argument("--clean", dest="clean", action=""
+            help="Clean previous builds and restart from scratch")
+
+        parser.parse_args(args=args, namespace=self)
+
+        return self
+
+    def __init__(self):
+        self.sdk_repo = None
+        self.runtime = None
+        self.locale = None
+        self.sdk = None
+        self.sdk_debug = None
+        self.app = None
+
+        self.quiet = False
+        self.packs = []
+        self.update = False
+        self.args = []
+        self.finish_args = None
+
+        self.no_flatpak_update = False
+        self.debug = False
+        self.clean = False
+        self.run_tests = None
+        self.source_root = os.path.normpath(os.path.abspath(os.path.join(scriptdir, '../../')))
+        # Where the source folder is mounted inside the sandbox.
+        self.sandbox_source_root = "/app/webkit"
+
+        self.build_webkit = False
+        self.build_all = False
+
+        self.sdk_branch = None
+        self.platform = "GTK"
+        self.build_type = "Release"
+        self.manifest_path = None
+        self.name = None
+        self.build_name = None
+        self.flatpak_root_path = None
+        self.cache_path = None
+        self.app_module = None
+        self.flatpak_default_args = []
+        self.check_avalaible = False
+        self.assumeyes = False
+
+        # Default application to run in the sandbox
+        self.command = None
+        self.user_command = []
+
+        # debug options
+        self.gdb = None
+        self.coredumpctl_matches = ""
+
+        # Extra build options
+        self.cmakeargs = ""
+        self.makeargs = ""
+
+    def clean_args(self):
+        self.platform = self.platform.upper()
+        self.build_type = "Debug" if self.debug else "Release"
+        if self.gdb is None and '--gdb' in sys.argv:
+            self.gdb = ""
+
+        self.command = "%s %s %s" % (os.path.join(self.sandbox_source_root,
+            "Tools/Scripts/run-minibrowser"),
+            "--" + self.platform.lower(),
+            " --debug" if self.debug else " --release")
+
+        self.name = "org.webkit.%s" % self.platform
+        self.manifest_path = os.path.abspath(os.path.join(scriptdir, '../flatpak/org.webkit.WebKit.yaml'))
+        self.build_name = self.name + "-generated"
+
+        build_root = os.path.join(self.source_root, 'WebKitBuild')
+        self.flatpak_build_path = os.path.join(build_root, self.platform, "FlatpakTree" + self.build_type)
+        self.cache_path = os.path.join(build_root, "FlatpakCache")
+        self.build_path = os.path.join(build_root, self.platform, self.build_type)
+        try:
+            os.makedirs(self.build_path)
+        except OSError as e:
+            if e.errno != errno.EEXIST:
+                raise e
+
+        Console.quiet = self.quiet
+        if not check_flatpak():
+            return False
+
+        repos = FlatpakRepos()
+        self.sdk_repo = repos.add(
+            FlatpakRepo("flathub",
+                        url=""
+                        repo_file="https://dl.flathub.org/repo/flathub.flatpakrepo"))
+
+        manifest = load_manifest(self.manifest_path)
+        if not manifest:
+            return False
+
+        self.sdk_branch = manifest["runtime-version"]
+        self.finish_args = manifest.get("finish-args", [])
+        self.finish_args = remove_extension_points(self.finish_args)
+        self.runtime = FlatpakPackage("org.gnome.Platform", self.sdk_branch,
+                                      self.sdk_repo, "x86_64",
+                                      hash=manifest.get("runtime-hash"),
+                                      assumeyes=self.assumeyes)
+        self.locale = FlatpakPackage("org.gnome.Platform.Locale",
+                                     self.sdk_branch, self.sdk_repo, "x86_64",
+                                     assumeyes=self.assumeyes)
+        self.sdk = FlatpakPackage("org.gnome.Sdk", self.sdk_branch,
+                                  self.sdk_repo, "x86_64",
+                                  hash=manifest.get("sdk-hash"),
+                                  assumeyes=self.assumeyes)
+        self.packs = [self.runtime, self.locale, self.sdk]
+
+        if self.debug:
+            self.sdk_debug = FlatpakPackage("org.gnome.Sdk.Debug", self.sdk_branch,
+                                      self.sdk_repo, "x86_64",
+                                      assumeyes=self.assumeyes)
+            self.packs.append(self.sdk_debug)
+        self.manifest_generated_path = os.path.join(self.cache_path,
+                                                    self.build_name + ".json")
+
+        return True
+
+    def _cleanup_faltpak_args_for_tests_if_needed(self, args):
+        if args and not args[0].endswith('run-webkit-tests'):
+            return self.finish_args
+
+        # We are going to run our own Xvfb server in the sandbox
+        unwanted_args = ["--socket=x11", "--device=all"]
+        finish_args = [e for e in self.finish_args if e not in unwanted_args]
+
+        return finish_args
+
+    def run_in_sandbox(self, *args, **kwargs):
+        cwd = kwargs.pop("cwd", None)
+        remove_devices = kwargs.pop("remove_devices", False)
+
+        if not isinstance(args, list):
+            args = list(args)
+        if args:
+            if os.path.exists(args[0]):
+                command = os.path.normpath(os.path.abspath(args[0]))
+                # Take into account the fact that the webkit source dir is remounted inside the sandbox.
+                args[0] = command.replace(self.source_root, self.sandbox_source_root)
+            if args[0].endswith("build-webkit"):
+                args.append("--prefix=/app")
+
+        sandbox_build_path = os.path.join(self.sandbox_source_root, "WebKitBuild", self.build_type)
+        with tempfile.NamedTemporaryFile(mode="w") as tmpscript:
+            flatpak_command = ["flatpak", "build", "--die-with-parent",
+                "--bind-mount=/run/host/%s=%s" % (tempfile.gettempdir(), tempfile.gettempdir()),
+                "--bind-mount=%s=%s" % (self.sandbox_source_root, self.source_root),
+                # We mount WebKitBuild/PORTNAME/BuildType to /app/webkit/WebKitBuild/BuildType
+                # so we can build WPE and GTK in a same source tree.
+                "--bind-mount=%s=%s" % (sandbox_build_path, self.build_path)]
+
+            forwarded = {
+                "WEBKIT_TOP_LEVEL": "/app/",
+                "TEST_RUNNER_INJECTED_BUNDLE_FILENAME": "/app/webkit/lib/libTestRunnerInjectedBundle.so",
+            }
+
+            for envvar, value in os.environ.items():
+                if envvar.split("_")[0] in ("GST", "GTK", "G") or \
+                        envvar in ["WAYLAND_DISPLAY", "DISPLAY", "LANG"]:
+                    forwarded[envvar] = value
+
+            for envvar, value in forwarded.items():
+                flatpak_command.append("--env=%s=%s" % (envvar, value))
+
+            finish_args = self._cleanup_faltpak_args_for_tests_if_needed(args)
+            flatpak_command += finish_args + [self.flatpak_build_path]
+
+            shell_string = ""
+            if args:
+                if cwd:
+                    shell_string = 'cd "%s" && "%s"' % (cwd, '" "'.join(args))
+                else:
+                    shell_string = '"%s"' % ('" "'.join(args))
+            else:
+                shell_string = self.command
+                if self.args:
+                    shell_string += ' "%s"' % '" "'.join(self.args)
+
+            tmpscript.write(shell_string)
+            tmpscript.flush()
+
+            Console.message('Running in sandbox: "%s" %s\n' % ('" "'.join(flatpak_command), shell_string))
+            flatpak_command.extend(['sh', "/run/host/" + tmpscript.name])
+
+            try:
+                subprocess.check_call(flatpak_command)
+            except subprocess.CalledProcessError as e:
+                sys.stderr.write(str(e) + "\n")
+                return e.returncode
+
+        return 0
+
+    def run(self):
+        if not self.clean_args():
+            return 1
+
+        if self.check_avalaible:
+            return 0
+
+        if self.clean:
+            if os.path.exists(self.flatpak_build_path):
+                shutil.rmtree(self.flatpak_build_path)
+            if os.path.exists(self.build_path):
+                shutil.rmtree(self.build_path)
+
+        if self.update:
+            Console.message("Updating Flatpak environment for %s (%s)" % (
+                self.platform, self.build_type))
+            if not self.no_flatpak_update:
+                self.update_all()
+
+        return self.setup_dev_env()
+
+    def has_environment(self):
+        return os.path.exists(os.path.join(self.build_path, self.flatpak_build_path))
+
+    def setup_dev_env(self):
+        if not os.path.exists(os.path.join(self.build_path, self.flatpak_build_path)) \
+                or self.update or self.build_all:
+            self.install_all()
+            Console.message("Building %s and dependencies in %s",
+                            self.name, self.flatpak_build_path)
+
+            # Create environment dirs if necessary
+            try:
+                os.makedirs(os.path.dirname(self.manifest_generated_path))
+            except OSError as e:
+                if e.errno != errno.EEXIST:
+                    raise e
+            if not expand_manifest(self.manifest_path, self.manifest_generated_path,
+                                   self.name, self.sandbox_source_root, self.command):
+                return 1
+
+            builder_args = ["flatpak-builder", "--disable-rofiles-fuse", "--state-dir",
+                            self.cache_path, "--ccache", self.flatpak_build_path, "--force-clean",
+                            self.manifest_generated_path]
+            builder_args.append("--build-only")
+            builder_args.append("--stop-at=%s" % self.name)
+            subprocess.check_call(builder_args)
+
+        if not self.update and not os.path.exists(os.path.join(self.build_path, "bin", "MiniBrowser")):
+            self.build_webkit = True
+
+        if self.build_webkit:
+            builder = [os.path.join(self.sandbox_source_root, 'Tools/Scripts/build-webkit'),
+                "--debug" if self.debug  else "--release", '--' + self.platform.lower()]
+            if self.makeargs:
+                builder.append("--makeargs=%s" % self.makeargs)
+            if self.cmakeargs:
+                builder.append("--makeargs=%s" % self.cmakeargs)
+            Console.message("Building webkit")
+            res = self.run_in_sandbox(*builder)
+
+            if res:
+                return res
+        else:
+            Console.message("Using %s prefix in %s", self.name, self.flatpak_build_path)
+
+        if self.run_tests is not None:
+            test_launcher = [os.path.join(self.sandbox_source_root, 'Tools/Scripts/run-webkit-tests'),
+                "--debug" if self.debug  else "--release", '--' + self.platform.lower()] + self.run_tests
+            return self.run_in_sandbox(*test_launcher)
+        elif self.gdb is not None:
+            return self.run_gdb()
+        elif self.user_command:
+            return self.run_in_sandbox(*self.user_command)
+        elif not self.update and not self.build_webkit:
+            return self.run_in_sandbox()
+
+        return 0
+
+    def install_all(self):
+        for package in self.packs:
+            if not package.is_installed(self.sdk_branch):
+                package.install()
+
+    def run_gdb(self):
+        try:
+            subprocess.check_output(['which', 'coredumpctl'])
+        except subprocess.CalledProcessError as e:
+            sys.stderr.write("'coredumpctl' not present on the system, can't run. (%s)\n" % e)
+            return e.returncode
+
+        # We need access to the host from the sandbox to run.
+        with tempfile.NamedTemporaryFile() as coredump:
+            with tempfile.NamedTemporaryFile() as stderr:
+                subprocess.check_call(["coredumpctl", "dump"] + shlex.split(self.coredumpctl_matches),
+                                      stdout=coredump, stderr=stderr)
+
+                with open(stderr.name, 'r') as stderrf:
+                    stderr = stderrf.read()
+                executable, = re.findall(".*Executable: (.*)", stderr)
+                if not executable.startswith("/newroot"):
+                    sys.stderr.write("Executable %s doesn't seem to be a flatpaked application.\n" % executable)
+
+                executable = executable.replace("/newroot", "")
+                args = ["gdb", executable, "/run/host/%s" % coredump.name] + shlex.split(self.gdb)
+
+                return self.run_in_sandbox(*args)
+
+    def update_all(self):
+        for m in [self.runtime, self.sdk, self.sdk_debug]:
+            if m:
+                m.update()
+
+
+def is_sandboxed():
+    return os.path.exists("/usr/manifest.json")
+
+
+def run_in_sandbox_if_available(args):
+    if is_sandboxed():
+        return None
+
+    if not check_flatpak():
+        return None
+
+    flatpak_runner = WebkitFlatpak.load_from_args(args)
+    if not flatpak_runner.clean_args():
+        return None
+
+    if not flatpak_runner.has_environment():
+        return None
+
+    sys.exit(flatpak_runner.run_in_sandbox(*args))

Added: trunk/Tools/flatpak/org.webkit.GTK.yaml (0 => 233362)


--- trunk/Tools/flatpak/org.webkit.GTK.yaml	                        (rev 0)
+++ trunk/Tools/flatpak/org.webkit.GTK.yaml	2018-06-29 17:47:17 UTC (rev 233362)
@@ -0,0 +1,121 @@
+- name: mesa
+  sources:
+    - type: archive
+      url: https://mesa.freedesktop.org/archive/mesa-18.0.3.tar.xz
+      sha256: 099d9667327a76a61741a533f95067d76ea71a656e66b91507b3c0caf1d49e30
+  config-opts:
+    - --prefix=/app/softGL
+    - --disable-dri3
+    - --enable-dri
+    - --enable-glx
+    - --enable-egl
+    - --with-egl-platforms=x11,wayland
+    - --with-dri-drivers=swrast
+    - --with-gallium-drivers=swrast
+
+- name: webkitgtk-test-fonts
+  no-autogen: true
+  sources:
+    - type: git
+      url: https://github.com/WebKitGTK/webkitgtk-test-fonts.git
+  buildsystem: simple
+  build-commands:
+    # FIXME: Make ActivateFontWPE smarter.
+    - make install DESTDIR=/app/WebKitBuild/DependenciesGTK/Root
+
+- name: xorg-util-macros
+  sources:
+    - type: git
+      url: https://anongit.freedesktop.org/git/xorg/util/macros.git
+      branch: util-macros-1.19.2
+
+- name: xorg-font-util
+  sources:
+    - type: git
+      url: https://anongit.freedesktop.org/git/xorg/font/util.git
+      branch: font-util-1.3.1
+
+- name: xkbfile
+  sources:
+    - type: git
+      branch: libxkbfile-1.0.9
+      url: https://anongit.freedesktop.org/git/xorg/lib/libxkbfile.git
+
+- name: fontenc
+  sources:
+    - type: git
+      branch: libfontenc-1.1.3
+      url: https://anongit.freedesktop.org/git/xorg/lib/libfontenc.git
+
+- name: xfont
+  sources:
+    - type: git
+      branch: libXfont2-2.0.3
+      url: https://anongit.freedesktop.org/git/xorg/lib/libXfont.git
+
+- name: xvfb
+  sources:
+    - type: git
+      url: https://anongit.freedesktop.org/git/xorg/xserver.git
+      branch: xorg-server-1.19.6
+    - type: patch
+      path: patches/xvfb-0001-HACK-Avoid-compiling-a-kbm-file.patch
+    - type: patch
+      path: ../gtk/patches/xserver-remove-bogus-dependencies.patch
+    - type: patch
+      path: ../gtk/patches/xserver-search-for-DRI-drivers-at-LIBGL_DRIVERS_PATH-environ.patch
+  config-opts:
+    - --enable-xvfb
+    - --disable-xwayland
+    - --enable-xvfb
+    - --disable-xwayland
+    - --disable-xinerama
+    - --enable-glx
+    - --enable-composite
+    - --disable-xorg
+    - --disable-dmx
+    - --disable-xnest
+    - --disable-xquartz
+    - --disable-xwin
+    - --disable-xephyr
+    - --disable-xfake
+    - --disable-xfbdev
+    - --disable-install-setuid
+    - --disable-unit-tests
+    - --disable-present
+    - --enable-unix-transport
+    - --enable-tcp-transport
+    - --disable-local-transport
+    - --without-dtrace
+
+# Required for run-gtk-tests
+- name: pycairo
+  buildsystem: simple
+  build-commands:
+  - python2 setup.py install --prefix=/app
+  sources:
+  - type: archive
+    url: https://pypi.python.org/packages/ef/97/b33dc533ea6076d4ea9cbd2fe049a2b4a3df5c5b6fba9a182616f6f8d310/pycairo-1.15.4.tar.gz
+    sha256: ee4c3068c048230e5ce74bb8994a024711129bde1af1d76e3276c7acd81c4357
+  cleanup:
+  - "/include"
+  - "/lib/pkgconfig"
+
+- name: pygobject-python2
+  build-options:
+    env:
+      PYTHON: "/usr/bin/python2"
+  sources:
+  - type: archive
+    url: https://download.gnome.org/sources/pygobject/3.28/pygobject-3.28.1.tar.xz
+    sha256: 42312b4a5015571fa0a4f2d201005da46b71c251ea2625bc95702d071c4ff895
+  cleanup:
+  - "/include"
+  - "/lib/pkgconfig"
+  - "/lib/python2.7/site-packages/gi/*.la"
+
+- name: org.webkit.GTK
+  buildsystem: simple
+  build-commands:
+    - /app/webkit/Tools/Scripts/build-webkit --gtk --prefix=/app
+

Added: trunk/Tools/flatpak/org.webkit.WPE.yaml (0 => 233362)


--- trunk/Tools/flatpak/org.webkit.WPE.yaml	                        (rev 0)
+++ trunk/Tools/flatpak/org.webkit.WPE.yaml	2018-06-29 17:47:17 UTC (rev 233362)
@@ -0,0 +1,43 @@
+- name: wpebackend
+  buildsystem: cmake-ninja
+  sources:
+    - type: git
+      url: https://github.com/WebPlatformForEmbedded/WPEBackend.git
+      branch: 761496dff51b6962200294b4fe2bc9529da731a8
+- name: wpebackend-fdo
+  buildsystem: cmake-ninja
+  sources:
+    - type: git
+      url: https://github.com/Igalia/WPEBackend-fdo.git
+      branch: bdd46870b1dc3c92005343e3161bdd24f620b11d
+- name: lua
+  buildsystem: simple
+  build-commands:
+    - make MYCFLAGS="$CFLAGS -fPIC -DLUA_COMPAT_5_2 -DLUA_COMPAT_5_1" linux
+    - make install INSTALL_TOP=/app INSTALL_MAN=/app/share/man/man1 INSTALL_DATA='cp -d'
+  sources:
+    - type: archive
+      url: https://www.lua.org/ftp/lua-5.3.4.tar.gz
+      sha1: 79790cfd40e09ba796b01a571d4d63b52b1cd950
+- name: luajit
+  buildsystem: simple
+  build-commands:
+    - make amalg PREFIX=/app
+    - make install PREFIX=/app
+  sources:
+    - type: archive
+      url: https://luajit.org/download/LuaJIT-2.0.5.tar.gz
+      md5: 48353202cbcacab84ee41a5a70ea0a2c
+- name: webkitgtk-test-fonts
+  no-autogen: true
+  sources:
+    - type: git
+      url: https://github.com/WebKitGTK/webkitgtk-test-fonts.git
+  buildsystem: simple
+  build-commands:
+    # FIXME: Make ActivateFontWPE smarter.
+    - make install DESTDIR=/app/WebKitBuild/DependenciesWPE/Root
+- name: org.webkit.WPE
+  buildsystem: simple
+  build-commands:
+    - /app/webkit/Tools/Scripts/build-webkit --wpe --prefix=/app
\ No newline at end of file

Added: trunk/Tools/flatpak/org.webkit.WebKit.yaml (0 => 233362)


--- trunk/Tools/flatpak/org.webkit.WebKit.yaml	                        (rev 0)
+++ trunk/Tools/flatpak/org.webkit.WebKit.yaml	2018-06-29 17:47:17 UTC (rev 233362)
@@ -0,0 +1,194 @@
+app-id: %(PORTNAME)s
+runtime: org.gnome.Platform
+runtime-version: "3.28"
+# Control the exact version of the Sdk/Runtime that is being used.
+sdk-hash: cea71fe86d6961b4fe58046170f8dc8f8d4d04141ddf211e7cc6db44a18a0c49
+runtime-hash: 9785cf7dc62290d76eef4bf0f5d25240fc5bb3d73128c25e95c4e4cb90bb3560
+sdk: org.gnome.Sdk
+command: %(COMMAND)s
+finish-args:
+  # Basically no sandboxing, the goal here is to make it flexible
+  # for developers, not really to isolate (openning all devices
+  # to allow acces video cameras until we have a portal at least).
+  - --share=ipc
+  - --socket=x11
+  - --socket=wayland
+  - --device=all
+  - --share=network
+  - --socket=pulseaudio
+  - --system-talk-name=org.freedesktop.GeoClue2
+  - --filesystem=host
+  - --socket=system-bus
+  - --talk-name=org.freedesktop.Flatpak
+  - --env=GST_PRESET_PATH=/app/share/gstreamer-1.0/presets/
+build-options:
+  cflags: -O2 -g
+  cxxflags: -O2 -g
+  strip: false
+  no-debuginfo: true
+modules:
+  # http and dependencies.
+  - name: apr
+    sources:
+      - type: archive
+        url: https://www.apache.org/dist/apr/apr-1.6.3.tar.bz2
+        sha256: 131f06d16d7aabd097fa992a33eec2b6af3962f93e6d570a9bd4d85e95993172
+  - name: apr-util
+    sources:
+      - type: archive
+        url: https://www.apache.org/dist/apr/apr-util-1.6.1.tar.bz2
+        sha512: "40eff8a37c0634f7fdddd6ca5e596b38de15fd10767a34c30bbe49c632816e8f3e1e230678034f578dd5816a94f246fb5dfdf48d644829af13bf28de3225205d"
+    config-opts:
+      - --with-apr=/app/bin/apr-1-config
+  - name: httpd
+    sources:
+      - type: git
+        url: https://github.com/apache/httpd.git
+        branch: 2.4.33
+      - type : file
+        path : files/httpd-autogen.sh
+        dest-filename : autogen.sh
+      # The version embedded in the sandbox doesn't have a working pcre-config
+      - type: patch
+        path: patches/httpd-0001-configure-use-pkg-config-for-PCRE-detection.patch
+    config-opts:
+      - --enable-mpms-shared=all
+      - --enable-modules=all
+      - --with-apr=/app/bin/apr-1-config
+      - --with-apr-util=/app/bin/apu-1-config
+      - --with-pcre=/app
+      - --enable-authnz-fcgi
+      - --enable-cgi
+      - --enable-cgid
+  - name: php
+    sources:
+      - type: archive
+        url: https://php.net/distributions/php-7.2.6.tar.xz
+        sha512: da86b1ff2df3b9e2d46e59a80296b940d81132975b621bdec9602f8b4c8d91a3fdcd4ffd7cb982d63d3ec974b3a12a7854e42a73b7f2cc8eefade14335aa7c71
+    config-opts:
+      - --disable-xml
+      - --disable-dom
+      - --disable-libxml
+      - --disable-simplexml
+      - --disable-xmlreader
+      - --disable-xmlwriter
+      - --without-pear
+      - --with-apxs2
+  - name: libevent
+    sources:
+      - type: git
+        url: https://github.com/libevent/libevent.git
+        branch: e7ff4ef # 2.1.8
+    config-opts:
+      - --disable-libevent-regress
+
+  # Requirement for flatpkutils
+  - name: python3-pyaml
+    buildsystem: simple
+    build-commands:
+    - pip3 install --no-index --find-links="file://${PWD}" --prefix=${FLATPAK_DEST}
+      pyaml
+    sources:
+    - type: file
+      url: https://files.pythonhosted.org/packages/4a/85/db5a2df477072b2902b0eb892feb37d88ac635d36245a72a6a69b23b383a/PyYAML-3.12.tar.gz
+      sha256: 592766c6303207a20efc445587778322d7f73b161bd994f227adaa341ba212ab
+    - type: file
+      url: https://files.pythonhosted.org/packages/9e/17/1d4ed6e1a4c0918a0357dfa2fdbe26bf63f6e616013c04a14bce9fd33e40/pyaml-17.12.1.tar.gz
+      sha256: 66623c52f34d83a2c0fc963e08e8b9d0c13d88404e3b43b1852ef71eda19afa3
+
+  - name: python2-pyaml
+    buildsystem: simple
+    build-commands:
+    - pip2 install --no-index --find-links="file://${PWD}" --target=/app/lib/python2.7/site-packages/
+      pyaml
+    sources:
+    - type: file
+      url: https://files.pythonhosted.org/packages/4a/85/db5a2df477072b2902b0eb892feb37d88ac635d36245a72a6a69b23b383a/PyYAML-3.12.tar.gz
+      sha256: 592766c6303207a20efc445587778322d7f73b161bd994f227adaa341ba212ab
+    - type: file
+      url: https://files.pythonhosted.org/packages/9e/17/1d4ed6e1a4c0918a0357dfa2fdbe26bf63f6e616013c04a14bce9fd33e40/pyaml-17.12.1.tar.gz
+      sha256: 66623c52f34d83a2c0fc963e08e8b9d0c13d88404e3b43b1852ef71eda19afa3
+
+  # GStreamer modules
+  - name: libvpx
+    no-autogen: true
+    sources:
+      - type: git
+        url: https://chromium.googlesource.com/webm/libvpx
+        branch: v1.7.0
+    config-opts:
+      - --enable-pic
+      - --as=yasm
+      - --disable-unit-tests
+      - --size-limit=16384x16384
+      - --enable-postproc
+      - --enable-multi-res-encoding
+      - --enable-temporal-denoising
+      - --enable-vp9-temporal-denoising
+      - --enable-vp9-postproc
+      - --enable-shared
+  - name: gstreamer
+    buildsystem: meson
+    sources:
+      - type: git
+        url: https://anongit.freedesktop.org/git/gstreamer/gstreamer
+        branch: 1.14.1
+    config-opts:
+      - -Ddisable_gtkdoc=true
+  - name: gst-plugins-base
+    buildsystem: meson
+    sources:
+      - type: git
+        url: https://anongit.freedesktop.org/git/gstreamer/gst-plugins-base
+        branch: 1.14.1
+    config-opts:
+      - -Ddisable_gtkdoc=true
+  - name: gst-plugins-good
+    buildsystem: meson
+    sources:
+      - type: git
+        url: https://anongit.freedesktop.org/git/gstreamer/gst-plugins-good
+        branch: 1.14.1
+      - type: patch
+        path: ../gstreamer/patches/gst-plugins-good-0002-qtdemux-add-context-for-a-preferred-protection.patch
+      - type: patch
+        path: ../gstreamer/patches/gst-plugins-good-0003-qtdemux-also-push-buffers-without-encryption-info-in.patch
+      - type: patch
+        path: ../gstreamer/patches/gst-plugins-good-0001-qtdemux-Do-not-run-the-preferred-decryptor-context-q.patch
+      - type: patch
+        path: ../gstreamer/patches/gst-plugins-good-0002-qtdemux-Do-not-unref-a-NULL-stream_tags.patch
+      - type: patch
+        path: ../gstreamer/patches/gst-plugins-good-0003-qtdemux-Clarify-field-name-about-stream-encryption-s.patch
+    config-opts:
+      - -Ddisable_gtkdoc=true
+  - name: gst-plugins-ugly
+    buildsystem: meson
+    sources:
+      - type: git
+        url: https://anongit.freedesktop.org/git/gstreamer/gst-plugins-ugly
+        branch: 1.14.1
+    config-opts:
+      - -Ddisable_gtkdoc=true
+  - name: gst-plugins-bad
+    buildsystem: meson
+    sources:
+      - type: git
+        url: https://anongit.freedesktop.org/git/gstreamer/gst-plugins-bad
+        branch: 1.14.1
+    config-opts:
+      - -Ddisable_gtkdoc=true
+
+  - name: libgcrypt # Speedup libgrcypt
+    sources:
+      - type: git
+        url: https://dev.gnupg.org/source/libgcrypt.git
+        branch: libgcrypt-1.7.6
+      - type: patch
+        path: patches/libgcrypt-0001-Use-pkg-config-to-detect-gpg-error.patch
+      - type: patch
+        path: ../gtk/patches/libgcrypt-use-only-dev-urandom-for-testing.patch
+    config-opts:
+      - --disable-doc
+
+  # Port specific components.
+  - %(PORTNAME)s.yaml
\ No newline at end of file

Added: trunk/Tools/flatpak/patches/httpd-0001-configure-use-pkg-config-for-PCRE-detection.patch (0 => 233362)


--- trunk/Tools/flatpak/patches/httpd-0001-configure-use-pkg-config-for-PCRE-detection.patch	                        (rev 0)
+++ trunk/Tools/flatpak/patches/httpd-0001-configure-use-pkg-config-for-PCRE-detection.patch	2018-06-29 17:47:17 UTC (rev 233362)
@@ -0,0 +1,50 @@
+From b5ebe404f1388ddda3603e53277f87e0b96ba695 Mon Sep 17 00:00:00 2001
+From: Thibault Saunier <[email protected]>
+Date: Mon, 11 Jun 2018 16:14:38 -0400
+Subject: [PATCH] configure: use pkg-config for PCRE detection
+
+---
+ configure.in | 27 +++++----------------------
+ 1 file changed, 5 insertions(+), 22 deletions(-)
+
+diff --git a/configure.in b/configure.in
+index 761e836..b155d4b 100644
+--- a/configure.in
++++ b/configure.in
+@@ -215,28 +215,11 @@ fi
+ AC_ARG_WITH(pcre,
+ APACHE_HELP_STRING(--with-pcre=PATH,Use external PCRE library))
+ 
+-AC_PATH_PROG(PCRE_CONFIG, pcre-config, false)
+-if test -d "$with_pcre" && test -x "$with_pcre/bin/pcre-config"; then
+-   PCRE_CONFIG=$with_pcre/bin/pcre-config
+-elif test -x "$with_pcre"; then
+-   PCRE_CONFIG=$with_pcre
+-fi
+-
+-if test "$PCRE_CONFIG" != "false"; then
+-  if $PCRE_CONFIG --version >/dev/null 2>&1; then :; else
+-    AC_MSG_ERROR([Did not find pcre-config script at $PCRE_CONFIG])
+-  fi
+-  case `$PCRE_CONFIG --version` in
+-  [[1-5].*])
+-    AC_MSG_ERROR([Need at least pcre version 6.0])
+-    ;;
+-  esac
+-  AC_MSG_NOTICE([Using external PCRE library from $PCRE_CONFIG])
+-  APR_ADDTO(PCRE_INCLUDES, [`$PCRE_CONFIG --cflags`])
+-  APR_ADDTO(PCRE_LIBS, [`$PCRE_CONFIG --libs`])
+-else
+-  AC_MSG_ERROR([pcre-config for libpcre not found. PCRE is required and available from http://pcre.org/])
+-fi
++PKG_CHECK_MODULES([PCRE], [libpcre], [
++  AC_DEFINE([HAVE_PCRE], [1], [Define if you have PCRE library])
++], [
++  AC_MSG_ERROR([$PCRE_PKG_ERRORS])
++])
+ APACHE_SUBST(PCRE_LIBS)
+ 
+ AC_MSG_NOTICE([])
+-- 
+2.17.1
+

Added: trunk/Tools/flatpak/patches/libgcrypt-0001-Use-pkg-config-to-detect-gpg-error.patch (0 => 233362)


--- trunk/Tools/flatpak/patches/libgcrypt-0001-Use-pkg-config-to-detect-gpg-error.patch	                        (rev 0)
+++ trunk/Tools/flatpak/patches/libgcrypt-0001-Use-pkg-config-to-detect-gpg-error.patch	2018-06-29 17:47:17 UTC (rev 233362)
@@ -0,0 +1,110 @@
+From 9aff3f1b344fc8666b14c57629162c2b9007cad8 Mon Sep 17 00:00:00 2001
+From: Thibault Saunier <[email protected]>
+Date: Fri, 29 Jun 2018 09:05:52 -0400
+Subject: [PATCH] Use pkg-config to detect gpg-error
+
+---
+ m4/gpg-error.m4 | 88 +++++++------------------------------------------
+ 1 file changed, 12 insertions(+), 76 deletions(-)
+
+diff --git a/m4/gpg-error.m4 b/m4/gpg-error.m4
+index 1661204c..5f9f33c2 100644
+--- a/m4/gpg-error.m4
++++ b/m4/gpg-error.m4
+@@ -41,81 +41,17 @@ AC_DEFUN([AM_PATH_GPG_ERROR],
+   AC_ARG_WITH(gpg-error-prefix,,
+               [gpg_error_config_prefix="$withval"])
+ 
+-  if test x"${GPG_ERROR_CONFIG}" = x ; then
+-     if test x"${gpg_error_config_prefix}" != x ; then
+-        GPG_ERROR_CONFIG="${gpg_error_config_prefix}/bin/gpg-error-config"
+-     else
+-       case "${SYSROOT}" in
+-         /*)
+-           if test -x "${SYSROOT}/bin/gpg-error-config" ; then
+-             GPG_ERROR_CONFIG="${SYSROOT}/bin/gpg-error-config"
+-           fi
+-           ;;
+-         '')
+-           ;;
+-          *)
+-           AC_MSG_WARN([Ignoring \$SYSROOT as it is not an absolute path.])
+-           ;;
+-       esac
+-     fi
+-  fi
++  PKG_CHECK_MODULES([GPG_ERROR], [gpg-error], [
++    AC_DEFINE([HAVE_GPG_ERROR], [1], [Define if you have gpg-error library])
+ 
+-  AC_PATH_PROG(GPG_ERROR_CONFIG, gpg-error-config, no)
+-  min_gpg_error_version=ifelse([$1], ,0.0,$1)
+-  AC_MSG_CHECKING(for GPG Error - version >= $min_gpg_error_version)
+-  ok=no
+-  if test "$GPG_ERROR_CONFIG" != "no" \
+-     && test -f "$GPG_ERROR_CONFIG" ; then
+-    req_major=`echo $min_gpg_error_version | \
+-               sed 's/\([[0-9]]*\)\.\([[0-9]]*\)/\1/'`
+-    req_minor=`echo $min_gpg_error_version | \
+-               sed 's/\([[0-9]]*\)\.\([[0-9]]*\)/\2/'`
+-    gpg_error_config_version=`$GPG_ERROR_CONFIG $gpg_error_config_args --version`
+-    major=`echo $gpg_error_config_version | \
+-               sed 's/\([[0-9]]*\)\.\([[0-9]]*\).*/\1/'`
+-    minor=`echo $gpg_error_config_version | \
+-               sed 's/\([[0-9]]*\)\.\([[0-9]]*\).*/\2/'`
+-    if test "$major" -gt "$req_major"; then
+-        ok=yes
+-    else
+-        if test "$major" -eq "$req_major"; then
+-            if test "$minor" -ge "$req_minor"; then
+-               ok=yes
+-            fi
+-        fi
+-    fi
+-  fi
+-  if test $ok = yes; then
+-    GPG_ERROR_CFLAGS=`$GPG_ERROR_CONFIG $gpg_error_config_args --cflags`
+-    GPG_ERROR_LIBS=`$GPG_ERROR_CONFIG $gpg_error_config_args --libs`
+-    GPG_ERROR_MT_CFLAGS=`$GPG_ERROR_CONFIG $gpg_error_config_args --mt --cflags 2>/dev/null`
+-    GPG_ERROR_MT_LIBS=`$GPG_ERROR_CONFIG $gpg_error_config_args --mt --libs 2>/dev/null`
+-    AC_MSG_RESULT([yes ($gpg_error_config_version)])
+-    ifelse([$2], , :, [$2])
+-    gpg_error_config_host=`$GPG_ERROR_CONFIG $gpg_error_config_args --host 2>/dev/null || echo none`
+-    if test x"$gpg_error_config_host" != xnone ; then
+-      if test x"$gpg_error_config_host" != x"$host" ; then
+-  AC_MSG_WARN([[
+-***
+-*** The config script $GPG_ERROR_CONFIG was
+-*** built for $gpg_error_config_host and thus may not match the
+-*** used host $host.
+-*** You may want to use the configure option --with-gpg-error-prefix
+-*** to specify a matching config script or use \$SYSROOT.
+-***]])
+-        gpg_config_script_warn="$gpg_config_script_warn libgpg-error"
+-      fi
+-    fi
+-  else
+-    GPG_ERROR_CFLAGS=""
+-    GPG_ERROR_LIBS=""
+-    GPG_ERROR_MT_CFLAGS=""
+-    GPG_ERROR_MT_LIBS=""
+-    AC_MSG_RESULT(no)
+-    ifelse([$3], , :, [$3])
+-  fi
+-  AC_SUBST(GPG_ERROR_CFLAGS)
+-  AC_SUBST(GPG_ERROR_LIBS)
+-  AC_SUBST(GPG_ERROR_MT_CFLAGS)
+-  AC_SUBST(GPG_ERROR_MT_LIBS)
++    GPG_ERROR_MT_CFLAGS="$GPG_ERROR_CFLAGS"
++    GPG_ERROR_MT_LIBS="-lpthread $GPG_ERROR_LIBS"
++
++    AC_SUBST(GPG_ERROR_CFLAGS)
++    AC_SUBST(GPG_ERROR_LIBS)
++    AC_SUBST(GPG_ERROR_MT_CFLAGS)
++    AC_SUBST(GPG_ERROR_MT_LIBS)
++  ], [
++    AC_MSG_ERROR([$GPG_ERROR_ERRORS])
++  ])
+ ])
+-- 
+2.18.0
+

Added: trunk/Tools/flatpak/patches/xvfb-0001-HACK-Avoid-compiling-a-kbm-file.patch (0 => 233362)


--- trunk/Tools/flatpak/patches/xvfb-0001-HACK-Avoid-compiling-a-kbm-file.patch	                        (rev 0)
+++ trunk/Tools/flatpak/patches/xvfb-0001-HACK-Avoid-compiling-a-kbm-file.patch	2018-06-29 17:47:17 UTC (rev 233362)
@@ -0,0 +1,50 @@
+From aed1b6e8de41375c1b8b1dfc48a350e0a9b9cbba Mon Sep 17 00:00:00 2001
+From: Thibault Saunier <[email protected]>
+Date: Mon, 11 Jun 2018 10:55:43 -0400
+Subject: [PATCH xserver] HACK: Avoid compiling a kbm file
+
+This would need to be in /usr/share/X11/ as this is where
+resource files are in the sandbox but it is read only in there.
+
+Hack around that.
+---
+ xkb/ddxLoad.c | 9 +--------
+ xkb/xkbInit.c | 2 +-
+ 2 files changed, 2 insertions(+), 9 deletions(-)
+
+diff --git a/xkb/ddxLoad.c b/xkb/ddxLoad.c
+index bbe3952..a4a03a1 100644
+--- a/xkb/ddxLoad.c
++++ b/xkb/ddxLoad.c
+@@ -148,14 +148,7 @@ RunXkbComp(xkbcomp_buffer_callback callback, void *userdata)
+         }
+     }
+ 
+-    if (asprintf(&buf,
+-                 "\"%s%sxkbcomp\" -w %d %s -xkm \"%s\" "
+-                 "-em1 %s -emp %s -eml %s \"%s%s.xkm\"",
+-                 xkbbindir, xkbbindirsep,
+-                 ((xkbDebugFlags < 2) ? 1 :
+-                  ((xkbDebugFlags > 10) ? 10 : (int) xkbDebugFlags)),
+-                 xkbbasedirflag ? xkbbasedirflag : "", xkmfile,
+-                 PRE_ERROR_MSG, ERROR_PREFIX, POST_ERROR_MSG1,
++    if (asprintf(&buf, "cp /app/webkit/Tools/flatpak/files/default.xkm \"%s%s.xkm\"",
+                  xkm_output_dir, keymap) == -1)
+         buf = NULL;
+ 
+diff --git a/xkb/xkbInit.c b/xkb/xkbInit.c
+index 9c772f5..4e0b774 100644
+--- a/xkb/xkbInit.c
++++ b/xkb/xkbInit.c
+@@ -87,7 +87,7 @@ typedef struct _SrvXkmInfo {
+ #define	XKB_DFLT_RULES_PROP	TRUE
+ #endif
+ 
+-const char *XkbBaseDirectory = XKB_BASE_DIRECTORY;
++const char *XkbBaseDirectory = "/usr/share/X11/xkb/";
+ const char *XkbBinDirectory = XKB_BIN_DIRECTORY;
+ static int XkbWantAccessX = 0;
+ 
+-- 
+2.17.1
+
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to