[kate/f19] fix -pate build by only installing python2 compatible plugins

T.C. Hollingsworth patches at fedoraproject.org
Sat Dec 14 18:21:32 UTC 2013


commit 3d890bedd0ac073f209d279edb21663fec073501
Author: T.C. Hollingsworth <tchollingsworth at gmail.com>
Date:   Sat Dec 14 10:36:09 2013 -0700

    fix -pate build by only installing python2 compatible plugins
    
    sorry, this patch didn't get reviewed in time to make 4.11.4 :-(
    can drop in 4.11.5/4.12

 ...l-only-plugins-compatible-with-the-used-P.patch |  111 ++++++++++++++++++++
 kate.spec                                          |   13 ++-
 2 files changed, 122 insertions(+), 2 deletions(-)
---
diff --git a/0001-pate-install-only-plugins-compatible-with-the-used-P.patch b/0001-pate-install-only-plugins-compatible-with-the-used-P.patch
new file mode 100644
index 0000000..5581ba3
--- /dev/null
+++ b/0001-pate-install-only-plugins-compatible-with-the-used-P.patch
@@ -0,0 +1,111 @@
+From 41e15427a6d6083ead538af0584804e33cbdfc4c Mon Sep 17 00:00:00 2001
+From: "T.C. Hollingsworth" <tchollingsworth at gmail.com>
+Date: Mon, 2 Dec 2013 14:26:59 -0700
+Subject: [PATCH] pate: install only plugins compatible with the used Python
+ version
+
+This prevents useless plugins from being installed, and also
+eliminates build failures on distributions that byte-compile
+Python code during their package build process.
+
+REVIEW:114264
+---
+ addons/kate/pate/src/CMakeLists.txt | 60 ++++++++++++++++++++++++++++---------
+ 1 file changed, 46 insertions(+), 14 deletions(-)
+
+diff --git a/addons/kate/pate/src/CMakeLists.txt b/addons/kate/pate/src/CMakeLists.txt
+index 78bbdc0..516bfbe 100644
+--- a/addons/kate/pate/src/CMakeLists.txt
++++ b/addons/kate/pate/src/CMakeLists.txt
+@@ -40,6 +40,10 @@ install(FILES pate.desktop DESTINATION ${SERVICES_INSTALL_DIR})
+ install(DIRECTORY kate DESTINATION ${DATA_INSTALL_DIR}/kate/plugins/pate FILES_MATCHING PATTERN "*.py")
+ 
+ #
++# Install plugins that work with either Python 2 or 3
++#
++
++#
+ # Install individual Pate plugins.
+ #
+ install(FILES
+@@ -48,7 +52,6 @@ install(FILES
+     plugins/color_tools_toolview.ui
+     plugins/commentar.py
+     plugins/commentar_config.ui
+-    plugins/expand.py
+     plugins/format.py
+     plugins/xml_pretty.py
+     plugins/xml_pretty.ui
+@@ -56,26 +59,55 @@ install(FILES
+ 
+ install(DIRECTORY
+     plugins/django_utils
+-    plugins/expand
+     plugins/gid
+     plugins/libkatepate
+     plugins/python_console_classic
+     plugins/python_utils
+-    plugins/python_autocomplete
+     DESTINATION ${DATA_INSTALL_DIR}/kate/pate FILES_MATCHING PATTERN "*.py" PATTERN "*.ui")
+ 
+ install(DIRECTORY
+-    plugins/expand
+-    DESTINATION ${DATA_INSTALL_DIR}/kate/pate FILES_MATCHING PATTERN "*.expand")
+-
+-install(DIRECTORY
+-    plugins/js_utils
+-    DESTINATION ${DATA_INSTALL_DIR}/kate/pate FILES_MATCHING PATTERN "*.py" PATTERN "*.ui" PATTERN "*.json")
+-
+-install(DIRECTORY
+     plugins/python_console_ipython
+     DESTINATION ${DATA_INSTALL_DIR}/kate/pate FILES_MATCHING PATTERN "*.py" PATTERN "*.ui" PATTERN "*.css")
+ 
+-install(DIRECTORY
+-    plugins/cmake_utils
+-    DESTINATION ${DATA_INSTALL_DIR}/kate/pate FILES_MATCHING PATTERN "*.py" PATTERN "*.ui")
++#
++# Install plugins that work only with Python 3 iff we're building against it
++#
++if(PYTHON_VERSION_MAJOR VERSION_EQUAL 3)
++
++    install(
++        FILES plugins/expand.py
++        DESTINATION ${DATA_INSTALL_DIR}/kate/pate
++      )
++
++    install(
++        DIRECTORY plugins/cmake_utils
++        DESTINATION ${DATA_INSTALL_DIR}/kate/pate
++        FILES_MATCHING PATTERN "*.py" PATTERN "*.ui"
++      )
++
++    install(
++        DIRECTORY plugins/expand
++        DESTINATION ${DATA_INSTALL_DIR}/kate/pate
++        FILES_MATCHING PATTERN "*.py" PATTERN "*.ui" PATTERN "*.rc" PATTERN "*.expand"
++      )
++
++    install(
++        DIRECTORY plugins/js_utils
++        DESTINATION ${DATA_INSTALL_DIR}/kate/pate
++        FILES_MATCHING PATTERN "*.py" PATTERN "*.ui" PATTERN "*.json" PATTERN "*.js" PATTERN "*.rc"
++      )
++
++endif()
++
++#
++# Install plugins that work only with Python 2 iff we're building against it
++#
++if(PYTHON_VERSION_MAJOR VERSION_EQUAL 2)
++
++    install(
++        DIRECTORY plugins/python_autocomplete
++        DESTINATION ${DATA_INSTALL_DIR}/kate/pate
++        FILES_MATCHING PATTERN "*.py" PATTERN "*.ui" PATTERN "*.rc"
++      )
++
++endif()
+\ No newline at end of file
+-- 
+1.8.4.2
+
diff --git a/kate.spec b/kate.spec
index bcb8cdb..b9090cf 100644
--- a/kate.spec
+++ b/kate.spec
@@ -1,11 +1,11 @@
 
 # enable pate (kate python plugin), disable to bootstrap pykde4
-#define pate 1
+%define pate 1
 
 Name:    kate
 Summary: Advanced Text Editor 
 Version: 4.11.4
-Release: 1%{?dist}
+Release: 2%{?dist}
 
 # kwrite LGPLv2+
 # kate: app LGPLv2, plugins, LGPLv2 and LGPLv2+ and GPLv2+
@@ -24,6 +24,10 @@ Source0: http://download.kde.org/%{stable}/%{version}/src/%{name}-%{version}.tar
 ## upstreamable patches
 
 ## upstream patches
+# fix -pate build by only installing Python 2 compatible plugins
+# http://quickgit.kde.org/?p=kate.git&a=commit&h=41e15427a6d6083ead538af0584804e33cbdfc4c
+# https://bugzilla.redhat.com/show_bug.cgi?id=922280#c21
+Patch0001: 0001-pate-install-only-plugins-compatible-with-the-used-P.patch
 
 BuildRequires: desktop-file-utils
 BuildRequires: kactivities-devel >= %{version}
@@ -95,6 +99,8 @@ Requires: kde-runtime%{?_kde4_version: >= %{_kde4_version}}
 %prep
 %setup -q
 
+%patch0001 -p1 -b .0001
+
 
 %build
 mkdir -p %{_target_platform}
@@ -225,6 +231,9 @@ fi
 
 
 %changelog
+* Sat Dec 14 2013 T.C. Hollingsworth <tchollingsworth at gmail.com> - 4.11.4-2
+- fix -pate build by only installing Python 2 compatible plugins
+
 * Fri Dec 13 2013 Rex Dieter <rdieter at fedoraproject.org> - 4.11.4-1
 - 4.11.4
 - disable -pate (ftbfs)


More information about the scm-commits mailing list