summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorManuel Rüger <mrueg@gentoo.org>2015-05-09 10:24:46 +0000
committerManuel Rüger <mrueg@gentoo.org>2015-05-09 10:24:46 +0000
commitdd76f044275ad9e016d712fb9973b4a9efa2d9da (patch)
tree8dd2aaf9cfac58b5509369f37ff6e39b80a244e8 /eclass
parentSync kde5.eclass with overlay. (diff)
downloadgentoo-2-dd76f044275ad9e016d712fb9973b4a9efa2d9da.tar.gz
gentoo-2-dd76f044275ad9e016d712fb9973b4a9efa2d9da.tar.bz2
gentoo-2-dd76f044275ad9e016d712fb9973b4a9efa2d9da.zip
Sync kde5-functions.eclass with overlay.
Diffstat (limited to 'eclass')
-rw-r--r--eclass/ChangeLog5
-rw-r--r--eclass/kde5-functions.eclass29
2 files changed, 28 insertions, 6 deletions
diff --git a/eclass/ChangeLog b/eclass/ChangeLog
index 2f5e33010027..e371dc3b102e 100644
--- a/eclass/ChangeLog
+++ b/eclass/ChangeLog
@@ -1,6 +1,9 @@
# ChangeLog for eclass directory
# Copyright 1999-2015 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.1604 2015/05/09 10:22:36 mrueg Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.1605 2015/05/09 10:24:46 mrueg Exp $
+
+ 09 May 2015; Manuel Rüger <mrueg@gentoo.org> kde5-functions.eclass:
+ Sync with overlay.
09 May 2015; Manuel Rüger <mrueg@gentoo.org> kde5.eclass:
Sync with overlay.
diff --git a/eclass/kde5-functions.eclass b/eclass/kde5-functions.eclass
index b0307765b954..58a7b6ebef00 100644
--- a/eclass/kde5-functions.eclass
+++ b/eclass/kde5-functions.eclass
@@ -1,6 +1,6 @@
# Copyright 1999-2015 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/kde5-functions.eclass,v 1.6 2015/04/11 17:11:22 kensington Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/kde5-functions.eclass,v 1.7 2015/05/09 10:24:46 mrueg Exp $
# @ECLASS: kde5-functions.eclass
# @MAINTAINER:
@@ -210,11 +210,30 @@ 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}"
+
+ # pcregrep returns non-zero on no matches/error
+ if [[ $? != 0 ]] ; then
+ return
+ fi
+
+ 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