1 |
commit: d97ec781672da62b186a74122c1bee149852b3ba |
2 |
Author: Andreas Sturmlechner <andreas.sturmlechner <AT> gmail <DOT> com> |
3 |
AuthorDate: Sun Feb 14 23:06:23 2016 +0000 |
4 |
Commit: Michael Palimaka <kensington <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Feb 18 14:23:56 2016 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/kde.git/commit/?id=d97ec781 |
7 |
|
8 |
kde5.eclass: Implement split kdepim.git handling |
9 |
|
10 |
eclass/kde5.eclass | 78 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
11 |
1 file changed, 78 insertions(+) |
12 |
|
13 |
diff --git a/eclass/kde5.eclass b/eclass/kde5.eclass |
14 |
index 46ac15e..db3d440 100644 |
15 |
--- a/eclass/kde5.eclass |
16 |
+++ b/eclass/kde5.eclass |
17 |
@@ -101,6 +101,19 @@ else |
18 |
: ${KDE_TEST:=false} |
19 |
fi |
20 |
|
21 |
+# @ECLASS-VARIABLE: KDE_PIM_KEEP_SUBDIR |
22 |
+# @DESCRIPTION: |
23 |
+# If building a split package from KMNAME="kdepim", provide a list of |
24 |
+# subdirectories that need to be present for a successful build. |
25 |
+: ${KDE_PIM_KEEP_SUBDIR:=} |
26 |
+ |
27 |
+# @ECLASS-VARIABLE: KDE_PIM_KONTACTPLUGIN |
28 |
+# @DESCRIPTION: |
29 |
+# This variable is used when building a split package from KMNAME="kdepim". |
30 |
+# If set to "true", add "+kontact" to IUSE and add the appropriate dependency. |
31 |
+# If set to "false", find plugin subdir and remove it from build. |
32 |
+: ${KDE_PIM_KONTACTPLUGIN:=false} |
33 |
+ |
34 |
# @ECLASS-VARIABLE: KDE_PUNT_BOGUS_DEPS |
35 |
# @DESCRIPTION: |
36 |
# If set to "false", do nothing. |
37 |
@@ -208,6 +221,14 @@ case ${KDE_HANDBOOK} in |
38 |
;; |
39 |
esac |
40 |
|
41 |
+case ${KDE_PIM_KONTACTPLUGIN} in |
42 |
+ true) |
43 |
+ IUSE+=" +kontact" |
44 |
+ DEPEND+=" $(add_kdeapps_dep kontactinterface)" |
45 |
+ ;; |
46 |
+ *) ;; |
47 |
+esac |
48 |
+ |
49 |
case ${KDE_TEST} in |
50 |
false) ;; |
51 |
*) |
52 |
@@ -533,6 +554,63 @@ kde5_src_prepare() { |
53 |
cmake_comment_add_subdirectory tests |
54 |
fi |
55 |
fi |
56 |
+ |
57 |
+ # kdepim split packaging handling (drop other applications != {PN}) |
58 |
+ if [[ ${KMNAME} = "kdepim" && $(basename "${S}") != ${PN} ]] || [[ ${PN} = "kdepim" ]] ; then |
59 |
+ # make optional a lot of otherwise required dependencies in root CMakeLists.txt |
60 |
+ sed -e "/find_package(KF5/ s/ REQUIRED//" \ |
61 |
+ -e "/find_package(Qt5 / s/ REQUIRED/ OPTIONAL_COMPONENTS/" \ |
62 |
+ -i CMakeLists.txt || die "Failed to make dependencies optional" |
63 |
+ # FIXME: try to push these down into subdirs @upstream |
64 |
+ # AkonadiSearch: kaddressbook, knotes, kdepim (kmail, korganizer) |
65 |
+ # Boost: kleopatra, kdepim (kmail, agents) |
66 |
+ # Gpgme: kleopatra |
67 |
+ # Grantlee: akregator, kaddressbook, knotes, kdepim (grantleeeditor, kmail, kontact) |
68 |
+ # MailTransportDBusService: kdepim (kmail) |
69 |
+ # Phonon4Qt5: kdepim (kalarm, korgac) |
70 |
+ sed -e "/set_package_properties(KF5AkonadiSearch/ s/ REQUIRED/ OPTIONAL/" \ |
71 |
+ -e "/set_package_properties(Boost/ s/ REQUIRED/ OPTIONAL/" \ |
72 |
+ -e "/find_package(Gpgme/ s/ REQUIRED//" \ |
73 |
+ -e "/find_package(Grantlee5/ s/ REQUIRED//" \ |
74 |
+ -e "/find_package(MailTransportDBusService/ s/ REQUIRED//" \ |
75 |
+ -e "/find_package(Phonon4Qt5/ s/ REQUIRED//" \ |
76 |
+ -i CMakeLists.txt || die "Failed to make dependencies optional" |
77 |
+ |
78 |
+ # remove anything else not listed here |
79 |
+ local _pim_keep_subdir="${PN} ${KDE_PIM_KEEP_SUBDIR}" |
80 |
+ einfo "Building: ${_pim_keep_subdir}" |
81 |
+ _pim_keep_subdir="cmake doc examples grantlee-extractor-pot-scripts ${_pim_keep_subdir}" |
82 |
+ |
83 |
+ einfo "Removing other subdirectories:" |
84 |
+ pushd "${S}" > /dev/null || die |
85 |
+ for subdir in *; do |
86 |
+ if ! has ${subdir} ${_pim_keep_subdir} ; then |
87 |
+ if [[ -d "${subdir}" ]] ; then |
88 |
+ einfo " ${subdir}" |
89 |
+ rm -r ${subdir} || die "Failed to remove ${subdir} application" |
90 |
+ cmake_comment_add_subdirectory ${subdir} |
91 |
+ fi |
92 |
+ fi |
93 |
+ done |
94 |
+ popd > /dev/null || die |
95 |
+ |
96 |
+ # disable build of kontactplugin in kdepim and split kdepim packages |
97 |
+ if ! use_if_iuse kontact ; then |
98 |
+ for x in $(find ./ -name CMakeLists.txt -exec grep -l "add_subdirectory.*kontactplugin" "{}" ";"); do |
99 |
+ einfo "Disabling kontactplugin in: ${x}" |
100 |
+ pushd $(dirname "${x}") > /dev/null || die |
101 |
+ cmake_comment_add_subdirectory kontactplugin |
102 |
+ popd > /dev/null || die |
103 |
+ done |
104 |
+ fi |
105 |
+ fi |
106 |
+ |
107 |
+ # only build select handbook |
108 |
+ if [[ ${KMNAME} = "kdepim" && $(basename "${S}") != ${PN} ]] ; then |
109 |
+ if use_if_iuse handbook && [[ -e doc/CMakeLists.txt ]] ; then |
110 |
+ echo "add_subdirectory(${PN})" > doc/CMakeLists.txt |
111 |
+ fi |
112 |
+ fi |
113 |
} |
114 |
|
115 |
# @FUNCTION: kde5_src_configure |