Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Seiderer <ps.report@gmx.net>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH] package/qt5/qt5webengine: fix build with Bison 3.7
Date: Wed, 16 Sep 2020 18:45:05 +0200	[thread overview]
Message-ID: <20200916184505.611500c7@gmx.net> (raw)
In-Reply-To: <20200916121354.1914130-1-thomas.petazzoni@bootlin.com>

Hello Thomas,

On Wed, 16 Sep 2020 14:13:53 +0200, Thomas Petazzoni <thomas.petazzoni@bootlin.com> wrote:

> Add patch from upstream that fixes build with Bison 3.7.
> 
> There are no autobuilder failures for this issue, but the following
> defconfig:
> 
> BR2_arm=y
> BR2_cortex_a8=y
> BR2_TOOLCHAIN_EXTERNAL=y
> BR2_INIT_NONE=y
> BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_EUDEV=y
> BR2_SYSTEM_BIN_SH_NONE=y
> BR2_PACKAGE_QT5=y
> BR2_PACKAGE_QT5WEBENGINE=y
> BR2_PACKAGE_RPI_USERLAND=y
> 
> Failed with:
> 
> /home/thomas/buildroot/buildroot/output/build/qt5webengine-5.15.0/src/core/release/gen/third_party/blink/renderer/core/xpath_grammar.cc:124:10: fatal error: xpath_grammar.hh: No such file or directory
>   124 | #include "xpath_grammar.hh"
>       |          ^~~~~~~~~~~~~~~~~~
> compilation terminated.
> 
> With this patch applied, it builds fine.
> 
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
> ---
>  .../qt5/qt5webengine/0002-fix-bison-3.7.patch | 55 +++++++++++++++++++
>  1 file changed, 55 insertions(+)
>  create mode 100644 package/qt5/qt5webengine/0002-fix-bison-3.7.patch
> 
> diff --git a/package/qt5/qt5webengine/0002-fix-bison-3.7.patch b/package/qt5/qt5webengine/0002-fix-bison-3.7.patch
> new file mode 100644
> index 0000000000..575fe27b1b
> --- /dev/null
> +++ b/package/qt5/qt5webengine/0002-fix-bison-3.7.patch
> @@ -0,0 +1,55 @@
> +From 1a53f5995697f5ac6fd501dbdc0ee39c9488ee66 Mon Sep 17 00:00:00 2001
> +From: Allan Sandfeld Jensen <allan.jensen@qt.io>
> +Date: Fri, 14 Aug 2020 16:38:48 +0200
> +Subject: Fix bison 3.7
> +MIME-Version: 1.0
> +Content-Type: text/plain; charset=UTF-8
> +Content-Transfer-Encoding: 8bit
> +
> +Do a replace run inspired by newer versions of the script.
> +
> +Fixes: QTBUG-86018
> +Change-Id: Ib1dc771e22a662aff0fae842d135ad58fad08bc1
> +Reviewed-by: Michael Br?ning <michael.bruning@qt.io>

[Upstream: https://code.qt.io/cgit/qt/qtwebengine-chromium.git/commit/?h=80-based&id=1a53f5995697f5ac6fd501dbdc0ee39c9488ee66]

Reviewed-by: Peter Seiderer <ps.report@gmx.net>

Regards,
Peter

> +Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
> +---
> + .../blink/renderer/build/scripts/rule_bison.py        | 19 +++++++++++++++++++
> + 1 file changed, 19 insertions(+)
> +
> +diff --git a/chromium/third_party/blink/renderer/build/scripts/rule_bison.py b/chromium/third_party/blink/renderer/build/scripts/rule_bison.py
> +index f75e25fd23f..7e0767e951a 100755
> +--- a/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/rule_bison.py
> ++++ b/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/rule_bison.py
> +@@ -45,6 +45,19 @@ from utilities import abs
> + 
> + from blinkbuild.name_style_converter import NameStyleConverter
> + 
> ++def modify_file(path, prefix_lines, suffix_lines, replace_list=[]):
> ++    prefix_lines = map(lambda s: s + '\n', prefix_lines)
> ++    suffix_lines = map(lambda s: s + '\n', suffix_lines)
> ++    with open(path, 'r') as f:
> ++        old_lines = f.readlines()
> ++    for i in range(len(old_lines)):
> ++        for src, dest in replace_list:
> ++            old_lines[i] = old_lines[i].replace(src, dest)
> ++    new_lines = prefix_lines + old_lines + suffix_lines
> ++    with open(path, 'w') as f:
> ++        f.writelines(new_lines)
> ++
> ++
> + assert len(sys.argv) == 4 or len(sys.argv) == 5
> + 
> + inputFile = abs(sys.argv[1])
> +@@ -115,3 +128,9 @@ print >>outputHFile, '#define %s' % headerGuard
> + print >>outputHFile, outputHContents
> + print >>outputHFile, '#endif  // %s' % headerGuard
> + outputHFile.close()
> ++
> ++common_replace_list = [(inputRoot + '.hh',
> ++                        inputRoot + '.h')]
> ++modify_file(
> ++    outputCpp, [], [],
> ++    replace_list=common_replace_list)
> +-- 
> +cgit v1.2.1
> +

  reply	other threads:[~2020-09-16 16:45 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-16 12:13 [Buildroot] [PATCH] package/qt5/qt5webengine: fix build with Bison 3.7 Thomas Petazzoni
2020-09-16 16:45 ` Peter Seiderer [this message]
2020-09-16 20:37 ` Yann E. MORIN

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200916184505.611500c7@gmx.net \
    --to=ps.report@gmx.net \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox