Simplify handling of unversioned python

Now that /usr/bin/python == python3, we can just BR: the
python-unversioned-command package instead of doing a complicated
search and replace through the codebase.

Signed-off-by: Stephen Gallagher <sgallagh@redhat.com>
This commit is contained in:
Stephen Gallagher 2021-01-18 12:47:39 -05:00
parent 3ce811c32f
commit 4fb0644412
No known key found for this signature in database
GPG key ID: 45DB85A568286D11

View file

@ -1,6 +1,5 @@
# bundle dependencies that are not available as Fedora modules # bundle dependencies that are not available as Fedora modules
%bcond_with bootstrap %bcond_with bootstrap
%bcond_without python3_fixup
# LTO is currently broken on Node.js builds # LTO is currently broken on Node.js builds
%define _lto_cflags %{nil} %define _lto_cflags %{nil}
@ -149,6 +148,7 @@ Patch2: 0002-Install-both-binaries-and-use-libdir.patch
BuildRequires: make BuildRequires: make
BuildRequires: python3-devel BuildRequires: python3-devel
BuildRequires: python3-setuptools BuildRequires: python3-setuptools
BuildRequires: python-unversioned-command
BuildRequires: zlib-devel BuildRequires: zlib-devel
BuildRequires: brotli-devel BuildRequires: brotli-devel
BuildRequires: gcc >= 6.3.0 BuildRequires: gcc >= 6.3.0
@ -358,16 +358,6 @@ The API documentation for the Node.js JavaScript runtime.
rm -rf deps/zlib rm -rf deps/zlib
rm -rf deps/brotli rm -rf deps/brotli
# Replace any instances of unversioned python' with python3
%if %{with python3_fixup}
pathfix.py -i %{__python3} -pn $(find -type f ! -name "*.js")
find . -type f -exec sed -i "s~/usr\/bin\/env python~/usr/bin/python3~" {} \;
find . -type f -exec sed -i "s~/usr\/bin\/python\W~/usr/bin/python3~" {} \;
sed -i "s~python~python3~" $(find . -type f | grep "gyp$")
sed -i "s~usr\/bin\/python2~usr\/bin\/python3~" ./deps/v8/tools/gen-inlining-tests.py
sed -i "s~usr\/bin\/python.*$~usr\/bin\/python3~" ./deps/v8/tools/mb/mb_unittest.py
find . -type f -exec sed -i "s~python -c~python3 -c~" {} \;
%endif
%build %build
# When compiled on armv7hl this package generates an out of range # When compiled on armv7hl this package generates an out of range