From e90c1b5d85ebcaed6e89cf8bf6b2327210769370 Mon Sep 17 00:00:00 2001 From: Tomas Hrnciar Date: Wed, 21 Jul 2021 16:19:29 +0200 Subject: [PATCH] Replace removed /usr/lib/rpm/brp-python-bytecompile with %%py_byte_compile macros --- pypy3.spec | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/pypy3.spec b/pypy3.spec index 025102c..3b11f44 100644 --- a/pypy3.spec +++ b/pypy3.spec @@ -2,7 +2,7 @@ Name: pypy3 Version: %{basever}.4 %global pyversion 3.7 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Python 3 implementation with a Just-In-Time compiler # PyPy is MIT @@ -143,10 +143,6 @@ URL: http://pypy.org/ %global goal_dir pypy/goal -# Turn off the brp-python-bytecompile postprocessing script -# We manually invoke it later on, using the freshly built pypy binary -%global __brp_python_bytecompile %{nil} - # Source and patches: Source0: https://downloads.python.org/pypy/pypy%{pyversion}-v%{version}-src.tar.bz2 @@ -221,6 +217,9 @@ BuildRequires: expat-devel BuildRequires: openssl-devel BuildRequires: gdbm-devel BuildRequires: xz-devel + +BuildRequires: python-rpm-macros + %ifnarch s390 BuildRequires: valgrind-devel %endif @@ -617,19 +616,12 @@ ln -s pypy%{pyversion} %{buildroot}%{_bindir}/pypy3 # Bytecompile all of the .py files we ship, using our pypy binary, giving us -# .pyc files for pypy. The script actually does the work twice (passing in -O -# the second time) but it's simplest to reuse that script. -# -# The script has special-casing for .py files below -# /usr/lib{64}/python[0-9].[0-9] -# but given that we're installing into a different path, the supplied "default" -# implementation gets used instead. +# .pyc files for pypy. # # Note that some of the test files deliberately contain syntax errors, so -# we pass 0 for the second argument ("errors_terminate"): -/usr/lib/rpm/brp-python-bytecompile \ - %{buildroot}%{pypyprefix}/bin/pypy3 \ - 0 +# we are running it in subshell, to be able to ignore the failures and not to terminate the build. +(%{py_byte_compile %{buildroot}%{pypyprefix}/bin/pypy3 %{buildroot}%{pypyprefix}}) || : + %{buildroot}%{pypyprefix}/bin/pypy3 -c 'import _tkinter' %{buildroot}%{pypyprefix}/bin/pypy3 -c 'import tkinter' @@ -897,6 +889,10 @@ CheckPyPy %{name}-stackless %changelog +* Wed Jul 21 2021 Tomas Hrnciar - 7.3.4-2 +- Replace removed /usr/lib/rpm/brp-python-bytecompile with %%py_byte_compile macros +- Fixes: rhbz#1976656 + * Tue May 25 2021 Miro HronĨok - 7.3.4-1 - Update to 7.3.4 - pypy3 is now Python 3.7