From 54e37fbaa7f9a0b032f93723b07918fc0bf29c3b Mon Sep 17 00:00:00 2001 From: Mikhail Novosyolov Date: Mon, 6 Sep 2021 17:45:47 +0300 Subject: [PATCH] Use pure python3 There is no sense in complicating things, borrow idea to use python3 only from alzim2/chromium-browser-stable --- chromium-browser-stable.spec | 3 -- rename-python-to-python2.patch | 86 ---------------------------------- 2 files changed, 89 deletions(-) delete mode 100644 rename-python-to-python2.patch diff --git a/chromium-browser-stable.spec b/chromium-browser-stable.spec index df9e008..ffee4ae 100644 --- a/chromium-browser-stable.spec +++ b/chromium-browser-stable.spec @@ -121,9 +121,6 @@ Patch639: wayland-strndup.patch # Fix building with current glib2.0 # Hunks from https://build.opensuse.org/package/view_file/openSUSE:Factory/chromium/chromium-gcc11.patch Patch643: glib2.0.patch -# Fix mess of python2 and python3 -# https://github.com/saiarcot895/chromium-ubuntu-build/blob/master/debian/patches/rename-python-to-python2.patch -Patch646: rename-python-to-python2.patch Patch647: ALT-allow-to-override-clang-through-env-variables.patch # XXX This patch is not enough to fully fix debuginfo and debugsource subpackages Patch648: fix-debugsource.patch diff --git a/rename-python-to-python2.patch b/rename-python-to-python2.patch deleted file mode 100644 index 303d54b..0000000 --- a/rename-python-to-python2.patch +++ /dev/null @@ -1,86 +0,0 @@ -Index: dev/tools/gn/bootstrap/bootstrap.py -=================================================================== ---- dev.orig/tools/gn/bootstrap/bootstrap.py -+++ dev/tools/gn/bootstrap/bootstrap.py -@@ -1,4 +1,4 @@ --#!/usr/bin/env python -+#!/usr/bin/env python3 - # Copyright 2014 The Chromium Authors. All rights reserved. - # Use of this source code is governed by a BSD-style license that can be - # found in the LICENSE file. -Index: dev/tools/generate_stubs/generate_stubs.py -=================================================================== ---- dev.orig/tools/generate_stubs/generate_stubs.py -+++ dev/tools/generate_stubs/generate_stubs.py -@@ -1,4 +1,4 @@ --#!/usr/bin/env python -+#!/usr/bin/env python3 - # Copyright (c) 2012 The Chromium Authors. All rights reserved. - # Use of this source code is governed by a BSD-style license that can be - # found in the LICENSE file. -Index: dev/tools/gn/build/gen.py -=================================================================== ---- dev.orig/tools/gn/build/gen.py -+++ dev/tools/gn/build/gen.py -@@ -1,4 +1,4 @@ --#!/usr/bin/env python -+#!/usr/bin/env python3 - # Copyright 2014 The Chromium Authors. All rights reserved. - # Use of this source code is governed by a BSD-style license that can be - # found in the LICENSE file. -Index: dev/tools/gn/src/gn/setup.cc -=================================================================== ---- dev.orig/tools/gn/src/gn/setup.cc -+++ dev/tools/gn/src/gn/setup.cc -@@ -795,7 +795,7 @@ bool Setup::FillPythonPath(const base::C - } - build_settings_.set_python_path(python_path); - #else -- build_settings_.set_python_path(base::FilePath("python")); -+ build_settings_.set_python_path(base::FilePath("python2")); - #endif - } - return true; -Index: dev/third_party/catapult/common/py_vulcanize/py_vulcanize/generate.py -=================================================================== ---- dev.orig/third_party/catapult/common/py_vulcanize/py_vulcanize/generate.py -+++ dev/third_party/catapult/common/py_vulcanize/py_vulcanize/generate.py -@@ -83,7 +83,7 @@ def _MinifyJS(input_js): - - with tempfile.NamedTemporaryFile() as _: - args = [ -- sys.executable, -+ 'python3', - rjsmin_path - ] - p = subprocess.Popen(args, -Index: dev/ui/gfx/x/gen_xproto.py -=================================================================== ---- dev.orig/ui/gfx/x/gen_xproto.py -+++ dev/ui/gfx/x/gen_xproto.py -@@ -1087,7 +1087,7 @@ class GenXproto(FileWriter): - - self.resolve_element(t.elt, fields) - -- for field in fields.values(): -+ for field in list(fields.values()): - if field.field_name == 'sequence': - field.visible = True - field.parent = (t, name) -@@ -1629,8 +1630,14 @@ def main(): - args = parser.parse_args() - - sys.path.insert(1, args.xcbproto_dir) -- import xcbgen.xtypes -- import xcbgen.state -+ try: -+ import xcbgen.xtypes -+ import xcbgen.state -+ except: -+ if sys.version_info < (3, 0): -+ import subprocess -+ subprocess.check_call(["python3"] + sys.argv) -+ return 0 - - all_types = {} - proto_src_dir = os.path.join(args.xcbproto_dir, 'src')