From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 05DD51580B9 for ; Sat, 21 Aug 2021 13:11:37 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 34346E0867; Sat, 21 Aug 2021 13:11:36 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 15CACE0867 for ; Sat, 21 Aug 2021 13:11:36 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 438A8342A7B for ; Sat, 21 Aug 2021 13:11:34 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 3456F8BB for ; Sat, 21 Aug 2021 13:11:32 +0000 (UTC) From: "Andreas Sturmlechner" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Andreas Sturmlechner" Message-ID: <1629551411.40e9ac8f62c95c5d991148d8912422e8eaa8813d.asturm@gentoo> Subject: [gentoo-commits] proj/kde:master commit in: eclass/ X-VCS-Repository: proj/kde X-VCS-Files: eclass/cmake.eclass X-VCS-Directories: eclass/ X-VCS-Committer: asturm X-VCS-Committer-Name: Andreas Sturmlechner X-VCS-Revision: 40e9ac8f62c95c5d991148d8912422e8eaa8813d X-VCS-Branch: master Date: Sat, 21 Aug 2021 13:11:32 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 2be40b4a-8512-4f37-ba43-a2a8204ad910 X-Archives-Hash: e522dd2327c84c4dfbf679392497c3df commit: 40e9ac8f62c95c5d991148d8912422e8eaa8813d Author: Andreas Sturmlechner gentoo org> AuthorDate: Sun Jul 18 18:02:54 2021 +0000 Commit: Andreas Sturmlechner gentoo org> CommitDate: Sat Aug 21 13:10:11 2021 +0000 URL: https://gitweb.gentoo.org/proj/kde.git/commit/?id=40e9ac8f cmake.eclass: Enforce CMAKE_REMOVE_MODULES_LIST be an array Signed-off-by: Andreas Sturmlechner gentoo.org> eclass/cmake.eclass | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/eclass/cmake.eclass b/eclass/cmake.eclass index b78441bfaa..3c61107182 100644 --- a/eclass/cmake.eclass +++ b/eclass/cmake.eclass @@ -66,11 +66,23 @@ _CMAKE_ECLASS=1 : ${CMAKE_MAKEFILE_GENERATOR:=ninja} # @ECLASS-VARIABLE: CMAKE_REMOVE_MODULES_LIST +# @PRE_INHERIT +# @DEFAULT_UNSET # @DESCRIPTION: -# Space-separated list of CMake modules to be removed in ${CMAKE_USE_DIR} -# (in EAPI-7: ${S}) during src_prepare, in order to force packages to use the -# system version. Set to empty to disable removing modules entirely. -: ${CMAKE_REMOVE_MODULES_LIST:=FindBLAS FindLAPACK} +# Array of .cmake modules to be removed in ${CMAKE_USE_DIR} (in EAPI-7: ${S}) +# during src_prepare, in order to force packages to use the system version. +# By default, contains "FindBLAS" and "FindLAPACK". +# Set to empty to disable removing modules entirely. +if [[ ${CMAKE_REMOVE_MODULES_LIST} ]]; then + if [[ ${EAPI} != 7 ]]; then + [[ ${CMAKE_REMOVE_MODULES_LIST@a} == *a* ]] || + die "CMAKE_REMOVE_MODULES_LIST must be an array" + fi +else + if ! [[ ${CMAKE_REMOVE_MODULES_LIST@a} == *a* && ${#CMAKE_REMOVE_MODULES_LIST[@]} -eq 0 ]]; then + CMAKE_REMOVE_MODULES_LIST=( FindBLAS FindLAPACK ) + fi +fi # @ECLASS-VARIABLE: CMAKE_USE_DIR # @DESCRIPTION: @@ -355,10 +367,10 @@ cmake_src_prepare() { fi local modules_list - if [[ $(declare -p CMAKE_REMOVE_MODULES_LIST) == "declare -a"* ]]; then - modules_list=( "${CMAKE_REMOVE_MODULES_LIST[@]}" ) - else + if [[ ${EAPI} == 7 && $(declare -p CMAKE_REMOVE_MODULES_LIST) != "declare -a"* ]]; then modules_list=( ${CMAKE_REMOVE_MODULES_LIST} ) + else + modules_list=( "${CMAKE_REMOVE_MODULES_LIST[@]}" ) fi local name