Gentoo Archives: gentoo-commits

From: Andreas Sturmlechner <asturm@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: eclass/
Date: Thu, 03 May 2018 12:31:10
Message-Id: 1525350638.48b2a6a45db4ad2c4cee9ed0e406e90d6b89e7b3.asturm@gentoo
1 commit: 48b2a6a45db4ad2c4cee9ed0e406e90d6b89e7b3
2 Author: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
3 AuthorDate: Thu May 3 12:21:07 2018 +0000
4 Commit: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
5 CommitDate: Thu May 3 12:30:38 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=48b2a6a4
7
8 kde4-functions.eclass: Remove last-rited
9
10 Moved to kde-sunset repository.
11
12 Closes: https://bugs.gentoo.org/637772
13
14 eclass/kde4-functions.eclass | 431 -------------------------------------------
15 1 file changed, 431 deletions(-)
16
17 diff --git a/eclass/kde4-functions.eclass b/eclass/kde4-functions.eclass
18 deleted file mode 100644
19 index 98f972c3aca..00000000000
20 --- a/eclass/kde4-functions.eclass
21 +++ /dev/null
22 @@ -1,431 +0,0 @@
23 -# Copyright 1999-2016 Gentoo Foundation
24 -# Distributed under the terms of the GNU General Public License v2
25 -
26 -# @DEAD
27 -# Removal on 2018-05-03.
28 -# @ECLASS: kde4-functions.eclass
29 -# @MAINTAINER:
30 -# kde@g.o
31 -# @BLURB: Common ebuild functions for KDE 4 packages
32 -# @DESCRIPTION:
33 -# This eclass contains all functions shared by the different eclasses,
34 -# for KDE 4 ebuilds.
35 -
36 -if [[ -z ${_KDE4_FUNCTIONS_ECLASS} ]]; then
37 -_KDE4_FUNCTIONS_ECLASS=1
38 -
39 -inherit versionator
40 -
41 -# @ECLASS-VARIABLE: EAPI
42 -# @DESCRIPTION:
43 -# Currently kde4 eclasses support EAPI 5 and 6.
44 -case ${EAPI} in
45 - 5|6) : ;;
46 - *) die "EAPI=${EAPI:-0} is not supported" ;;
47 -esac
48 -
49 -# @ECLASS-VARIABLE: KDE_OVERRIDE_MINIMAL
50 -# @DESCRIPTION:
51 -# For use only in very few well-defined cases; normally it should be unset.
52 -# If this variable is set, all calls to add_kdebase_dep return a dependency on
53 -# at least this version, independent of the version of the package itself.
54 -# If you know exactly that one specific NEW KDE component builds and runs fine
55 -# with all the rest of KDE at an OLDER version, you can set this old version here.
56 -# Warning- may lead to general instability and kill your pet targh.
57 -
58 -# @ECLASS-VARIABLE: KDEBASE
59 -# @DESCRIPTION:
60 -# This gets set to a non-zero value when a package is considered a kde or
61 -# kdevelop ebuild.
62 -if [[ ${CATEGORY} = kde-base || ${CATEGORY} == kde-plasma || ${CATEGORY} = kde-apps || ${CATEGORY} = kde-frameworks ]]; then
63 - debug-print "${ECLASS}: KDEBASE ebuild recognized"
64 - KDEBASE=kde-base
65 -elif [[ ${KMNAME-${PN}} = kdevelop ]]; then
66 - KDEBASE=kdevelop
67 -fi
68 -
69 -debug-print "${ECLASS}: ${KDEBASE} ebuild recognized"
70 -
71 -# determine the build type
72 -if [[ ${PV} = *9999* ]]; then
73 - KDE_BUILD_TYPE="live"
74 -else
75 - KDE_BUILD_TYPE="release"
76 -fi
77 -export KDE_BUILD_TYPE
78 -
79 -# Set reponame and SCM for modules that have fully migrated to git
80 -# (hack - it's here because it needs to be before SCM inherits from kde4-base)
81 -if [[ ${KDE_BUILD_TYPE} == live ]]; then
82 - case "${KMNAME}" in
83 - kdebase-workspace)
84 - EGIT_REPONAME=${EGIT_REPONAME:=kde-workspace}
85 - ;;
86 - kdebase-runtime)
87 - EGIT_REPONAME=${EGIT_REPONAME:=kde-runtime}
88 - ;;
89 - esac
90 -fi
91 -
92 -# @ECLASS-VARIABLE: KDE_SCM
93 -# @DESCRIPTION:
94 -# If this is a live package which scm does it use
95 -# Everything else uses git by default
96 -KDE_SCM="${KDE_SCM:-git}"
97 -case ${KDE_SCM} in
98 - svn|git) ;;
99 - *) die "KDE_SCM: ${KDE_SCM} is not supported" ;;
100 -esac
101 -
102 -# @FUNCTION: kde4_lingua_to_l10n
103 -# @USAGE: <lingua>...
104 -# @INTERNAL
105 -# @DESCRIPTION:
106 -# Output l10n flag name(s) (without prefix(es)) appropriate for given KDE
107 -# locale(s).
108 -kde4_lingua_to_l10n() {
109 - local l
110 - for l; do
111 - case ${l} in
112 - ca@valencia) echo ca-valencia;;
113 - sr@ijekavian) echo sr-ijekavsk;;
114 - sr@ijekavianlatin) echo sr-Latn-ijekavsk;;
115 - sr@latin|sr@Latn) echo sr-Latn;;
116 - uz@cyrillic) echo uz-Cyrl;;
117 - *@*) die "${FUNCNAME}: Unhandled KDE_LINGUAS: ${l}";;
118 - *) echo "${l/_/-}";;
119 - esac
120 - done
121 -}
122 -
123 -# @ECLASS-VARIABLE: KDE_LINGUAS
124 -# @DESCRIPTION:
125 -# This is a whitespace-separated list of translations this ebuild supports.
126 -# These translations are automatically added to IUSE. Therefore ebuilds must set
127 -# this variable before inheriting any eclasses. To enable only selected
128 -# translations, ebuilds must call enable_selected_linguas(). kde4-{base,meta}.eclass does
129 -# this for you.
130 -#
131 -# Example: KDE_LINGUAS="de en_GB nl"
132 -if [[ ${KDE_BUILD_TYPE} != live || -n ${KDE_LINGUAS_LIVE_OVERRIDE} ]]; then
133 - for _lingua in $(kde4_lingua_to_l10n ${KDE_LINGUAS}); do
134 - IUSE="${IUSE} l10n_${_lingua}"
135 - done
136 -fi
137 -
138 -# @FUNCTION: buildsycoca
139 -# @DESCRIPTION:
140 -# Function to rebuild the KDE System Configuration Cache.
141 -# All KDE ebuilds should run this in pkg_postinst and pkg_postrm.
142 -buildsycoca() {
143 - debug-print-function ${FUNCNAME} "$@"
144 -
145 - # We no longer need to run kbuildsycoca4, as kded does that automatically, as needed
146 -
147 - # fix permission for some directories
148 - for x in usr/share/{config,kde4}; do
149 - DIRS=${EROOT}usr
150 - [[ -d "${EROOT}${x}" ]] || break # nothing to do if directory does not exist
151 - # fixes Bug 318237
152 - if use userland_BSD ; then
153 - [[ $(stat -f %p "${EROOT}${x}") != 40755 ]]
154 - local stat_rtn="$?"
155 - else
156 - [[ $(stat --format=%a "${EROOT}${x}") != 755 ]]
157 - local stat_rtn=$?
158 - fi
159 - if [[ $stat_rtn != 1 ]] ; then
160 - ewarn "QA Notice:"
161 - ewarn "Package ${PN} is breaking ${EROOT}${x} permissions."
162 - ewarn "Please report this issue to gentoo bugzilla."
163 - einfo "Permissions will get adjusted automatically now."
164 - find "${EROOT}${x}" -type d -print0 | xargs -0 chmod 755
165 - fi
166 - done
167 -}
168 -
169 -# @FUNCTION: comment_all_add_subdirectory
170 -# @USAGE: [list of directory names]
171 -# @DESCRIPTION:
172 -# Recursively comment all add_subdirectory instructions in listed directories,
173 -# except those in cmake/.
174 -comment_all_add_subdirectory() {
175 - find "$@" -name CMakeLists.txt -print0 | grep -vFzZ "./cmake" | \
176 - xargs -0 sed -i \
177 - -e '/^[[:space:]]*add_subdirectory/s/^/#DONOTCOMPILE /' \
178 - -e '/^[[:space:]]*ADD_SUBDIRECTORY/s/^/#DONOTCOMPILE /' \
179 - -e '/^[[:space:]]*macro_optional_add_subdirectory/s/^/#DONOTCOMPILE /' \
180 - -e '/^[[:space:]]*MACRO_OPTIONAL_ADD_SUBDIRECTORY/s/^/#DONOTCOMPILE /' \
181 - || die "${LINENO}: Initial sed died"
182 -}
183 -
184 -# @FUNCTION: enable_selected_linguas
185 -# @DESCRIPTION:
186 -# Enable translations based on L10N settings and translations supported by
187 -# the package (see KDE_LINGUAS). By default, translations are found in "${S}"/po
188 -# but this default can be overridden by defining KDE_LINGUAS_DIR.
189 -enable_selected_linguas() {
190 - debug-print-function ${FUNCNAME} "$@"
191 -
192 - local x
193 -
194 - # @ECLASS-VARIABLE: KDE_LINGUAS_DIR
195 - # @DESCRIPTION:
196 - # Specified folder where application translations are located.
197 - # Can be defined as array of folders where translations are located.
198 - # Note that space separated list of dirs is not supported.
199 - # Default value is set to "po".
200 - if [[ "$(declare -p KDE_LINGUAS_DIR 2>/dev/null 2>&1)" == "declare -a"* ]]; then
201 - debug-print "$FUNCNAME: we have these subfolders defined: ${KDE_LINGUAS_DIR}"
202 - for x in ${KDE_LINGUAS_DIR[@]}; do
203 - _enable_selected_linguas_dir ${x}
204 - done
205 - else
206 - KDE_LINGUAS_DIR=${KDE_LINGUAS_DIR:="po"}
207 - _enable_selected_linguas_dir ${KDE_LINGUAS_DIR}
208 - fi
209 -}
210 -
211 -# @FUNCTION: enable_selected_doc_linguas
212 -# @DESCRIPTION:
213 -# Enable only selected L10N enabled doc folders.
214 -enable_selected_doc_linguas() {
215 - debug-print-function ${FUNCNAME} "$@"
216 -
217 - # @ECLASS-VARIABLE: KDE_DOC_DIRS
218 - # @DESCRIPTION:
219 - # Variable specifying whitespace separated patterns for documentation locations.
220 - # Default is "doc/%lingua"
221 - KDE_DOC_DIRS=${KDE_DOC_DIRS:='doc/%lingua'}
222 - local linguas
223 - for pattern in ${KDE_DOC_DIRS}; do
224 -
225 - local handbookdir=`dirname ${pattern}`
226 - local translationdir=`basename ${pattern}`
227 - # Do filename pattern supplied, treat as directory
228 - [[ ${handbookdir} = '.' ]] && handbookdir=${translationdir} && translationdir=
229 - [[ -d ${handbookdir} ]] || die 'wrong doc dir specified'
230 -
231 - if ! use handbook; then
232 - # Disable whole directory
233 - sed -e "/add_subdirectory[[:space:]]*([[:space:]]*${handbookdir}[[:space:]]*)/s/^/#DONOTCOMPILE /" \
234 - -e "/ADD_SUBDIRECTORY[[:space:]]*([[:space:]]*${handbookdir}[[:space:]]*)/s/^/#DONOTCOMPILE /" \
235 - -i CMakeLists.txt || die 'failed to comment out all handbooks'
236 - else
237 - # Disable subdirectories recursively
238 - comment_all_add_subdirectory "${handbookdir}"
239 -
240 - # In certain packages, the default handbook is en_US instead of the usual en. Since there is no en_US 'translation',
241 - # it makes no sense to add to KDE_LINGUAS which causes this type of handbook to not be installed.
242 - if [[ -d "${handbookdir}/en_US" && ! -d "${handbookdir}/en" ]]; then
243 - mv "${handbookdir}/en_US" "${handbookdir}/en" || die
244 - sed -e "s/en_US/en/" -i "${handbookdir}/CMakeLists.txt"
245 - fi
246 -
247 - # Add requested translations
248 - local lingua
249 - for lingua in en ${KDE_LINGUAS}; do
250 - if [[ ${lingua} = en ]] || use "l10n_$(kde4_lingua_to_l10n "${lingua}")"; then
251 - if [[ -d ${handbookdir}/${translationdir//%lingua/${lingua}} ]]; then
252 - sed -e "/add_subdirectory[[:space:]]*([[:space:]]*${translationdir//%lingua/${lingua}}/s/^#DONOTCOMPILE //" \
253 - -e "/ADD_SUBDIRECTORY[[:space:]]*([[:space:]]*${translationdir//%lingua/${lingua}}/s/^#DONOTCOMPILE //" \
254 - -i "${handbookdir}"/CMakeLists.txt && ! has ${lingua} ${linguas} && linguas="${linguas} ${lingua}"
255 - fi
256 - fi
257 - done
258 - fi
259 -
260 - done
261 - [[ -n "${linguas}" ]] && einfo "Enabling handbook translations:${linguas}"
262 -}
263 -
264 -# Functions handling KMLOADLIBS and KMSAVELIBS
265 -
266 -# @FUNCTION: save_library_dependencies
267 -# @DESCRIPTION:
268 -# Add exporting CMake dependencies for current package
269 -save_library_dependencies() {
270 - local depsfile="${T}/${PN}"
271 -
272 - ebegin "Saving library dependencies in ${depsfile##*/}"
273 - echo "EXPORT_LIBRARY_DEPENDENCIES(\"${depsfile}\")" >> "${S}/CMakeLists.txt" || \
274 - die "Failed to save the library dependencies."
275 - eend $?
276 -}
277 -
278 -# @FUNCTION: install_library_dependencies
279 -# @DESCRIPTION:
280 -# Install generated CMake library dependencies to /var/lib/kde
281 -install_library_dependencies() {
282 - local depsfile="${T}/${PN}"
283 -
284 - ebegin "Installing library dependencies as ${depsfile##*/}"
285 - insinto /var/lib/kde
286 - doins "${depsfile}" || die "Failed to install library dependencies."
287 - eend $?
288 -}
289 -
290 -# @FUNCTION: load_library_dependencies
291 -# @DESCRIPTION:
292 -# Inject specified library dependencies in current package
293 -load_library_dependencies() {
294 - local pn i depsfile
295 - ebegin "Injecting library dependencies from '${KMLOADLIBS}'"
296 -
297 - i=0
298 - for pn in ${KMLOADLIBS} ; do
299 - ((i++))
300 - depsfile="${EPREFIX}/var/lib/kde/${pn}"
301 - [[ -r ${depsfile} ]] || depsfile="${EPREFIX}/var/lib/kde/${pn}:$(get_kde_version)"
302 - [[ -r ${depsfile} ]] || die "Depsfile '${depsfile}' not accessible. You probably need to reinstall ${pn}."
303 - sed -i -e "${i}iINCLUDE(\"${depsfile}\")" "${S}/CMakeLists.txt" || \
304 - die "Failed to include library dependencies for ${pn}"
305 - done
306 - eend $?
307 -}
308 -
309 -# @FUNCTION: add_kdeapps_dep
310 -# @DESCRIPTION:
311 -# Create proper dependency for kde-apps/ dependencies.
312 -# This takes 1 to 3 arguments. The first being the package name, the optional
313 -# second is additional USE flags to append, and the optional third is the
314 -# version to use instead of the automatic version (use sparingly).
315 -# The output of this should be added directly to DEPEND/RDEPEND, and may be
316 -# wrapped in a USE conditional (but not an || conditional without an extra set
317 -# of parentheses).
318 -add_kdeapps_dep() {
319 - debug-print-function ${FUNCNAME} "$@"
320 -
321 - local ver
322 -
323 - if [[ -n ${2} ]] ; then
324 - local use="[${2}]"
325 - fi
326 -
327 - if [[ -n ${3} ]]; then
328 - ver=${3}
329 - elif [[ -n ${KDE_OVERRIDE_MINIMAL} ]]; then
330 - ver=${KDE_OVERRIDE_MINIMAL}
331 - elif [[ ${KDEBASE} != kde-base ]]; then
332 - ver=${KDE_MINIMAL}
333 - # if building kde-apps, live master or stable-live branch,
334 - # use the final SC version since there are no further general releases.
335 - # except when it is kdepim split packages, which rely on same-version deps
336 - elif [[ ${CATEGORY} == kde-apps || ${PV} == *9999 ]] && [[ ${KMNAME} != "kdepim" ]]; then
337 - ver=4.14.3
338 - else
339 - ver=${PV}
340 - fi
341 -
342 - [[ -z ${1} ]] && die "Missing parameter"
343 -
344 - echo " >=kde-apps/${1}-${ver}:4${use}"
345 -}
346 -
347 -# @FUNCTION: add_kdebase_dep
348 -# @DESCRIPTION:
349 -# Create proper dependency for kde-base/ dependencies.
350 -# This takes 1 to 3 arguments. The first being the package name, the optional
351 -# second is additional USE flags to append, and the optional third is the
352 -# version to use instead of the automatic version (use sparingly).
353 -# The output of this should be added directly to DEPEND/RDEPEND, and may be
354 -# wrapped in a USE conditional (but not an || conditional without an extra set
355 -# of parentheses).
356 -add_kdebase_dep() {
357 - debug-print-function ${FUNCNAME} "$@"
358 -
359 - local ver
360 -
361 - if [[ -n ${2} ]] ; then
362 - local use="[${2}]"
363 - fi
364 -
365 - if [[ -n ${3} ]]; then
366 - ver=${3}
367 - elif [[ -n ${KDE_OVERRIDE_MINIMAL} ]]; then
368 - ver=${KDE_OVERRIDE_MINIMAL}
369 - elif [[ ${KDEBASE} != kde-base ]]; then
370 - ver=${KDE_MINIMAL}
371 - # if building live master or kde-apps, use the final SC version
372 - # since there are no further general releases.
373 - elif [[ ${CATEGORY} == kde-apps || ${PV} == 9999 ]]; then
374 - ver=4.14.3
375 - # if building a live version branch (eg. 4.11.49.9999) use the major version
376 - elif [[ ${PV} == *.9999 ]]; then
377 - ver=$(get_kde_version)
378 - else
379 - ver=${PV}
380 - fi
381 -
382 - [[ -z ${1} ]] && die "Missing parameter"
383 -
384 - echo " >=kde-base/${1}-${ver}:4${use}"
385 -}
386 -
387 -# local function to enable specified translations for specified directory
388 -# used from kde4-functions_enable_selected_linguas function
389 -_enable_selected_linguas_dir() {
390 - local lingua linguas sr_mess wp
391 - local dir=${1}
392 -
393 - [[ -d ${dir} ]] || die "linguas dir \"${dir}\" does not exist"
394 - comment_all_add_subdirectory "${dir}"
395 - pushd "${dir}" > /dev/null || die
396 -
397 - # fix all various crazy sr@Latn variations
398 - # this part is only ease for ebuilds, so there wont be any die when this
399 - # fail at any point
400 - sr_mess="sr@latn sr@latin sr@Latin"
401 - for wp in ${sr_mess}; do
402 - [[ -e ${wp}.po ]] && mv "${wp}.po" "sr@××××.po"
403 - if [[ -d ${wp} ]]; then
404 - # move dir and fix cmakelists
405 - mv "${wp}" "sr@Latn"
406 - sed -i \
407 - -e "s:${wp}:sr@Latn:g" \
408 - CMakeLists.txt
409 - fi
410 - done
411 -
412 - for lingua in ${KDE_LINGUAS}; do
413 - if [[ -e ${lingua}.po ]]; then
414 - mv "${lingua}.po" "${lingua}.po.old"
415 - fi
416 - done
417 -
418 - for lingua in ${KDE_LINGUAS}; do
419 - if use "l10n_$(kde4_lingua_to_l10n ${lingua})" ; then
420 - if [[ -d ${lingua} ]]; then
421 - linguas="${linguas} ${lingua}"
422 - sed -e "/add_subdirectory([[:space:]]*${lingua}[[:space:]]*)[[:space:]]*$/ s/^#DONOTCOMPILE //" \
423 - -e "/ADD_SUBDIRECTORY([[:space:]]*${lingua}[[:space:]]*)[[:space:]]*$/ s/^#DONOTCOMPILE //" \
424 - -i CMakeLists.txt || die "Sed to uncomment linguas_${lingua} failed."
425 - fi
426 - if [[ -e ${lingua}.po.old ]]; then
427 - linguas="${linguas} ${lingua}"
428 - mv "${lingua}.po.old" "${lingua}.po"
429 - fi
430 - fi
431 - done
432 - [[ -n ${linguas} ]] && echo ">>> Enabling languages: ${linguas}"
433 -
434 - popd > /dev/null || die
435 -}
436 -
437 -# @FUNCTION: get_kde_version
438 -# @DESCRIPTION:
439 -# Translates an ebuild version into a major.minor KDE SC
440 -# release version. If no version is specified, ${PV} is used.
441 -get_kde_version() {
442 - local ver=${1:-${PV}}
443 - local major=$(get_major_version ${ver})
444 - local minor=$(get_version_component_range 2 ${ver})
445 - local micro=$(get_version_component_range 3 ${ver})
446 - if [[ ${ver} == 9999 ]]; then
447 - echo live
448 - else
449 - (( micro < 50 )) && echo ${major}.${minor} || echo ${major}.$((minor + 1))
450 - fi
451 -}
452 -
453 -fi