diff options
| author | Michael Palimaka <kensington@gentoo.org> | 2015-04-17 02:43:31 +1000 |
|---|---|---|
| committer | Michael Palimaka <kensington@gentoo.org> | 2015-04-17 02:47:26 +1000 |
| commit | 9633b33624bebab51dcd521b28dca614880e198f (patch) | |
| tree | 1c8d35ffc168a72dfec3f980d2e8abd9a6bbcf2c /eclass/kde5-functions.eclass | |
| parent | 1e72df927b303c317979589c33b09e2d25c66ab5 (diff) | |
| download | kde-9633b33624bebab51dcd521b28dca614880e198f.tar.gz kde-9633b33624bebab51dcd521b28dca614880e198f.tar.bz2 kde-9633b33624bebab51dcd521b28dca614880e198f.zip | |
[eclass] Introduce KDE_PUNT_BOGUS_DEPS to control the new black magic.
Diffstat (limited to 'eclass/kde5-functions.eclass')
| -rw-r--r-- | eclass/kde5-functions.eclass | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/eclass/kde5-functions.eclass b/eclass/kde5-functions.eclass index 648dff05e3e..d618368d7f0 100644 --- a/eclass/kde5-functions.eclass +++ b/eclass/kde5-functions.eclass @@ -210,11 +210,24 @@ get_kde_version() { fi } -# @FUNCTION: punt_bogus_deps +# @FUNCTION: punt_bogus_dep +# @USAGE: <prefix> <dependency> # @DESCRIPTION: -# Remove hard-coded upstream dependencies that are not correct. -punt_bogus_deps() { - sed -e "/find_package(Qt5 /s/ Test//" -i CMakeLists.txt || die +# Removes a specified dependency from a find_package call with multiple components. +punt_bogus_dep() { + local prefix=${1} + local dep=${2} + + pcregrep -Mn "(?s)find_package\(\s*${prefix}.[^)]*?${dep}.*?\)" CMakeLists.txt > "${T}/bogus${dep}" + local length=$(wc -l "${T}/bogus${dep}" | cut -d " " -f 1) + local first=$(head -n 1 "${T}/bogus${dep}" | cut -d ":" -f 1) + local last=$(( ${length} + ${first} - 1)) + + sed -e "${first},${last}s/${dep}//" -i CMakeLists.txt || die + + if [[ ${length} = 1 ]] ; then + sed -e "/find_package(\s*${prefix}\s*REQUIRED\s*COMPONENTS\s*)/d" -i CMakeLists.txt || die + fi } fi |
