From c6015fffb633165a3a7e020642980164e46ab4d3 Mon Sep 17 00:00:00 2001 From: Kalev Lember Date: Wed, 10 Mar 2021 17:09:14 +0100 Subject: [PATCH] BRP Python Bytecompile: Avoid hardcoding /usr/bin prefix for python Avoid using the full path and instead rely on PATH being correctly set up to find the executable. This fixes byte compilation for python2.7 when doing flatpak module builds where python2.7 can be in either /usr/bin or /app/bin, depending on how it's compiled. --- brp-python-bytecompile | 2 +- redhat-rpm-config.spec | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/brp-python-bytecompile b/brp-python-bytecompile index 012e8b5..ead7022 100755 --- a/brp-python-bytecompile +++ b/brp-python-bytecompile @@ -121,7 +121,7 @@ export PYTHONHASHSEED=0 shopt -s nullglob for python_libdir in `find "$RPM_BUILD_ROOT" -type d|grep -E "/(usr|app)/lib(64)?/python[0-9]\.[0-9]+$"`; do - python_binary=/usr/bin/$(basename $python_libdir) + python_binary=$(basename $python_libdir) real_libdir=${python_libdir/$RPM_BUILD_ROOT/} echo "Bytecompiling .py files below $python_libdir using $python_binary" diff --git a/redhat-rpm-config.spec b/redhat-rpm-config.spec index 2bcdb6d..2c39298 100644 --- a/redhat-rpm-config.spec +++ b/redhat-rpm-config.spec @@ -6,7 +6,7 @@ Summary: Red Hat specific rpm configuration files Name: redhat-rpm-config -Version: 174 +Version: 175 Release: 1%{?dist} # No version specified. License: GPL+ @@ -213,6 +213,9 @@ install -p -m 644 -t %{buildroot}%{_rpmluadir}/fedora/srpm forge.lua %{_rpmconfigdir}/macros.d/macros.kmp %changelog +* Wed Mar 10 2021 Kalev Lember - 175-1 +- BRP Python Bytecompile: Avoid hardcoding /usr/bin prefix for python + * Sun Nov 29 2020 Miro HronĨok - 174-1 - BRP Python Bytecompile: Also detect Python files in /app/lib/pythonX.Y