summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Seifert <soap@gentoo.org>2017-09-24 11:07:36 +0200
committerMichael Palimaka <kensington@gentoo.org>2017-09-24 21:15:08 +1000
commit954578a86a5652fa7356db9444f1527365f427f3 (patch)
treef0951d856964e83d7b563e3bb7d3a36c71543fb7
parent156f05d94939bfc31b0915977aa2400b41046114 (diff)
downloadkde-954578a86a5652fa7356db9444f1527365f427f3.tar.gz
kde-954578a86a5652fa7356db9444f1527365f427f3.tar.bz2
kde-954578a86a5652fa7356db9444f1527365f427f3.zip
cmake-utils.eclass: Add QA check for broken buildsystems
Closes: https://github.com/gentoo/gentoo/pull/4757
-rw-r--r--eclass/cmake-utils.eclass11
1 files changed, 11 insertions, 0 deletions
diff --git a/eclass/cmake-utils.eclass b/eclass/cmake-utils.eclass
index c6a52b8d9ae..148fbc3cff3 100644
--- a/eclass/cmake-utils.eclass
+++ b/eclass/cmake-utils.eclass
@@ -93,6 +93,12 @@ _CMAKE_UTILS_ECLASS=1
# for econf and is needed to pass TRY_RUN results when cross-compiling.
# Should be set by user in a per-package basis in /etc/portage/package.env.
+# @ECLASS-VARIABLE: CMAKE_UTILS_QA_SRC_DIR_READONLY
+# @DESCRIPTION:
+# After running cmake-utils_src_prepare, sets ${S} to read-only. This is
+# a user flag and should under _no circumstances_ be set in the ebuild.
+# Helps in improving QA of build systems that write to source tree.
+
case ${EAPI} in
5) : ${CMAKE_WARN_UNUSED_CLI:=no} ;;
6) : ${CMAKE_WARN_UNUSED_CLI:=yes} ;;
@@ -442,6 +448,11 @@ cmake-utils_src_prepare() {
popd > /dev/null || die
+ # make ${S} read-only in order to detect broken build-systems
+ if [[ ${CMAKE_UTILS_QA_SRC_DIR_READONLY} && ! ${CMAKE_IN_SOURCE_BUILD} ]]; then
+ chmod -R a-w "${S}"
+ fi
+
_CMAKE_UTILS_SRC_PREPARE_HAS_RUN=1
}