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.
This commit is contained in:
Kalev Lember 2021-03-10 17:09:14 +01:00
parent a27bc6cc24
commit 4805d44fa0
1 changed files with 1 additions and 1 deletions

View File

@ -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"