⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 272643 in webkit


Ignore:
Timestamp:
Feb 10, 2021, 2:18:43 AM (6 years ago)
Author:
Philippe Normand
Message:

[WPE] Optionally build Cog as external project and replacement for MiniBrowser
​https://bugs.webkit.org/show_bug.cgi?id=221518

Reviewed by Adrian Perez de Castro.

.:

  • Source/cmake/OptionsWPE.cmake: New variable for JSC forwarded headers path, useful

uninstalled builds of projects depending on JSC.

Source/WebKit:

  • PlatformWPE.cmake: Produce uninstalled pkg-config files for wpe-webkit and web-extension

libraries. Also populate the JSC ForwardedHeaders path during the build.

  • wpe/wpe-web-extension-uninstalled.pc.in: Added.
  • wpe/wpe-webkit-uninstalled.pc.in: Added.

Tools:

By passing -DENABLE_COG=ON during the WPE build, the Cog browser is now built as an
external project. The repository is cloned in Tools/wpe/cog and the code can be edited
there.

The run-minibrowser --wpe script will now first try to execute cog and fallback to
MiniBrowser if it wasn't found. Cog is also a MiniBrowser, but with some additional
features, see ​https://github.com/Igalia/cog for more informations.

  • PlatformWPE.cmake: Configure Cog as an external project in developer builds.
  • Scripts/webkitpy/port/wpe.py:

(WPEPort.run_minibrowser): First check for cog, fallback to MiniBrowser if not found.

  • flatpak/flatpakutils.py:

(WebkitFlatpak.run_in_sandbox): Set pkg-config path to lookup libraries in the WebKit's
build directory as well.

Location:
trunk
Files:
2 added
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/ChangeLog

    r272614 r272643  
     12021-02-10  Philippe Normand  <pnormand@igalia.com>
     2
     3        [WPE] Optionally build Cog as external project and replacement for MiniBrowser
     4        https://bugs.webkit.org/show_bug.cgi?id=221518
     5
     6        Reviewed by Adrian Perez de Castro.
     7
     8        * Source/cmake/OptionsWPE.cmake: New variable for JSC forwarded headers path, useful
     9        uninstalled builds of projects depending on JSC.
     10
    1112021-02-09  Jonathan Bedard  <jbedard@apple.com>
    212
  • trunk/Source/WebKit/ChangeLog

    r272641 r272643  
     12021-02-10  Philippe Normand  <pnormand@igalia.com>
     2
     3        [WPE] Optionally build Cog as external project and replacement for MiniBrowser
     4        https://bugs.webkit.org/show_bug.cgi?id=221518
     5
     6        Reviewed by Adrian Perez de Castro.
     7
     8        * PlatformWPE.cmake: Produce uninstalled pkg-config files for wpe-webkit and web-extension
     9        libraries. Also populate the JSC ForwardedHeaders path during the build.
     10        * wpe/wpe-web-extension-uninstalled.pc.in: Added.
     11        * wpe/wpe-webkit-uninstalled.pc.in: Added.
     12
    1132021-02-10  Carlos Garcia Campos  <cgarcia@igalia.com>
    214
  • trunk/Source/WebKit/PlatformWPE.cmake

    r272574 r272643  
    1111file(MAKE_DIRECTORY ${FORWARDING_HEADERS_WPE_EXTENSION_DIR})
    1212file(MAKE_DIRECTORY ${FORWARDING_HEADERS_WPE_DOM_DIR})
     13file(MAKE_DIRECTORY ${FORWARDING_HEADERS_WPE_JSC_DIR})
    1314
    1415configure_file(UIProcess/API/wpe/WebKitVersion.h.in ${DERIVED_SOURCES_WPE_API_DIR}/WebKitVersion.h)
    1516configure_file(wpe/wpe-webkit.pc.in ${WPE_PKGCONFIG_FILE} @ONLY)
    1617configure_file(wpe/wpe-web-extension.pc.in ${WPEWebExtension_PKGCONFIG_FILE} @ONLY)
     18configure_file(wpe/wpe-webkit-uninstalled.pc.in ${CMAKE_BINARY_DIR}/wpe-webkit-${WPE_API_VERSION}-uninstalled.pc @ONLY)
     19configure_file(wpe/wpe-web-extension-uninstalled.pc.in ${CMAKE_BINARY_DIR}/wpe-web-extension-${WPE_API_VERSION}-uninstalled.pc @ONLY)
    1720
    1821add_definitions(-DWEBKIT2_COMPILATION)
    … …  
    5457)
    5558
     59add_custom_command(
     60    OUTPUT ${FORWARDING_HEADERS_WPE_JSC_DIR}/jsc
     61    DEPENDS ${JAVASCRIPTCORE_DIR}/API/glib/
     62    COMMAND ln -n -s -f ${JAVASCRIPTCORE_DIR}/API/glib ${FORWARDING_HEADERS_WPE_JSC_DIR}/jsc
     63    VERBATIM
     64)
     65
    5666add_custom_target(webkitwpe-fake-api-headers
    5767    DEPENDS ${FORWARDING_HEADERS_WPE_DIR}/wpe
    5868            ${FORWARDING_HEADERS_WPE_EXTENSION_DIR}/wpe
    5969            ${FORWARDING_HEADERS_WPE_DOM_DIR}/wpe
     70            ${FORWARDING_HEADERS_WPE_JSC_DIR}/jsc
    6071)
    6172
  • trunk/Source/cmake/OptionsWPE.cmake

    r272401 r272643  
    247247set(FORWARDING_HEADERS_WPE_EXTENSION_DIR ${FORWARDING_HEADERS_DIR}/wpe-webextension)
    248248set(FORWARDING_HEADERS_WPE_DOM_DIR ${FORWARDING_HEADERS_DIR}/wpe-dom)
     249set(FORWARDING_HEADERS_WPE_JSC_DIR ${FORWARDING_HEADERS_DIR}/wpe-jsc)
    249250set(DERIVED_SOURCES_JAVASCRIPCOREWPE_DIR ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/javascriptcorewpe)
    250251set(DERIVED_SOURCES_JAVASCRIPCORE_GLIB_API_DIR ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/javascriptcorewpe/jsc)
  • trunk/Tools/ChangeLog

    r272630 r272643  
     12021-02-06  Philippe Normand  <pnormand@igalia.com>
     2
     3        [WPE] Optionally build Cog as external project and replacement for MiniBrowser
     4        https://bugs.webkit.org/show_bug.cgi?id=221518
     5
     6        Reviewed by Adrian Perez de Castro.
     7
     8        By passing `-DENABLE_COG=ON` during the WPE build, the Cog browser is now built as an
     9        external project. The repository is cloned in Tools/wpe/cog and the code can be edited
     10        there.
     11
     12        The run-minibrowser --wpe script will now first try to execute cog and fallback to
     13        MiniBrowser if it wasn't found. Cog is also a MiniBrowser, but with some additional
     14        features, see https://github.com/Igalia/cog for more informations.
     15
     16        * PlatformWPE.cmake: Configure Cog as an external project in developer builds.
     17        * Scripts/webkitpy/port/wpe.py:
     18        (WPEPort.run_minibrowser): First check for cog, fallback to MiniBrowser if not found.
     19        * flatpak/flatpakutils.py:
     20        (WebkitFlatpak.run_in_sandbox): Set pkg-config path to lookup libraries in the WebKit's
     21        build directory as well.
     22
    1232021-02-09  Devin Rousso  <drousso@apple.com>
    224
  • trunk/Tools/PlatformWPE.cmake

    r267177 r272643  
    1616    add_subdirectory(MiniBrowser/wpe)
    1717endif ()
     18
     19if (DEVELOPER_MODE AND ENABLE_COG)
     20    include(ExternalProject)
     21    ExternalProject_Add(cog
     22        GIT_REPOSITORY "https://github.com/Igalia/cog.git"
     23        SOURCE_DIR "${CMAKE_SOURCE_DIR}/Tools/wpe/cog"
     24        INSTALL_COMMAND "")
     25    ExternalProject_Add_StepDependencies(cog build WebKit)
     26endif ()
  • trunk/Tools/Scripts/webkitpy/port/wpe.py

    r267351 r272643  
    1 # Copyright (C) 2014-2017 Igalia S.L.  All rights reserved.
     1# -*- coding: utf-8 -*-
     2# Copyright (C) 2014-2021 Igalia S.L.  All rights reserved.
    23#
    34# Redistribution and use in source and binary forms, with or without
    … …  
    144145
    145146    def run_minibrowser(self, args):
    146         miniBrowser = self._build_path('bin', 'MiniBrowser')
    147         if not self._filesystem.isfile(miniBrowser):
    148             print("%s not found... Did you run build-webkit?" % miniBrowser)
    149             return 1
     147        env = None
     148        cog = self._build_path('Tools', 'cog-prefix', 'src', 'cog-build', 'cog')
     149        if self._filesystem.isfile(cog):
     150            miniBrowser = cog
     151            env = os.environ.copy()
     152            env.update({'WEBKIT_EXEC_PATH': self._build_path('bin'),
     153                        'WEBKIT_INJECTED_BUNDLE_PATH': self._build_path('lib')})
     154            args = ['-P', 'fdo'] + args
     155        else:
     156            print("Cog not found 😢. If you wish to enable it, rebuild with `-DENABLE_COG=ON`. Falling back to good old MiniBrowser")
     157            miniBrowser = self._build_path('bin', 'MiniBrowser')
     158            if not self._filesystem.isfile(miniBrowser):
     159                print("%s not found... Did you run build-webkit?" % miniBrowser)
     160                return 1
    150161        command = [miniBrowser]
    151162        if os.environ.get("WEBKIT_MINI_BROWSER_PREFIX"):
    … …  
    154165        if self._should_use_jhbuild():
    155166            command = self._jhbuild_wrapper + command
    156         return self._executive.run_command(command + args, cwd=self.webkit_base(), stdout=None, return_stderr=False, decode_output=False)
     167        return self._executive.run_command(command + args, cwd=self.webkit_base(), stdout=None, return_stderr=False, decode_output=False, env=env)
  • trunk/Tools/flatpak/flatpakutils.py

    r272577 r272643  
    727727                "--share=network",
    728728                "--socket=pulseaudio",
     729                "--socket=session-bus",
    729730                "--socket=system-bus",
    730731                "--socket=wayland",
    … …  
    875876        })
    876877
     878        pkg_config_path = flatpak_env.get("PKG_CONFIG_PATH")
     879        if pkg_config_path:
     880            pkg_config_path = "%s:%s" % (self.build_path, pkg_config_path)
     881        else:
     882            pkg_config_path = self.build_path
     883        flatpak_env["PKG_CONFIG_PATH"] = pkg_config_path
     884
    877885        env_file = os.path.join(self.build_root, 'flatpak-env.json')
    878886        if not os.path.exists(env_file):
Note: See TracChangeset for help on using the changeset viewer.