WebKit Bugzilla
Attachment 343333 Details for
Bug 186771
: [WPE]: Add a way to setup our development environment inside flatpak
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
GTKWPE-Add-a-way-to-setup-our-development-environm.patch (text/plain), 88.77 KB, created by
Thibault Saunier
on 2018-06-22 09:42:11 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Thibault Saunier
Created:
2018-06-22 09:42:11 PDT
Size:
88.77 KB
patch
obsolete
>From dfe99028c8ebaf4ca05f476e561dc97754e40c4d Mon Sep 17 00:00:00 2001 >From: Thibault Saunier <tsaunier@igalia.com> >Date: Mon, 4 Jun 2018 14:57:08 -0400 >Subject: [PATCH xserver] [GTK][WPE]: Add a way to setup our development > environment inside flatpak > >https://bugs.webkit.org/show_bug.cgi?id=186771 >--- > LayoutTests/ChangeLog | 9 + > LayoutTests/http/conf/flatpak-httpd.conf | 153 ++++ > Tools/ChangeLog | 116 +++ > Tools/Scripts/build-webkit | 7 + > Tools/Scripts/generate-jsc-bundle | 6 +- > Tools/Scripts/run-gtk-tests | 14 +- > Tools/Scripts/run-minibrowser | 2 + > Tools/Scripts/run-webdriver-tests | 18 +- > Tools/Scripts/run-webkit-tests | 10 +- > Tools/Scripts/run-wpe-tests | 12 +- > Tools/Scripts/update-webkitgtk-flatpak | 28 + > Tools/Scripts/update-webkitwpe-flatpak | 28 + > Tools/Scripts/webkit-flatpak | 28 + > Tools/Scripts/webkitdirs.pm | 61 +- > Tools/Scripts/webkitpy/port/base.py | 19 +- > Tools/Scripts/webkitpy/port/gtk.py | 11 +- > .../webkitpy/port/linux_get_crash_log.py | 38 +- > Tools/Scripts/webkitpy/port/wpe.py | 6 + > Tools/Scripts/webkitpy/w3c/wpt_runner.py | 7 +- > Tools/flatpak/files/default.xkm | Bin 0 -> 12032 bytes > Tools/flatpak/files/httpd-autogen.sh | 1 + > Tools/flatpak/flatpakutils.py | 776 ++++++++++++++++++ > Tools/flatpak/org.webkit.GTK.yaml | 125 +++ > Tools/flatpak/org.webkit.WPE.yaml | 47 ++ > Tools/flatpak/org.webkit.WebKit.yaml | 181 ++++ > ...re-use-pkg-config-for-PCRE-detection.patch | 50 ++ > ...0001-HACK-Avoid-compiling-a-kbm-file.patch | 50 ++ > 27 files changed, 1761 insertions(+), 42 deletions(-) > create mode 100644 LayoutTests/http/conf/flatpak-httpd.conf > create mode 100755 Tools/Scripts/update-webkitgtk-flatpak > create mode 100755 Tools/Scripts/update-webkitwpe-flatpak > create mode 100755 Tools/Scripts/webkit-flatpak > create mode 100644 Tools/flatpak/files/default.xkm > create mode 100755 Tools/flatpak/files/httpd-autogen.sh > create mode 100644 Tools/flatpak/flatpakutils.py > create mode 100644 Tools/flatpak/org.webkit.GTK.yaml > create mode 100644 Tools/flatpak/org.webkit.WPE.yaml > create mode 100644 Tools/flatpak/org.webkit.WebKit.yaml > create mode 100644 Tools/flatpak/patches/httpd-0001-configure-use-pkg-config-for-PCRE-detection.patch > create mode 100644 Tools/flatpak/patches/xvfb-0001-HACK-Avoid-compiling-a-kbm-file.patch > >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index 608fbc5adf4..c3dc3f6ab21 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,12 @@ >+2018-06-18 Thibault Saunier <tsaunier@igalia.com> >+ >+ [GTK][WPE]: Add a way to setup our development environment inside flatpak >+ https://bugs.webkit.org/show_bug.cgi?id=186771 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * http/conf/flatpak-httpd.conf: Added. Apache configuration file to be used inside flaptak. >+ > 2018-06-18 Zan Dobersek <zdobersek@igalia.com> > > Unreviewed WPE gardening. Manage the current set of CSS3 Filters and >diff --git a/LayoutTests/http/conf/flatpak-httpd.conf b/LayoutTests/http/conf/flatpak-httpd.conf >new file mode 100644 >index 00000000000..c04c4ef3195 >--- /dev/null >+++ b/LayoutTests/http/conf/flatpak-httpd.conf >@@ -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> >+ >diff --git a/Tools/ChangeLog b/Tools/ChangeLog >index 2f6a513bb01..27966e2c186 100644 >--- a/Tools/ChangeLog >+++ b/Tools/ChangeLog >@@ -1,3 +1,119 @@ >+2018-06-20 Thibault Saunier <tsaunier@igalia.com> >+ >+ [GTK][WPE]: Add a way to setup our development environment inside flatpak >+ https://bugs.webkit.org/show_bug.cgi?id=186771 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ 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-12 Darin Adler <darin@apple.com> > > [Cocoa] Make some RetainPtr refinements to get more ready for ARC >diff --git a/Tools/Scripts/build-webkit b/Tools/Scripts/build-webkit >index d6b63b4b7a0..70bbe1eafc7 100755 >--- a/Tools/Scripts/build-webkit >+++ b/Tools/Scripts/build-webkit >@@ -170,6 +170,13 @@ if ($useCCache == 1) { > checkRequiredSystemConfig(); > setConfiguration(); > >+if (shouldUseFlatpak()) { >+ print "Building flatpak based environment\n"; >+ >+ runInFlatpak("/app/webkit/Tools/Scripts/build-webkit"); >+} >+ >+ > my $productDir = productDir(); > > # Check that all the project directories are there. >diff --git a/Tools/Scripts/generate-jsc-bundle b/Tools/Scripts/generate-jsc-bundle >index a10b11c6001..9c0e8428ab3 100755 >--- a/Tools/Scripts/generate-jsc-bundle >+++ b/Tools/Scripts/generate-jsc-bundle >@@ -35,8 +35,10 @@ import tempfile > 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 @@ def main(): > 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') > >diff --git a/Tools/Scripts/run-gtk-tests b/Tools/Scripts/run-gtk-tests >index 832d7757805..a9bcc187f05 100755 >--- a/Tools/Scripts/run-gtk-tests >+++ b/Tools/Scripts/run-gtk-tests >@@ -25,10 +25,12 @@ import optparse > 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 @@ class GtkTestRunner(TestRunner): > 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.'), >diff --git a/Tools/Scripts/run-minibrowser b/Tools/Scripts/run-minibrowser >index 495440531ae..5077bc07745 100755 >--- a/Tools/Scripts/run-minibrowser >+++ b/Tools/Scripts/run-minibrowser >@@ -45,6 +45,8 @@ prohibitUnknownPort(); > setConfiguration(); > > if (isGtk() || isWPE()) { >+ runInFlatpakIfAvalaible("/app/webkit/Tools/Scripts/run-minibrowser"); >+ > # Check to see that all the frameworks are built. > checkFrameworks(); > >diff --git a/Tools/Scripts/run-webdriver-tests b/Tools/Scripts/run-webdriver-tests >index 10f7fede66f..acc35f72483 100755 >--- a/Tools/Scripts/run-webdriver-tests >+++ b/Tools/Scripts/run-webdriver-tests >@@ -66,14 +66,20 @@ except NotImplementedError, e: > > 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) >diff --git a/Tools/Scripts/run-webkit-tests b/Tools/Scripts/run-webkit-tests >index 6b1a98b68c8..fd87e870df6 100755 >--- a/Tools/Scripts/run-webkit-tests >+++ b/Tools/Scripts/run-webkit-tests >@@ -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 >diff --git a/Tools/Scripts/run-wpe-tests b/Tools/Scripts/run-wpe-tests >index 18bd1d401f2..bf69994e721 100755 >--- a/Tools/Scripts/run-wpe-tests >+++ b/Tools/Scripts/run-wpe-tests >@@ -24,8 +24,10 @@ import optparse > > 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 @@ class WPETestRunner(TestRunner): > > > 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); >diff --git a/Tools/Scripts/update-webkitgtk-flatpak b/Tools/Scripts/update-webkitgtk-flatpak >new file mode 100755 >index 00000000000..0956f1f2e14 >--- /dev/null >+++ b/Tools/Scripts/update-webkitgtk-flatpak >@@ -0,0 +1,28 @@ >+#!/usr/bin/env python >+# Copyright (C) 2018 Igalia S.L. >+# Copyright (c) 2018, Thibault Saunier <tsaunier@igalia.com> >+# >+# 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() >diff --git a/Tools/Scripts/update-webkitwpe-flatpak b/Tools/Scripts/update-webkitwpe-flatpak >new file mode 100755 >index 00000000000..564e8765211 >--- /dev/null >+++ b/Tools/Scripts/update-webkitwpe-flatpak >@@ -0,0 +1,28 @@ >+#!/usr/bin/env python >+# Copyright (C) 2018 Igalia S.L. >+# Copyright (c) 2018, Thibault Saunier <tsaunier@igalia.com> >+# >+# 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() >diff --git a/Tools/Scripts/webkit-flatpak b/Tools/Scripts/webkit-flatpak >new file mode 100755 >index 00000000000..7bfed938ebe >--- /dev/null >+++ b/Tools/Scripts/webkit-flatpak >@@ -0,0 +1,28 @@ >+#!/usr/bin/env python >+# Copyright (C) 2018 Igalia S.L. >+# Copyright (c) 2018, Thibault Saunier <tsaunier@igalia.com> >+# >+# 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().run() >\ No newline at end of file >diff --git a/Tools/Scripts/webkitdirs.pm b/Tools/Scripts/webkitdirs.pm >index 909218a2044..e5c5914457e 100755 >--- a/Tools/Scripts/webkitdirs.pm >+++ b/Tools/Scripts/webkitdirs.pm >@@ -1681,6 +1681,9 @@ sub launcherPath() > { > 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 @@ sub getJhbuildPath() > } 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 @@ sub isCachedArgumentfileOutOfDate($@) > 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 @@ sub shouldUseJhbuild() > 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"); >diff --git a/Tools/Scripts/webkitpy/port/base.py b/Tools/Scripts/webkitpy/port/base.py >index 87caa97879a..1d2b5c6e1d1 100644 >--- a/Tools/Scripts/webkitpy/port/base.py >+++ b/Tools/Scripts/webkitpy/port/base.py >@@ -1225,7 +1225,7 @@ class Port(object): > 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 @@ class Port(object): > 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 @@ class Port(object): > 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 @@ class Port(object): > # --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() >diff --git a/Tools/Scripts/webkitpy/port/gtk.py b/Tools/Scripts/webkitpy/port/gtk.py >index 42808b35e2b..2638c1b683a 100644 >--- a/Tools/Scripts/webkitpy/port/gtk.py >+++ b/Tools/Scripts/webkitpy/port/gtk.py >@@ -122,15 +122,20 @@ class GtkPort(Port): > 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') > 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. >diff --git a/Tools/Scripts/webkitpy/port/linux_get_crash_log.py b/Tools/Scripts/webkitpy/port/linux_get_crash_log.py >index ca3a7989427..2e4594e0321 100644 >--- a/Tools/Scripts/webkitpy/port/linux_get_crash_log.py >+++ b/Tools/Scripts/webkitpy/port/linux_get_crash_log.py >@@ -58,7 +58,7 @@ class GDBCrashLogGenerator(object): > 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 @@ class GDBCrashLogGenerator(object): > 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 @@ class GDBCrashLogGenerator(object): > 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 @@ class GDBCrashLogGenerator(object): > 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) >diff --git a/Tools/Scripts/webkitpy/port/wpe.py b/Tools/Scripts/webkitpy/port/wpe.py >index cf78cbc0cb3..4c4e23d7542 100644 >--- a/Tools/Scripts/webkitpy/port/wpe.py >+++ b/Tools/Scripts/webkitpy/port/wpe.py >@@ -76,6 +76,12 @@ class WPEPort(Port): > 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): >diff --git a/Tools/Scripts/webkitpy/w3c/wpt_runner.py b/Tools/Scripts/webkitpy/w3c/wpt_runner.py >index 22a528a4aaa..0135febeb92 100644 >--- a/Tools/Scripts/webkitpy/w3c/wpt_runner.py >+++ b/Tools/Scripts/webkitpy/w3c/wpt_runner.py >@@ -53,11 +53,16 @@ def main(script_name, argv): > # 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. >diff --git a/Tools/flatpak/files/default.xkm b/Tools/flatpak/files/default.xkm >new file mode 100644 >index 0000000000000000000000000000000000000000..016f6b08f6d808580968ba02256d9075d48a47d0 >GIT binary patch >literal 12032 >zcmcgyYj7Lab-ue;5FkiVl3%fFcS^rx*$NY2L4siGrUC(wpzt&Rl9H2%rASz$MUgZ} >zN>-f4N~V(^owUg`Nz-@ytDU~>RC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>N^rhzoGqGF!23f3*`T2CLJf({Pd?C >zzdaY67w`=6^qHUD4dj1Tm(SB`e)=`Ek>6iuQU6M@fco>J9Uu2M?N^W|bh!6)F4{4! >zX7)B$%s_foT~{w3x(*8rRa^=DaU$VaLUf6ZvvjFf;0|=biD|)c!3m5<>NCP81+#)v >zCOwrjJe3mE`SGkAhM2{3derl*8<A%sx7U`{Is3ZG480t|^B48v8^I0FKhX~78FhX@ >zogYxg2h{NaC&W(22d?7->iB?DCf&rxbCJSzetZJ(oewRUz%Lsp7iT3C_>O{eQN|AE >zs<b`MRSBAMajr_ZDHrFegqw14uF7yJ7w0O4>-_j+V6@vG#h5>YayhaSDr)2Wl(ED4 >zD{YVSSAwQooWBxo%EkFB;ig=izcO6P#kov!KB>e41{BNVlaj!R0-k@=_BgL8Xv)QT >zE#anIoYxX=%Efst;ig=i=QP}u%O@?NVzwROctm+PJBd4+=h+f!(B^qhBF}tcOj<nV >zL(X$<M4o}uT>A~$F;!e$-__GQ#!Pa!U~|k2I>;LRmB4d=Zzniwi5P62$t3bjCXs#1 >zbe_W`=lM*NUO-vOF2I5h2hVYmGiKWJJf}{_SxzF)b`o(GtaD|1dG(zA;)oq#9Esl8 >zWk5WaN;{qvHCRPm$Xgm25AAqv6?%(jR}D@H<_ZZltj7l9;CWV)J|URV$i6iBq(slB >zpZTQ)i->zz*M|!}XP<-`LV7`u1)KrvtTvW6J6KC?^{V=9JOB|64qU-~frGjCYa=80 >zrO{l$y@X?Tt=A6wY2kf?6X{xS9P!hKy|dPp<#Q}I;@nVQK)GL3t2%RCZo>Sw`F7XR >zLwc{nJWL^x=nZxKFzRHPGEDrYkhfdL;lNpMsfvmW+)$s#<oYow$7>6zj(WRgac;o8 >Mkksd~bIIiY083K02><{9 > >literal 0 >HcmV?d00001 > >diff --git a/Tools/flatpak/files/httpd-autogen.sh b/Tools/flatpak/files/httpd-autogen.sh >new file mode 100755 >index 00000000000..6a0a473a825 >--- /dev/null >+++ b/Tools/flatpak/files/httpd-autogen.sh >@@ -0,0 +1 @@ >+autoreconf >\ No newline at end of file >diff --git a/Tools/flatpak/flatpakutils.py b/Tools/flatpak/flatpakutils.py >new file mode 100644 >index 00000000000..9cd65cf51c6 >--- /dev/null >+++ b/Tools/flatpak/flatpakutils.py >@@ -0,0 +1,776 @@ >+# 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 >+ >+import yaml >+ >+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 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: >+ 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"]: >+ submanifest_path = None >+ 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')): >+ if(submanifest_path is not None): >+ source["path"] = os.path.join(os.path.dirname(submanifest_path), source["path"]) >+ else: >+ 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 = None >+ for elem in components[1:]: >+ if not elem: >+ continue >+ parsed_url = urlparse(elem) >+ if parsed_url.scheme: >+ url = elem >+ 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 = repo.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=None, >+ repo_file=None, user=True, repos=None): >+ FlatpakObject.__init__(self, user=user) >+ >+ self.name = name >+ self.url = 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["Flatpak 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): >+ FlatpakObject.__init__(self, user=user) >+ >+ self.name = name >+ self.branch = str(branch) >+ self.repo = repo >+ self.arch = arch >+ self.hash = hash >+ >+ 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 >+ >+ self.flatpak("install", self.repo.name, self.name, "--reinstall", >+ self.branch, 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 >+ >+ 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="store_true") >+ general.add_argument("--release", help="Compile with Release configuration.", action="store_true") >+ general.add_argument('--platform', action='store', help='Platform to use (e.g., "mac-lion")'), >+ general.add_argument('--gtk', action='store_const', dest='platform', const='gtk', >+ help='Alias for --platform=gtk') >+ general.add_argument('--wpe', action='store_const', dest='platform', const='wpe', >+ help=('Alias for --platform=wpe')) >+ general.add_argument("-nf", "--no-flatpak-update", dest="no_flatpak_update", >+ action="store_true", >+ help="Do not update flaptak runtime/sdk") >+ general.add_argument("-u", "--update", dest="update", >+ action="store_true", >+ help="Update the runtime/sdk/app and rebuild the development environment if needed") >+ general.add_argument("-b", "--build-webkit", dest="build_webkit", >+ nargs=argparse.REMAINDER, >+ help="Force rebuilding the app.") >+ general.add_argument("-ba", "--build-all", dest="build_all", >+ action="store_true", >+ help="Force rebuilding the app and its dependencies.") >+ general.add_argument("-q", "--quiet", dest="quiet", >+ action="store_true", >+ 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("args", >+ nargs=argparse.REMAINDER, >+ help="Arguments passed when starting %s" % self.name) >+ general.add_argument('--avalaible', action='store_true', 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="store_true", >+ help="Clean previous builds and restart from scratch") >+ >+ parser.parse_args(args=args, namespace=self) >+ self.clean_args() >+ >+ 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 = None >+ 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 >+ >+ # 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 check_flatpak(self): >+ for app, required_version in FLATPAK_REQ: >+ try: >+ output = subprocess.check_output([app, "--version"]) >+ except subprocess.CalledProcessError: >+ 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) >+ exit(1) >+ >+ 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) >+ exit(1) >+ >+ 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 >+ self.check_flatpak() >+ >+ repos = FlatpakRepos() >+ self.sdk_repo = repos.add( >+ FlatpakRepo("flathub", >+ url="https://dl.flathub.org/repo/", >+ repo_file="https://dl.flathub.org/repo/flathub.flatpakrepo")) >+ >+ manifest = load_manifest(self.manifest_path) >+ if not manifest: >+ exit(1) >+ >+ 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")) >+ self.locale = FlatpakPackage("org.gnome.Platform.Locale", >+ self.sdk_branch, self.sdk_repo, "x86_64") >+ self.sdk = FlatpakPackage("org.gnome.Sdk", self.sdk_branch, >+ self.sdk_repo, "x86_64", >+ hash=manifest.get("sdk-hash")) >+ 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") >+ self.packs.append(self.sdk_debug) >+ self.manifest_generated_path = os.path.join(self.cache_path, >+ self.build_name + ".json") >+ >+ def _cleanup_faltpak_args_for_tests_if_needed(self, args): >+ if 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) >+ >+ 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") >+ exit(e.returncode) >+ >+ def run(self): >+ if self.check_avalaible: >+ return >+ 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() >+ >+ 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): >+ exit(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()] >+ Console.message("Building webkit") >+ self.run_in_sandbox(*builder) >+ 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 >+ self.run_in_sandbox(*test_launcher) >+ elif self.gdb is not None: >+ self.run_gdb() >+ elif self.user_command: >+ self.run_in_sandbox(*self.user_command) >+ elif not self.update: >+ self.run_in_sandbox() >+ >+ 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) >+ sys.exit(1) >+ >+ # 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) >+ >+ 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 >+ >+ flatpak_runner = WebkitFlatpak.load_from_args(args) >+ if not flatpak_runner.has_environment(): >+ return None >+ >+ sys.exit(flatpak_runner.run_in_sandbox(*args)) >diff --git a/Tools/flatpak/org.webkit.GTK.yaml b/Tools/flatpak/org.webkit.GTK.yaml >new file mode 100644 >index 00000000000..f46ac0ff686 >--- /dev/null >+++ b/Tools/flatpak/org.webkit.GTK.yaml >@@ -0,0 +1,125 @@ >+- 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 >+ sources: >+ - type: git >+ url: https://github.com/WebKit/WebKit.git >+ branch: mediastream-minus-enumerateDevices >+ buildsystem: simple >+ build-commands: >+ - /app/webkit/Tools/Scripts/build-webkit --gtk --prefix=/app >+ >diff --git a/Tools/flatpak/org.webkit.WPE.yaml b/Tools/flatpak/org.webkit.WPE.yaml >new file mode 100644 >index 00000000000..1a795874fe8 >--- /dev/null >+++ b/Tools/flatpak/org.webkit.WPE.yaml >@@ -0,0 +1,47 @@ >+- 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 >+ sources: >+ - type: git >+ url: https://github.com/WebKit/WebKit.git >+ branch: mediastream-minus-enumerateDevices >+ buildsystem: simple >+ build-commands: >+ - /app/webkit/Tools/Scripts/build-webkit --wpe --prefix=/app >\ No newline at end of file >diff --git a/Tools/flatpak/org.webkit.WebKit.yaml b/Tools/flatpak/org.webkit.WebKit.yaml >new file mode 100644 >index 00000000000..9ba0d609a08 >--- /dev/null >+++ b/Tools/flatpak/org.webkit.WebKit.yaml >@@ -0,0 +1,181 @@ >+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 >+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 >+ >+ # Port specific components. >+ - %(PORTNAME)s.yaml >\ No newline at end of file >diff --git a/Tools/flatpak/patches/httpd-0001-configure-use-pkg-config-for-PCRE-detection.patch b/Tools/flatpak/patches/httpd-0001-configure-use-pkg-config-for-PCRE-detection.patch >new file mode 100644 >index 00000000000..d36a694f292 >--- /dev/null >+++ b/Tools/flatpak/patches/httpd-0001-configure-use-pkg-config-for-PCRE-detection.patch >@@ -0,0 +1,50 @@ >+From b5ebe404f1388ddda3603e53277f87e0b96ba695 Mon Sep 17 00:00:00 2001 >+From: Thibault Saunier <tsaunier@igalia.com> >+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 >+ >diff --git a/Tools/flatpak/patches/xvfb-0001-HACK-Avoid-compiling-a-kbm-file.patch b/Tools/flatpak/patches/xvfb-0001-HACK-Avoid-compiling-a-kbm-file.patch >new file mode 100644 >index 00000000000..898842b381d >--- /dev/null >+++ b/Tools/flatpak/patches/xvfb-0001-HACK-Avoid-compiling-a-kbm-file.patch >@@ -0,0 +1,50 @@ >+From aed1b6e8de41375c1b8b1dfc48a350e0a9b9cbba Mon Sep 17 00:00:00 2001 >+From: Thibault Saunier <tsaunier@igalia.com> >+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 >+ >-- >2.17.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 186771
:
342945
|
342946
|
342957
|
343178
|
343181
|
343191
|
343195
|
343238
|
343279
|
343333
|
343401
|
343610
|
343611
|
343710
|
343861
|
343885
|
343911