rpm/platform-python-bytecompile.patch
Iryna Shcherbina 412abe2ac1 Platform-python bootstrap: step 1 - build without platform_python
Changes needed for Platform Python Stack change (https://fedoraproject.org/wiki/Changes/Platform_Python_Stack):
- Add platform-python bytecompilation patch: platform-python-bytecompile.patch
- Add platform python deps generator patch: platform-python-abi.patch
- Add a platform-python subpackage and remove system python related declarations
- Build rpm without platform_python for bytecompilation (already set in spec file)

When platform-python package is built, switch to `%bcond_without platform_python`
to build platform-python-rpm subpackage.
2017-08-15 11:09:05 +02:00

53 lines
2.1 KiB
Diff

From cc1a08b4a5222e74cae46ee17d4ef297ed63c2a9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= <miro@hroncok.cz>
Date: Tue, 8 Aug 2017 12:27:48 +0200
Subject: [PATCH] Bytecompile stuff in /usr/lib*/platform-python with
platform-python
---
scripts/brp-python-bytecompile | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/scripts/brp-python-bytecompile b/scripts/brp-python-bytecompile
index 894fa3459..92460b982 100644
--- a/scripts/brp-python-bytecompile
+++ b/scripts/brp-python-bytecompile
@@ -57,9 +57,15 @@ EOF
# and below /usr/lib/python3.1/, we're targeting /usr/bin/python3.1
shopt -s nullglob
-for python_libdir in `find "$RPM_BUILD_ROOT" -type d|grep -E "/usr/lib(64)?/python[0-9]\.[0-9]$"`;
+for python_libdir in `find "$RPM_BUILD_ROOT" -type d|grep -E "/usr/lib(64)?/(platform-)?python[0-9]\.[0-9]$"`;
do
- python_binary=/usr/bin/$(basename $python_libdir)
+ python_basename=$(basename $python_libdir)
+ if [[ $python_basename == platform* ]];
+ then
+ python_binary=/usr/libexec/$python_basename
+ else
+ python_binary=/usr/bin/$python_basename
+ fi
real_libdir=${python_libdir/$RPM_BUILD_ROOT/}
echo "Bytecompiling .py files below $python_libdir using $python_binary"
@@ -88,14 +94,14 @@ if [ ! -x "$default_python" ]; then
fi
# Generate normal (.pyc) byte-compiled files.
-python_bytecompile "" $default_python "/bin/|/sbin/|/usr/lib(64)?/python[0-9]\.[0-9]|/usr/share/doc" "$RPM_BUILD_ROOT" "$depth" "/"
+python_bytecompile "" $default_python "/bin/|/sbin/|/usr/lib(64)?/(platform-)?python[0-9]\.[0-9]|/usr/share/doc" "$RPM_BUILD_ROOT" "$depth" "/"
if [ $? -ne 0 -a 0$errors_terminate -ne 0 ]; then
# One or more of the files had a syntax error
exit 1
fi
# Generate optimized (.pyo) byte-compiled files.
-python_bytecompile "-O" $default_python "/bin/|/sbin/|/usr/lib(64)?/python[0-9]\.[0-9]|/usr/share/doc" "$RPM_BUILD_ROOT" "$depth" "/"
+python_bytecompile "-O" $default_python "/bin/|/sbin/|/usr/lib(64)?/(platform-)?python[0-9]\.[0-9]|/usr/share/doc" "$RPM_BUILD_ROOT" "$depth" "/"
if [ $? -ne 0 -a 0$errors_terminate -ne 0 ]; then
# One or more of the files had a syntax error
exit 1
--
2.13.3