From c2eae577ed53f406060fa696b1f17f0df160caeb Mon Sep 17 00:00:00 2001 From: Nils Philippsen Date: Thu, 5 Jul 2018 12:48:59 +0200 Subject: [PATCH] byte-compile Python plug-ins separately from Fedora 29 on --- gimp.spec | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/gimp.spec b/gimp.spec index 270c805..3061e71 100644 --- a/gimp.spec +++ b/gimp.spec @@ -31,6 +31,18 @@ # webp support %bcond_without webp +# If Python plug-ins need to be byte-compiled separately +%if ! 0%{?fedora}%{?rhel} || 0%{?fedora} > 28 || 0%{?rhel} > 7 +%bcond_without python_separately_bytecompile +%else +%bcond_with python_separately_bytecompile +%endif + +%if %{with python_separately_bytecompile} +# Disable automatic compilation of Python files in extra directories +%global _python_bytecompile_extra 0 +%endif + # skip tests known to be problematic in a specific version #global skip_checks_version X.Y.Z #global skip_checks test1 test2 test3 @@ -416,6 +428,10 @@ for file in $(cat gimp-plugin-files-py); do done done >> gimp-plugin-files +%if %{with python_separately_bytecompile} +%py_byte_compile %{__python2} %{buildroot}%{_libdir}/gimp/%{lib_api_version} +%endif + %if %{with static} find %{buildroot}%{_libdir}/gimp/%{lib_api_version} -type f | sed "s@^%{buildroot}@@g" | grep '\.a$' > gimp-static-files %endif @@ -660,6 +676,7 @@ make check %{?_smp_mflags} %changelog * Thu Jul 05 2018 Nils Philippsen - 2:2.10.4-1 - version 2.10.4 +- byte-compile Python plug-ins separately from Fedora 29 on * Wed May 23 2018 Nils Philippsen - 2:2.10.2-2 - bump required babl and gegl versions