From cdad6219176a761555ddcc13017f3e5d88fc16de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Thu, 29 Mar 2018 14:45:36 +0200 Subject: [PATCH] Be explicit about the Python version used --- chromium.spec | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/chromium.spec b/chromium.spec index 8bbca8ab..64840991 100644 --- a/chromium.spec +++ b/chromium.spec @@ -416,13 +416,21 @@ BuildRequires: pkgconfig(gtk+-3.0) BuildRequires: pkgconfig(gtk+-2.0) %endif BuildRequires: pulseaudio-libs-devel -BuildRequires: python2 +BuildRequires: python2-devel +%if 0%{?fedora} > 27 +BuildRequires: python2-beautifulsoup4 +BuildRequires: python2-beautifulsoup +BuildRequires: python2-html5lib +BuildRequires: python2-markupsafe +BuildRequires: python2-ply +%else BuildRequires: python-beautifulsoup4 BuildRequires: python-BeautifulSoup BuildRequires: python-html5lib BuildRequires: python-markupsafe BuildRequires: python-ply -BuildRequires: python-simplejson +%endif +BuildRequires: python2-simplejson %if 0%{?bundlere2} # Using bundled bits, do nothing. %else @@ -740,6 +748,10 @@ udev. %patch87 -p1 -b .epel7 %endif +# Change shebang in all relevant files in this directory and all subdirectories +# See `man find` for how the `-exec command {} +` syntax works +find -type f -exec sed -i '1s=^#!/usr/bin/\(python\|env python\)[23]\?=#!%{__python2}=' {} + + %if 0%{?asan} export CC="clang" export CXX="clang++" @@ -1069,8 +1081,8 @@ build/linux/unbundle/remove_bundled_libraries.py \ # Look, I don't know. This package is spit and chewing gum. Sorry. rm -rf third_party/markupsafe -ln -s %{python_sitearch}/markupsafe third_party/markupsafe -# We should look on removing other python packages as well i.e. ply +ln -s %{python2_sitearch}/markupsafe third_party/markupsafe +# We should look on removing other python2 packages as well i.e. ply # Fix hardcoded path in remoting code sed -i 's|/opt/google/chrome-remote-desktop|%{crd_path}|g' remoting/host/setup/daemon_controller_delegate_linux.cc @@ -1145,8 +1157,8 @@ sed -i 's|exec "${THIS_DIR}/ninja-linux${LONG_BIT}"|exec "/usr/bin/ninja-build"| %endif # Check that there is no system 'google' module, shadowing bundled ones: -if python -c 'import google ; print google.__path__' 2> /dev/null ; then \ - echo "Python 'google' module is defined, this will shadow modules of this build"; \ +if python2 -c 'import google ; print google.__path__' 2> /dev/null ; then \ + echo "Python 2 'google' module is defined, this will shadow modules of this build"; \ exit 1 ; \ fi