Skip to content

Commit 28674c6

Browse files
committed
chromium: use python3 and remove dependency on meta-python2
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
1 parent 02bb403 commit 28674c6

File tree

6 files changed

+57
-9
lines changed

6 files changed

+57
-9
lines changed

meta-chromium/README.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,6 @@ This layer depends on:
1919
- branch: master
2020
- revision: HEAD
2121

22-
* URI: git://git.openembedded.org/meta-python2
23-
- branch: master
24-
- revision: HEAD
25-
2622
Contributing
2723
------------
2824

meta-chromium/conf/layer.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ BBFILE_PRIORITY_chromium-browser-layer = "7"
1111
LAYERVERSION_chromium-browser-layer = "1"
1212
LAYERSERIES_COMPAT_chromium-browser-layer = "dunfell gatesgarth hardknott honister"
1313

14-
LAYERDEPENDS_chromium-browser-layer = "clang-layer core openembedded-layer meta-python2"
14+
LAYERDEPENDS_chromium-browser-layer = "clang-layer core openembedded-layer"

meta-chromium/recipes-browser/chromium/chromium-gn.inc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ SRC_URI += " \
2222
file://0011-exception_handler.cc-Match-the-types-for-SIGSTKSZ.patch \
2323
file://0013-Revert-Use-ffile-compilation-dir-instead-of-fdebug-c.patch \
2424
file://0014-ozone-wayland-don-t-build-xcb-for-pure-wayland-build.patch \
25+
file://0015-build-use-python3.patch \
2526
"
2627

2728
SRC_URI:append:libc-musl = "\
@@ -386,7 +387,7 @@ addtask add_nodejs_symlink after do_configure before do_compile
386387

387388
do_configure() {
388389
cd ${S}
389-
./build/linux/unbundle/replace_gn_files.py --system-libraries ${GN_UNBUNDLE_LIBS}
390+
python3 ./build/linux/unbundle/replace_gn_files.py --system-libraries ${GN_UNBUNDLE_LIBS}
390391
gn gen --args='${GN_ARGS}' "${OUTPUT_DIR}"
391392
}
392393

meta-chromium/recipes-browser/chromium/chromium.inc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ LIBCPLUSPLUS = "-stdlib=libc++"
3939
# newer meta-clang in https://github.com/kraj/meta-clang/commit/cda2283e4cf3c90ea42b43dbc3a2268be6655670)
4040
DEPENDS += "libcxx"
4141

42-
inherit mime-xdg pythonnative
43-
DEPENDS += "python-setuptools-native"
42+
inherit mime-xdg python3native
43+
DEPENDS += "python3-setuptools-native"
4444

4545
# Chromium itself is licensed under the 3-clause BSD license. However, it
4646
# depends upon several other projects whose copyright files are listed in
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
From 5defc3d0745fd40635c730acb8e694c6402f0d2d Mon Sep 17 00:00:00 2001
2+
From: Martin Jansa <Martin.Jansa@gmail.com>
3+
Date: Tue, 28 Sep 2021 16:26:45 +0200
4+
Subject: [PATCH] build: use python3
5+
6+
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
7+
---
8+
build/linux/unbundle/replace_gn_files.py | 2 +-
9+
buildtools/linux64/clang-format | 8 ++++----
10+
2 files changed, 5 insertions(+), 5 deletions(-)
11+
12+
diff --git a/build/linux/unbundle/replace_gn_files.py b/build/linux/unbundle/replace_gn_files.py
13+
index eba4bd1fb3..53cb4b0296 100755
14+
--- a/build/linux/unbundle/replace_gn_files.py
15+
+++ b/build/linux/unbundle/replace_gn_files.py
16+
@@ -1,4 +1,4 @@
17+
-#!/usr/bin/env python
18+
+#!/usr/bin/env python3
19+
# Copyright 2016 The Chromium Authors. All rights reserved.
20+
# Use of this source code is governed by a BSD-style license that can be
21+
# found in the LICENSE file.
22+
diff --git a/buildtools/linux64/clang-format b/buildtools/linux64/clang-format
23+
index 1a25a2b520..806b620bc4 100755
24+
--- a/buildtools/linux64/clang-format
25+
+++ b/buildtools/linux64/clang-format
26+
@@ -1,4 +1,4 @@
27+
-#!/usr/bin/env python2
28+
+#!/usr/bin/env python3
29+
# Copyright 2020 The Chromium Authors. All rights reserved.
30+
# Use of this source code is governed by a BSD-style license that can be
31+
# found in the LICENSE file.
32+
@@ -12,7 +12,7 @@ inputfiles = [a for a in args if not a.startswith('-')]
33+
34+
contents = ''
35+
if '-' in args or not inputfiles:
36+
- contents = sys.stdin.read()
37+
+ contents = sys.stdin.read().encode('utf-8')
38+
39+
# Tarball builds may or may not have depot_tools in $PATH. In the former case,
40+
# running 'clang-format' will call back into this script infinitely. Strip off
41+
@@ -34,8 +34,8 @@ try:
42+
stdout, stderr = proc.communicate(input=contents)
43+
# Ignore if clang-format fails. Eg: it may be too old to support C++14.
44+
if proc.returncode == 0:
45+
- sys.stdout.write(stdout)
46+
- sys.stderr.write(stderr)
47+
+ sys.stdout.write(stdout.decode('utf-8'))
48+
+ sys.stderr.write(stderr.decode('utf-8'))
49+
sys.exit(0)
50+
except OSError:
51+
# Ignore if clang-format is not installed.

meta-chromium/recipes-browser/chromium/gn-native_94.0.4606.61.bb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ LDFLAGS:append:runtime-llvm = " -rtlib=libgcc -unwindlib=libgcc -stdlib=libc++ -
3737
do_configure[noexec] = "1"
3838

3939
do_compile() {
40-
python ${S}/tools/gn/bootstrap/bootstrap.py --skip-generate-buildfiles
40+
python3 ${S}/tools/gn/bootstrap/bootstrap.py --skip-generate-buildfiles
4141
}
4242

4343
do_install() {

0 commit comments

Comments
 (0)