chromium: make the build type configurable.
cover chromium: make the build type configurable.
This serie of patches adds 2 new variables that allow a more fine control of the Chromium build without needing to modify the recipe. (This can be configured in conf/local.conf)
CHROMIUM_BUILD_TYPE = ['Release', 'Debug']
CHROMIUM_ENABLE_WAYLAND = ['0', '1']
Carlos Alberto Lopez Perez (3):
chromium: Allow to build in Debug mode.
chromium: Clean the definitions of some ozone-wayland variables.
chromium: Rework the evaluation of the Wayland feature.
recipes-browser/chromium/chromium.inc | 4 +- .../fix-build-error-with-GCC-in-Debug-mode.patch | 32 +++++++++++ recipes-browser/chromium/chromium_40.0.2214.91.bb | 63 +++++++++++++--------- 3 files changed, 74 insertions(+), 25 deletions(-) create mode 100644 recipes-browser/chromium/chromium/chromium-40/fix-build-error-with-GCC-in-Debug-mode.patch
Signature · 1 line
2.1.4
PATCH 1/3 chromium: Allow to build in Debug mode.
* Add also a patch that workarounds a build error when building in Debug mode and using GCC. This patch has no effect when building in Release mode because is guarded within ifdef(debug) blocks.
--- recipes-browser/chromium/chromium.inc | 4 ++- .../fix-build-error-with-GCC-in-Debug-mode.patch | 32 ++++++++++++++++++++++ recipes-browser/chromium/chromium_40.0.2214.91.bb | 1 + 3 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 recipes-browser/chromium/chromium/chromium-40/fix-build-error-with-GCC-in-Debug-mode.patch
recipes-browser/chromium/chromium.inc +3 -1
@@ -7,7 +7,9 @@ COMPATIBLE_MACHINE_x86-64 = "(.*)" COMPATIBLE_MACHINE_armv6 = "(.*)" COMPATIBLE_MACHINE_armv7a = "(.*)" -CHROMIUM_BUILD_TYPE = "Release" +# The build type defaults to Release. If you want a Debug build, you can set +# the variable CHROMIUM_BUILD_TYPE to "Debug" in your conf/local.conf file. +CHROMIUM_BUILD_TYPE ??= "Release" inherit gettext pythonnative
recipes-browser/chromium/chromium/chromium-40/fix-build-error-with-GCC-in-Debug-mode.patch new file +32 -0
@@ -0,0 +1,32 @@ +From bfe80ed5227fccf8ab13df714702fc77e5e3d657 Mon Sep 17 00:00:00 2001 +From: Carlos Alberto Lopez Perez <[email protected]> +Date: Thu, 27 Aug 2015 09:54:06 +0200 +Subject: [PATCH] Fix build error with GCC in Debug mode: + + http://code.google.com/p/chromium/issues/detail?id=525428 +--- + components/invalidation/invalidator_storage.cc | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/components/invalidation/invalidator_storage.cc b/components/invalidation/invalidator_storage.cc +index 13ba4b1..3d567c1 100644 +--- a/components/invalidation/invalidator_storage.cc ++++ b/components/invalidation/invalidator_storage.cc +@@ -2,7 +2,14 @@ + // Use of this source code is governed by a BSD-style license that can be + // found in the LICENSE file. + ++#if !defined(NDEBUG) ++#pragma GCC diagnostic push ++#pragma GCC diagnostic ignored "-Wmaybe-uninitialized" ++#endif // !defined(NDEBUG) + #include "components/invalidation/invalidator_storage.h" ++#if !defined(NDEBUG) ++#pragma GCC diagnostic pop ++#endif // !defined(NDEBUG) + + #include <string> + #include <utility> +-- +2.1.4 +
recipes-browser/chromium/chromium_40.0.2214.91.bb +1 -0
@@ -26,6 +26,7 @@ SRC_URI = "\ ${@bb.utils.contains('PACKAGECONFIG', 'component-build', 'file://component-build.gypi', '', d)} \ file://google-chrome \ file://google-chrome.desktop \ + file://chromium-40/fix-build-error-with-GCC-in-Debug-mode.patch \ " # # * use-egl : Without this packageconfig, the Chromium build will use GLX for creating an OpenGL context in X11,
Signature · 1 line
2.1.4
Re: [meta-browser][PATCH 1/3] chromium: Allow to build in Debug mode.
Quoted 5 lines · Carlos Alberto Lopez Perez
* Add also a patch that workarounds a build error when building in Debug mode and using GCC. This patch has no effect when building in Release mode because is guarded within ifdef(debug) blocks.
Quoted 7 lines
Signed-off-by Carlos Alberto Lopez Perez <[email protected]>--- recipes-browser/chromium/chromium.inc | 4 ++- .../fix-build-error-with-GCC-in-Debug-mode.patch | 32 ++++++++++++++++++++++ recipes-browser/chromium/chromium_40.0.2214.91.bb | 1 + 3 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 recipes-browser/chromium/chromium/chromium-40/fix-build-error-with-GCC-in-Debug-mode.patch
Does the above patch need an upstream-status tag?
Re: [meta-browser][PATCH 1/3] chromium: Allow to build in Debug mode.
Quoted 14 lines · Trevor Woerner
Quoted 5 lines · Carlos Alberto Lopez Perez
* Add also a patch that workarounds a build error when building in Debug mode and using GCC. This patch has no effect when building in Release mode because is guarded within ifdef(debug) blocks.
Quoted 7 lines
Signed-off-by Carlos Alberto Lopez Perez <[email protected]>--- recipes-browser/chromium/chromium.inc | 4 ++- .../fix-build-error-with-GCC-in-Debug-mode.patch | 32 ++++++++++++++++++++++ recipes-browser/chromium/chromium_40.0.2214.91.bb | 1 + 3 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 recipes-browser/chromium/chromium/chromium-40/fix-build-error-with-GCC-in-Debug-mode.patch
Quoted 1 line
Does the above patch need an upstream-status tag?
Its not must for meta-broweser, but its good since it adds information. We do not have any automatic tracking of patch status so if one mentions url for source of patch or any information on where patch's status can be asserted at later times is good.
Re: [meta-browser][PATCH 1/3] chromium: Allow to build in Debug mode.
Quoted 15 lines · Khem Raj
Quoted 14 lines · Trevor Woerner
Quoted 12 lines · Carlos Alberto Lopez Perez
* Add also a patch that workarounds a build error when building in Debug mode and using GCC. This patch has no effect when building in Release mode because is guarded within ifdef(debug) blocks.
Signed-off-by Carlos Alberto Lopez Perez <[email protected]>--- recipes-browser/chromium/chromium.inc | 4 ++- .../fix-build-error-with-GCC-in-Debug-mode.patch | 32 ++++++++++++++++++++++ recipes-browser/chromium/chromium_40.0.2214.91.bb | 1 + 3 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 recipes-browser/chromium/chromium/chromium-40/fix-build-error-with-GCC-in-Debug-mode.patch
Quoted 7 lines
Quoted 1 line
Does the above patch need an upstream-status tag?
Its not must for meta-broweser, but its good since it adds information. We do not have any automatic tracking of patch status so if one mentions url for source of patch or any information on where patch's status can be asserted at later times is good.
The patch itself includes in the comments at top the URL to the chromium bugtracker where the issue was reported and the patch forwarded.
PATCH 2/3 chromium: Clean the definitions of some ozone-wayland variables.
In reply to Carlos Alberto Lopez Perez--- recipes-browser/chromium/chromium_40.0.2214.91.bb | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-)
recipes-browser/chromium/chromium_40.0.2214.91.bb +6 -11
@@ -64,15 +64,9 @@ ENABLE_WAYLAND = "${@base_contains('DISTRO_FEATURES', 'x11', '0', \ base_contains('DISTRO_FEATURES', 'wayland', '1', \ '0', d),d)}" -# variable for extra ozone-wayland patches, typically extended by BSP layer .bbappends -# IMPORTANT: do not simply add extra ozone-wayland patches to the SRC_URI in a -# .bbappend, since the base ozone-wayland patches need to be applied first (see below) - -OZONE_WAYLAND_EXTRA_PATCHES = " " - OZONE_WAYLAND_GIT_DESTSUFFIX = "ozone-wayland-git" -OZONE_WAYLAND_GIT_BRANCH = "" -OZONE_WAYLAND_GIT_SRCREV = "" +OZONE_WAYLAND_GIT_BRANCH = "Milestone-ThanksGiving" +OZONE_WAYLAND_GIT_SRCREV = "5d7baa9bc3b8c88e9b7e476e3d6bc8cd44a887fe" SRC_URI += "${@base_conditional('ENABLE_WAYLAND', '1', 'git://github.com/01org/ozone-wayland.git;destsuffix=${OZONE_WAYLAND_GIT_DESTSUFFIX};branch=${OZONE_WAYLAND_GIT_BRANCH};rev=${OZONE_WAYLAND_GIT_SRCREV}', '', d)}" OZONE_WAYLAND_PATCH_FILE_GLOB = "*.patch"
@@ -90,12 +84,13 @@ SRC_URI += "\ SRC_URI[md5sum] = "1f5093bd7e435fdebad070e74bfb3438" SRC_URI[sha256sum] = "f72fda9ff1ea256ab911610ee532eadf8303137d431f2481d01d3d60e5e64149" -OZONE_WAYLAND_EXTRA_PATCHES += " \ +# Variable for extra ozone-wayland patches, typically extended by BSP layer .bbappends +# IMPORTANT: do not simply add extra ozone-wayland patches to the SRC_URI in a +# .bbappend, since the base ozone-wayland patches need to be applied first (see below) +OZONE_WAYLAND_EXTRA_PATCHES = " \ file://chromium-40/0005-Remove-X-libraries-from-GYP-files.patch \ file://chromium-40/0010-systemd-218.patch \ " -OZONE_WAYLAND_GIT_BRANCH = "Milestone-ThanksGiving" -OZONE_WAYLAND_GIT_SRCREV = "5d7baa9bc3b8c88e9b7e476e3d6bc8cd44a887fe" # using 00*.patch to skip the WebRTC patches in ozone-wayland # the WebRTC patches remove X11 libraries from the linker flags, which is # already done by another patch (see above). Furthermore, to be able to use
Signature · 1 line
2.1.4
PATCH 3/3 chromium: Rework the evaluation of the Wayland feature.
In reply to Carlos Alberto Lopez Perez * Remove the ENABLE_X11 variable and rename ENABLE_WAYLAND to CHROMIUM_ENABLE_WAYLAND. Make the old ENABLE_X11 be just "not CHROMIUM_ENABLE_WAYLAND".
* Allow configuring this in the local.conf file.
* Add a couple of sanity checks and two notes that will let the user be sure if the ozone-wayland patches will be applied or not. This will be checked before running the do_fetch step of Chromium. That way we avoid printing any warning or doing any check when parsing the recipe. So we only warn or abort when Chromium is actually going to be built.
--- recipes-browser/chromium/chromium_40.0.2214.91.bb | 45 ++++++++++++++++------- 1 file changed, 32 insertions(+), 13 deletions(-)
recipes-browser/chromium/chromium_40.0.2214.91.bb +32 -13
@@ -56,22 +56,41 @@ SRC_URI = "\ # See http://www.chromium.org/developers/design-documents/impl-side-painting for more. # Off by default. -# conditionally add ozone-wayland and its patches to the Chromium sources - -ENABLE_X11 = "${@base_contains('DISTRO_FEATURES', 'x11', '1', '0', d)}" -# only enable Wayland if X11 isn't already enabled -ENABLE_WAYLAND = "${@base_contains('DISTRO_FEATURES', 'x11', '0', \ +# Conditionally add ozone-wayland and its patches to the Chromium sources +# You can override this by setting CHROMIUM_ENABLE_WAYLAND=1 or CHROMIUM_ENABLE_WAYLAND=0 in local.conf +CHROMIUM_ENABLE_WAYLAND ??= "${@base_contains('DISTRO_FEATURES', 'x11', '0', \ base_contains('DISTRO_FEATURES', 'wayland', '1', \ '0', d),d)}" +# Some sanity checks. +python do_check_variables() { + CHROMIUM_BUILD_TYPE = d.getVar('CHROMIUM_BUILD_TYPE', True) + CHROMIUM_ENABLE_WAYLAND = d.getVar('CHROMIUM_ENABLE_WAYLAND', True) + DISTRO_FEATURES = d.getVar("DISTRO_FEATURES", True).split() + if CHROMIUM_BUILD_TYPE not in ['Release', 'Debug']: + bb.fatal("Wrong value for CHROMIUM_BUILD_TYPE. Please set it either to \'Release\' or to \'Debug\'") + if CHROMIUM_ENABLE_WAYLAND not in ['0', '1']: + bb.fatal("Wrong value for CHROMIUM_ENABLE_WAYLAND. Please set it to \'1\' to enable the feature or to \'0\' to disable it") + if ( (CHROMIUM_ENABLE_WAYLAND == '1') and ('wayland' not in DISTRO_FEATURES) ): + bb.warn("You have selected to build Chromium with Wayland support, but you have not enabled wayland in DISTRO_FEATURES") + if ( (CHROMIUM_ENABLE_WAYLAND != '1') and ('x11' not in DISTRO_FEATURES) ): + bb.warn("You have selected to build Chromium without Wayland support, but you have not enabled x11 in DISTRO_FEATURES") + # Print both on log.do_checkvariables and on the console the configuration that is selected. + # This useful both for throubleshooting and for checking how the build is finally configured. + if (CHROMIUM_ENABLE_WAYLAND == '1'): + bb.plain("INFO: Chromium has been configured with Wayland support (ozone-wayland). Build type is \'%s\'" %CHROMIUM_BUILD_TYPE) + else: + bb.plain("INFO: Chromium has been configured without Wayland support. Build type is \'%s\'" %CHROMIUM_BUILD_TYPE) +} +addtask check_variables before do_fetch OZONE_WAYLAND_GIT_DESTSUFFIX = "ozone-wayland-git" OZONE_WAYLAND_GIT_BRANCH = "Milestone-ThanksGiving" OZONE_WAYLAND_GIT_SRCREV = "5d7baa9bc3b8c88e9b7e476e3d6bc8cd44a887fe" -SRC_URI += "${@base_conditional('ENABLE_WAYLAND', '1', 'git://github.com/01org/ozone-wayland.git;destsuffix=${OZONE_WAYLAND_GIT_DESTSUFFIX};branch=${OZONE_WAYLAND_GIT_BRANCH};rev=${OZONE_WAYLAND_GIT_SRCREV}', '', d)}" +SRC_URI += "${@base_conditional('CHROMIUM_ENABLE_WAYLAND', '1', 'git://github.com/01org/ozone-wayland.git;destsuffix=${OZONE_WAYLAND_GIT_DESTSUFFIX};branch=${OZONE_WAYLAND_GIT_BRANCH};rev=${OZONE_WAYLAND_GIT_SRCREV}', '', d)}" OZONE_WAYLAND_PATCH_FILE_GLOB = "*.patch" -do_unpack[postfuncs] += "${@base_conditional('ENABLE_WAYLAND', '1', 'copy_ozone_wayland_files', '', d)}" -do_patch[prefuncs] += "${@base_conditional('ENABLE_WAYLAND', '1', 'add_ozone_wayland_patches', '', d)}" +do_unpack[postfuncs] += "${@base_conditional('CHROMIUM_ENABLE_WAYLAND', '1', 'copy_ozone_wayland_files', '', d)}" +do_patch[prefuncs] += "${@base_conditional('CHROMIUM_ENABLE_WAYLAND', '1', 'add_ozone_wayland_patches', '', d)}" LIC_FILES_CHKSUM = "file://LICENSE;md5=537e0b52077bf0a616d0a0c8a79bc9d5" SRC_URI += "\
@@ -101,7 +120,7 @@ OZONE_WAYLAND_PATCH_FILE_GLOB = "00*.patch" # Component build is broken in ozone-wayland for Chromium 40, # and is not planned to work again before version 41 python() { - if (d.getVar('ENABLE_X11', True) != '1') and (d.getVar('ENABLE_WAYLAND', True) == '1'): + if (d.getVar('CHROMIUM_ENABLE_WAYLAND', True) == '1'): if bb.utils.contains('PACKAGECONFIG', 'component-build', True, False, d): bb.fatal("Chromium 40 Wayland version cannot be built in component-mode") }
@@ -157,12 +176,12 @@ CHROMIUM_WAYLAND_DEPENDS = "wayland libxkbcommon" CHROMIUM_WAYLAND_GYP_DEFINES = "use_ash=1 use_aura=1 chromeos=0 use_ozone=1" python() { - if d.getVar('ENABLE_X11', True) == '1': - d.appendVar('DEPENDS', ' %s ' % d.getVar('CHROMIUM_X11_DEPENDS', True)) - d.appendVar('GYP_DEFINES', ' %s ' % d.getVar('CHROMIUM_X11_GYP_DEFINES', True)) - if d.getVar('ENABLE_WAYLAND', True) == '1': + if d.getVar('CHROMIUM_ENABLE_WAYLAND', True) == '1': d.appendVar('DEPENDS', ' %s ' % d.getVar('CHROMIUM_WAYLAND_DEPENDS', True)) d.appendVar('GYP_DEFINES', ' %s ' % d.getVar('CHROMIUM_WAYLAND_GYP_DEFINES', True)) + else: + d.appendVar('DEPENDS', ' %s ' % d.getVar('CHROMIUM_X11_DEPENDS', True)) + d.appendVar('GYP_DEFINES', ' %s ' % d.getVar('CHROMIUM_X11_GYP_DEFINES', True)) } do_configure_append() {
Signature · 1 line
2.1.4
Re: [meta-browser][PATCH 3/3] chromium: Rework the evaluation of the Wayland feature.
Quoted 1 line · Carlos Alberto Lopez Perez
+
CHROMIUM_BUILD_TYPE=d.getVar('CHROMIUM_BUILD_TYPE', True)
Lets default to one if its not set by user and set a bb.note about what is chosen may be Release as default is good.
Re: [meta-browser][PATCH 3/3] chromium: Rework the evaluation of the Wayland feature.
Quoted 7 lines · Khem Raj
Quoted 1 line · Carlos Alberto Lopez Perez
+
CHROMIUM_BUILD_TYPE=d.getVar('CHROMIUM_BUILD_TYPE', True)Lets default to one if its not set by user and set a bb.note about what is chosen may be Release as default is good.
It already defaults to Release. The first patch in the series does that in chromium.inc
Re: [meta-browser][PATCH 3/3] chromium: Rework the evaluation of the Wayland feature.
Quoted 12 lines · Carlos Alberto Lopez Perez
Quoted 7 lines · Khem Raj
Quoted 1 line · Carlos Alberto Lopez Perez
+
CHROMIUM_BUILD_TYPE=d.getVar('CHROMIUM_BUILD_TYPE', True)Lets default to one if its not set by user and set a bb.note about what is chosen may be Release as default is good.
It already defaults to Release. The first patch in the series does that in chromium.inc
OK I did not see it first time.
Quoted 7 lines
--
_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-devel