1 |
zlin 08/04/04 22:15:24 |
2 |
|
3 |
Modified: kde4-base.eclass kde4-functions.eclass |
4 |
Log: |
5 |
Add support for making PATCHES an array for proper quoting. Add KDE_LINGUAS support to kde4-functions.eclass and use it in kde4-base.eclass in the unpack phase. |
6 |
|
7 |
Revision Changes Path |
8 |
1.8 eclass/kde4-base.eclass |
9 |
|
10 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/kde4-base.eclass?rev=1.8&view=markup |
11 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/kde4-base.eclass?rev=1.8&content-type=text/plain |
12 |
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/kde4-base.eclass?r1=1.7&r2=1.8 |
13 |
|
14 |
Index: kde4-base.eclass |
15 |
=================================================================== |
16 |
RCS file: /var/cvsroot/gentoo-x86/eclass/kde4-base.eclass,v |
17 |
retrieving revision 1.7 |
18 |
retrieving revision 1.8 |
19 |
diff -u -r1.7 -r1.8 |
20 |
--- kde4-base.eclass 3 Apr 2008 18:12:48 -0000 1.7 |
21 |
+++ kde4-base.eclass 4 Apr 2008 22:15:24 -0000 1.8 |
22 |
@@ -1,6 +1,6 @@ |
23 |
# Copyright 2007-2008 Gentoo Foundation |
24 |
# Distributed under the terms of the GNU General Public License v2 |
25 |
-# $Header: /var/cvsroot/gentoo-x86/eclass/kde4-base.eclass,v 1.7 2008/04/03 18:12:48 philantrop Exp $ |
26 |
+# $Header: /var/cvsroot/gentoo-x86/eclass/kde4-base.eclass,v 1.8 2008/04/04 22:15:24 zlin Exp $ |
27 |
|
28 |
# @ECLASS: kde4-base.eclass |
29 |
# @MAINTAINER: |
30 |
@@ -350,7 +350,8 @@ |
31 |
# Apply ${PN}-${PV}-*{diff,patch} |
32 |
# @CODE |
33 |
# |
34 |
-# If ${PATCHES} is non-zero all patches in it gets applied. |
35 |
+# If ${PATCHES} is non-zero all patches in it get applied. If there is more |
36 |
+# than one patch please make ${PATCHES} an array for proper quoting. |
37 |
kde4-base_apply_patches() { |
38 |
local _patchdir _packages _p |
39 |
_patchdir="${WORKDIR}/patches/" |
40 |
@@ -361,14 +362,23 @@ |
41 |
else |
42 |
_packages="${PN}" |
43 |
fi |
44 |
- for _p in ${_packages}; do |
45 |
- PATCHES="${PATCHES} $(ls ${_patchdir}/${_p}-${PV}-*{diff,patch} 2>/dev/null)" |
46 |
- if [[ -n "${KDEBASE}" ]]; then |
47 |
- PATCHES="${PATCHES} $(ls ${_patchdir}/${_p}-${SLOT}-*{diff,patch} 2>/dev/null)" |
48 |
- fi |
49 |
- done |
50 |
+ if [[ ${#PATCHES[@]} -gt 1 ]]; then |
51 |
+ for _p in ${_packages}; do |
52 |
+ PATCHES=( "${PATCHES[@]}" $(ls ${_patchdir}/${_p}-${PV}-*{diff,patch} 2>/dev/null) ) |
53 |
+ if [[ -n "${KDEBASE}" ]]; then |
54 |
+ PATCHES=( "${PATCHES[@]}" $(ls ${_patchdir}/${_p}-${SLOT}-*{diff,patch} 2>/dev/null) ) |
55 |
+ fi |
56 |
+ done |
57 |
+ else |
58 |
+ for _p in ${_packages}; do |
59 |
+ PATCHES="${PATCHES} $(ls ${_patchdir}/${_p}-${PV}-*{diff,patch} 2>/dev/null)" |
60 |
+ if [[ -n "${KDEBASE}" ]]; then |
61 |
+ PATCHES="${PATCHES} $(ls ${_patchdir}/${_p}-${SLOT}-*{diff,patch} 2>/dev/null)" |
62 |
+ fi |
63 |
+ done |
64 |
+ fi |
65 |
fi |
66 |
- [[ -n ${PATCHES} ]] && base_src_unpack autopatch |
67 |
+ [[ -n ${PATCHES[@]} ]] && base_src_unpack autopatch |
68 |
} |
69 |
|
70 |
# @FUNCTION: kde4-base_src_unpack |
71 |
@@ -380,6 +390,9 @@ |
72 |
# |
73 |
# In addition it calls kde4-base_apply_patches when no arguments are passed to |
74 |
# this function. |
75 |
+# |
76 |
+# It also handles translations if KDE_LINGUAS is defined. See KDE_LINGUAS and |
77 |
+# enable_selected_linguas() in kde4-functions.eclass(5) for further details. |
78 |
kde4-base_src_unpack() { |
79 |
debug-print-function $FUNCNAME "$@" |
80 |
|
81 |
@@ -404,6 +417,11 @@ |
82 |
ln -s "${WORKDIR}/cmake" "${KDE_S}/cmake" || die "Unable to symlink the new cmake/ directory" |
83 |
eend 0 |
84 |
fi |
85 |
+ |
86 |
+ # Only enable selected languages, used for KDE extragear apps. |
87 |
+ if [[ -n ${KDE_LINGUAS} ]]; then |
88 |
+ enable_selected_linguas |
89 |
+ fi |
90 |
} |
91 |
|
92 |
# @FUNCTION: kde4-base_src_compile |
93 |
|
94 |
|
95 |
|
96 |
1.5 eclass/kde4-functions.eclass |
97 |
|
98 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/kde4-functions.eclass?rev=1.5&view=markup |
99 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/kde4-functions.eclass?rev=1.5&content-type=text/plain |
100 |
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/kde4-functions.eclass?r1=1.4&r2=1.5 |
101 |
|
102 |
Index: kde4-functions.eclass |
103 |
=================================================================== |
104 |
RCS file: /var/cvsroot/gentoo-x86/eclass/kde4-functions.eclass,v |
105 |
retrieving revision 1.4 |
106 |
retrieving revision 1.5 |
107 |
diff -u -r1.4 -r1.5 |
108 |
--- kde4-functions.eclass 13 Mar 2008 17:57:51 -0000 1.4 |
109 |
+++ kde4-functions.eclass 4 Apr 2008 22:15:24 -0000 1.5 |
110 |
@@ -1,6 +1,6 @@ |
111 |
# Copyright 1999-2008 Gentoo Foundation |
112 |
# Distributed under the terms of the GNU General Public License v2 |
113 |
-# $Header: /var/cvsroot/gentoo-x86/eclass/kde4-functions.eclass,v 1.4 2008/03/13 17:57:51 ingmar Exp $ |
114 |
+# $Header: /var/cvsroot/gentoo-x86/eclass/kde4-functions.eclass,v 1.5 2008/04/04 22:15:24 zlin Exp $ |
115 |
|
116 |
# @ECLASS: kde4-functions.eclass |
117 |
# @MAINTAINER: |
118 |
@@ -401,6 +401,35 @@ |
119 |
die "${LINENO}: Initial sed died" |
120 |
} |
121 |
|
122 |
+# @ECLASS-VARIABLE: KDE_LINGUAS |
123 |
+# @DESCRIPTION: |
124 |
+# This is a whitespace-separated list of translations that this ebuild supports. |
125 |
+# These translations automatically get added to IUSE. Therefore ebuilds must set |
126 |
+# this variable before inheriting any eclasses. To only enable selected |
127 |
+# translations ebuilds must call enable_selected_linguas(). kde4-base.eclass does |
128 |
+# this for you. |
129 |
+# |
130 |
+# Example: KDE_LINGUAS="en_GB de nl" |
131 |
+for _lingua in ${KDE_LINGUAS}; do |
132 |
+ IUSE="${IUSE} linguas_${_lingua}" |
133 |
+done |
134 |
+ |
135 |
+# @FUNCTION: enable_selected_linguas |
136 |
+# @DESCRIPTION: |
137 |
+# Enable translations based on LINGUAS settings and what translations are |
138 |
+# supported (see KDE_LINGUAS). By default translations are found in "${S}"/po |
139 |
+# but this default can be overridden by defining KDE_LINGUAS_DIR. |
140 |
+enable_selected_linguas() { |
141 |
+ local lingua |
142 |
+ comment_all_add_subdirectory "${KDE_LINGUAS_DIR:-${S}/po}" |
143 |
+ for lingua in ${KDE_LINGUAS}; do |
144 |
+ if use linguas_${lingua}; then |
145 |
+ sed -e "/add_subdirectory(\s*${lingua}\s*)\s*$/ s/^#DONOTCOMPILE //" \ |
146 |
+ -i "${KDE_LINGUAS_DIR:-${S}/po}"/CMakeLists.txt || die "Sed to uncomment linguas_${lingua} failed." |
147 |
+ fi |
148 |
+ done |
149 |
+} |
150 |
+ |
151 |
# @ECLASS-VARIABLE: QT4_BUILT_WITH_USE_CHECK |
152 |
# @DESCRIPTION: |
153 |
# A list of USE flags that x11-libs/qt:4 needs to be built with. |
154 |
|
155 |
|
156 |
|
157 |
-- |
158 |
gentoo-commits@l.g.o mailing list |