From 0d6025608fe2a74e49a255ac09a2050b90a06b94 Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Apr 28 2018 13:01:28 +0000 Subject: Use configuration macro instead of workaround to disable byte-compilation --- diff --git a/python34.spec b/python34.spec index 1c7b1aa..695fd6d 100644 --- a/python34.spec +++ b/python34.spec @@ -71,26 +71,10 @@ # Turn this to 0 to turn off the "check" phase: %global run_selftest_suite 1 -# We want to byte-compile the .py files within the packages using the new -# python3 binary. -# -# Unfortunately, rpmbuild's infrastructure requires us to jump through some -# hoops to avoid byte-compiling with the system python 2 version: -# /usr/lib/rpm/redhat/macros sets up build policy that (amongst other things) -# defines __os_install_post. In particular, "brp-python-bytecompile" is -# invoked without an argument thus using the wrong version of python -# (/usr/bin/python, rather than the freshly built python), thus leading to -# numerous syntax errors, and incorrect magic numbers in the .pyc files. We -# thus override __os_install_post to avoid invoking this script: -%global __os_install_post /usr/lib/rpm/brp-compress \ - %{!?__debug_package:/usr/lib/rpm/brp-strip %{__strip}} \ - /usr/lib/rpm/brp-strip-static-archive %{__strip} \ - /usr/lib/rpm/brp-strip-comment-note %{__strip} %{__objdump} \ - /usr/lib/rpm/brp-python-hardlink -# to remove the invocation of brp-python-bytecompile, whilst keeping the -# invocation of brp-python-hardlink (since this should still work for python3 -# pyc/pyo files) - +# Disable automatic bytecompilation. The python3 binary is not yet be +# available in /usr/bin when Python is built. Also, the bytecompilation fails +# on files that test invalid syntax. +%undefine py_auto_byte_compile # We need to get a newer configure generated out of configure.in for the following # patches: