diff --git a/chromium.spec b/chromium.spec index 446d5ecc..7da20e94 100644 --- a/chromium.spec +++ b/chromium.spec @@ -418,13 +418,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 @@ -744,6 +752,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++" @@ -1073,8 +1085,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 @@ -1153,8 +1165,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