public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] [PATCH 00/15] EAPI 6 support for cmake-utils.eclas
@ 2016-01-20 10:42 Michael Palimaka
  2016-01-20 10:42 ` [gentoo-dev] [PATCH 01/15] cmake-utils.eclass: reorder a bit Michael Palimaka
                   ` (14 more replies)
  0 siblings, 15 replies; 22+ messages in thread
From: Michael Palimaka @ 2016-01-20 10:42 UTC (permalink / raw
  To: gentoo-dev; +Cc: Michael Palimaka

To follow is a series of patches to enable EAPI 6 support in cmake-utils.eclass
and some other general cleanups.

Michael Palimaka (14):
  cmake-utils.eclass: reorder a bit
  cmake-utils.eclass: declare some variables local
  cmake-utils.eclass: use a proper if statement
  cmake-utils.eclass: remove duplicate CMAKE_REMOVE_MODULES
  cmake-utils.eclass: ban WANT_CMAKE in EAPI 6 and later
  cmake-utils.eclass: replace replace comment_add_subdirectory with a
    namespaced version
  cmake-utils.eclass: namespace some private functions
  cmake-utils.eclass: move $S modifications to src_prepare in EAPI 6 and
    later
  cmake-utils.eclass: ban non-array usage of mycmakeargs in EAPI 6 and
    later
  cmake-utils.eclass: use default_src_prepare in EAPI 6 and later
  cmake-utils.eclass: require two arguments for
    cmake-utils_use_find_package in EAPI 6 and later
  cmake-utils.eclass: ban helper functions in EAPI 6 and later
  cmake-utils.eclass: enable EAPI 6
  cmake-utils.eclass: update copyright year

Nikoli (1):
  cmake-utils.eclass: check exit codes of executed commands

 eclass/cmake-utils.eclass | 189 +++++++++++++++++++++++++++++-----------------
 1 file changed, 119 insertions(+), 70 deletions(-)

-- 
2.4.10



^ permalink raw reply	[flat|nested] 22+ messages in thread

* [gentoo-dev] [PATCH 01/15] cmake-utils.eclass: reorder a bit
  2016-01-20 10:42 [gentoo-dev] [PATCH 00/15] EAPI 6 support for cmake-utils.eclas Michael Palimaka
@ 2016-01-20 10:42 ` Michael Palimaka
  2016-01-20 10:43 ` [gentoo-dev] [PATCH 02/15] cmake-utils.eclass: declare some variables local Michael Palimaka
                   ` (13 subsequent siblings)
  14 siblings, 0 replies; 22+ messages in thread
From: Michael Palimaka @ 2016-01-20 10:42 UTC (permalink / raw
  To: gentoo-dev; +Cc: Michael Palimaka

---
 eclass/cmake-utils.eclass | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/eclass/cmake-utils.eclass b/eclass/cmake-utils.eclass
index fd53b3a..cc4c06b 100644
--- a/eclass/cmake-utils.eclass
+++ b/eclass/cmake-utils.eclass
@@ -112,6 +112,15 @@ CMAKE_REMOVE_MODULES="${CMAKE_REMOVE_MODULES:-yes}"
 # 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.
 
+case ${EAPI} in
+	2|3|4|5) : ;;
+	*) die "EAPI=${EAPI:-0} is not supported" ;;
+esac
+
+inherit toolchain-funcs multilib flag-o-matic eutils versionator
+
+EXPORT_FUNCTIONS src_prepare src_configure src_compile src_test src_install
+
 CMAKEDEPEND=""
 case ${WANT_CMAKE} in
 	always)
@@ -121,14 +130,6 @@ case ${WANT_CMAKE} in
 		CMAKEDEPEND+="${WANT_CMAKE}? ( "
 		;;
 esac
-inherit toolchain-funcs multilib flag-o-matic eutils versionator
-
-case ${EAPI} in
-	2|3|4|5) : ;;
-	*) die "EAPI=${EAPI:-0} is not supported" ;;
-esac
-
-EXPORT_FUNCTIONS src_prepare src_configure src_compile src_test src_install
 
 case ${CMAKE_MAKEFILE_GENERATOR} in
 	emake)
-- 
2.4.10



^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [gentoo-dev] [PATCH 02/15] cmake-utils.eclass: declare some variables local
  2016-01-20 10:42 [gentoo-dev] [PATCH 00/15] EAPI 6 support for cmake-utils.eclas Michael Palimaka
  2016-01-20 10:42 ` [gentoo-dev] [PATCH 01/15] cmake-utils.eclass: reorder a bit Michael Palimaka
@ 2016-01-20 10:43 ` Michael Palimaka
  2016-01-20 10:43 ` [gentoo-dev] [PATCH 03/15] cmake-utils.eclass: check exit codes of executed commands Michael Palimaka
                   ` (12 subsequent siblings)
  14 siblings, 0 replies; 22+ messages in thread
From: Michael Palimaka @ 2016-01-20 10:43 UTC (permalink / raw
  To: gentoo-dev; +Cc: Michael Palimaka

Prevents them from spanning multilibs.

Gentoo-bug: 513170
---
 eclass/cmake-utils.eclass | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/eclass/cmake-utils.eclass b/eclass/cmake-utils.eclass
index cc4c06b..f361bc7 100644
--- a/eclass/cmake-utils.eclass
+++ b/eclass/cmake-utils.eclass
@@ -449,7 +449,7 @@ enable_cmake-utils_src_configure() {
 	_modify-cmakelists
 
 	# Fix xdg collision with sandbox
-	export XDG_CONFIG_HOME="${T}"
+	local -x XDG_CONFIG_HOME="${T}"
 
 	# @SEE CMAKE_BUILD_TYPE
 	if [[ ${CMAKE_BUILD_TYPE} = Gentoo ]]; then
@@ -520,7 +520,7 @@ enable_cmake-utils_src_configure() {
 		fi
 	fi
 
-	has "${EAPI:-0}" 0 1 2 && ! use prefix && EPREFIX=
+	has "${EAPI:-0}" 0 1 2 && ! use prefix && local EPREFIX=
 
 	if [[ ${EPREFIX} ]]; then
 		cat >> "${build_rules}" <<- _EOF_ || die
-- 
2.4.10



^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [gentoo-dev] [PATCH 03/15] cmake-utils.eclass: check exit codes of executed commands
  2016-01-20 10:42 [gentoo-dev] [PATCH 00/15] EAPI 6 support for cmake-utils.eclas Michael Palimaka
  2016-01-20 10:42 ` [gentoo-dev] [PATCH 01/15] cmake-utils.eclass: reorder a bit Michael Palimaka
  2016-01-20 10:43 ` [gentoo-dev] [PATCH 02/15] cmake-utils.eclass: declare some variables local Michael Palimaka
@ 2016-01-20 10:43 ` Michael Palimaka
  2016-01-20 10:43 ` [gentoo-dev] [PATCH 04/15] cmake-utils.eclass: use a proper if statement Michael Palimaka
                   ` (11 subsequent siblings)
  14 siblings, 0 replies; 22+ messages in thread
From: Michael Palimaka @ 2016-01-20 10:43 UTC (permalink / raw
  To: gentoo-dev; +Cc: Nikoli

From: Nikoli <nikoli@gmx.us>

Gentoo-bug: 544966
---
 eclass/cmake-utils.eclass | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/eclass/cmake-utils.eclass b/eclass/cmake-utils.eclass
index f361bc7..fb80b13 100644
--- a/eclass/cmake-utils.eclass
+++ b/eclass/cmake-utils.eclass
@@ -219,7 +219,7 @@ _check_build_dir() {
 	# Backwards compatibility for getting the value.
 	CMAKE_BUILD_DIR=${BUILD_DIR}
 
-	mkdir -p "${BUILD_DIR}"
+	mkdir -p "${BUILD_DIR}" || die
 	echo ">>> Working in BUILD_DIR: \"$BUILD_DIR\""
 }
 
@@ -431,7 +431,7 @@ enable_cmake-utils_src_configure() {
 	[[ "${CMAKE_REMOVE_MODULES}" == "yes" ]] && {
 		local name
 		for name in ${CMAKE_REMOVE_MODULES_LIST} ; do
-			find "${S}" -name ${name}.cmake -exec rm -v {} +
+			find "${S}" -name ${name}.cmake -exec rm -v {} + || die
 		done
 	}
 
-- 
2.4.10



^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [gentoo-dev] [PATCH 04/15] cmake-utils.eclass: use a proper if statement
  2016-01-20 10:42 [gentoo-dev] [PATCH 00/15] EAPI 6 support for cmake-utils.eclas Michael Palimaka
                   ` (2 preceding siblings ...)
  2016-01-20 10:43 ` [gentoo-dev] [PATCH 03/15] cmake-utils.eclass: check exit codes of executed commands Michael Palimaka
@ 2016-01-20 10:43 ` Michael Palimaka
  2016-01-20 10:43 ` [gentoo-dev] [PATCH 05/15] cmake-utils.eclass: remove duplicate CMAKE_REMOVE_MODULES Michael Palimaka
                   ` (10 subsequent siblings)
  14 siblings, 0 replies; 22+ messages in thread
From: Michael Palimaka @ 2016-01-20 10:43 UTC (permalink / raw
  To: gentoo-dev; +Cc: Michael Palimaka

---
 eclass/cmake-utils.eclass | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/eclass/cmake-utils.eclass b/eclass/cmake-utils.eclass
index fb80b13..b2e13a1 100644
--- a/eclass/cmake-utils.eclass
+++ b/eclass/cmake-utils.eclass
@@ -428,12 +428,12 @@ enable_cmake-utils_src_prepare() {
 enable_cmake-utils_src_configure() {
 	debug-print-function ${FUNCNAME} "$@"
 
-	[[ "${CMAKE_REMOVE_MODULES}" == "yes" ]] && {
+	if [[ "${CMAKE_REMOVE_MODULES}" == "yes" ]] ; then
 		local name
 		for name in ${CMAKE_REMOVE_MODULES_LIST} ; do
 			find "${S}" -name ${name}.cmake -exec rm -v {} + || die
 		done
-	}
+	fi
 
 	_check_build_dir
 
-- 
2.4.10



^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [gentoo-dev] [PATCH 05/15] cmake-utils.eclass: remove duplicate CMAKE_REMOVE_MODULES
  2016-01-20 10:42 [gentoo-dev] [PATCH 00/15] EAPI 6 support for cmake-utils.eclas Michael Palimaka
                   ` (3 preceding siblings ...)
  2016-01-20 10:43 ` [gentoo-dev] [PATCH 04/15] cmake-utils.eclass: use a proper if statement Michael Palimaka
@ 2016-01-20 10:43 ` Michael Palimaka
  2016-01-20 10:43 ` [gentoo-dev] [PATCH 06/15] cmake-utils.eclass: ban WANT_CMAKE in EAPI 6 and later Michael Palimaka
                   ` (9 subsequent siblings)
  14 siblings, 0 replies; 22+ messages in thread
From: Michael Palimaka @ 2016-01-20 10:43 UTC (permalink / raw
  To: gentoo-dev; +Cc: Michael Palimaka

---
 eclass/cmake-utils.eclass | 1 -
 1 file changed, 1 deletion(-)

diff --git a/eclass/cmake-utils.eclass b/eclass/cmake-utils.eclass
index b2e13a1..28caed2 100644
--- a/eclass/cmake-utils.eclass
+++ b/eclass/cmake-utils.eclass
@@ -64,7 +64,6 @@ _CMAKE_UTILS_ECLASS=1
 # @DESCRIPTION:
 # Do we want to remove anything? yes or whatever else for no
 : ${CMAKE_REMOVE_MODULES:=yes}
-CMAKE_REMOVE_MODULES="${CMAKE_REMOVE_MODULES:-yes}"
 
 # @ECLASS-VARIABLE: CMAKE_REMOVE_MODULES_LIST
 # @DESCRIPTION:
-- 
2.4.10



^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [gentoo-dev] [PATCH 06/15] cmake-utils.eclass: ban WANT_CMAKE in EAPI 6 and later
  2016-01-20 10:42 [gentoo-dev] [PATCH 00/15] EAPI 6 support for cmake-utils.eclas Michael Palimaka
                   ` (4 preceding siblings ...)
  2016-01-20 10:43 ` [gentoo-dev] [PATCH 05/15] cmake-utils.eclass: remove duplicate CMAKE_REMOVE_MODULES Michael Palimaka
@ 2016-01-20 10:43 ` Michael Palimaka
  2016-01-20 10:43 ` [gentoo-dev] [PATCH 07/15] cmake-utils.eclass: replace replace comment_add_subdirectory with a namespaced version Michael Palimaka
                   ` (8 subsequent siblings)
  14 siblings, 0 replies; 22+ messages in thread
From: Michael Palimaka @ 2016-01-20 10:43 UTC (permalink / raw
  To: gentoo-dev; +Cc: Michael Palimaka

It is basically unused across the tree and complicates the eclass. If it were
needed, it might be better to write custom ebuild phase functions instead.
---
 eclass/cmake-utils.eclass | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/eclass/cmake-utils.eclass b/eclass/cmake-utils.eclass
index 28caed2..1de863f 100644
--- a/eclass/cmake-utils.eclass
+++ b/eclass/cmake-utils.eclass
@@ -103,6 +103,8 @@ _CMAKE_UTILS_ECLASS=1
 # This is useful when only part of application is using cmake build system.
 # Valid values are: always [default], optional (where the value is the useflag
 # used for optionality)
+#
+# This is banned in EAPI 6 and later.
 : ${WANT_CMAKE:=always}
 
 # @ECLASS-VARIABLE: CMAKE_EXTRA_CACHE_FILE
@@ -125,6 +127,7 @@ case ${WANT_CMAKE} in
 	always)
 		;;
 	*)
+		has "${EAPI:-0}" 2 3 4 5 || die "WANT_CMAKE is banned in EAPI 6 and later"
 		IUSE+=" ${WANT_CMAKE}"
 		CMAKEDEPEND+="${WANT_CMAKE}? ( "
 		;;
-- 
2.4.10



^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [gentoo-dev] [PATCH 07/15] cmake-utils.eclass: replace replace comment_add_subdirectory with a namespaced version
  2016-01-20 10:42 [gentoo-dev] [PATCH 00/15] EAPI 6 support for cmake-utils.eclas Michael Palimaka
                   ` (5 preceding siblings ...)
  2016-01-20 10:43 ` [gentoo-dev] [PATCH 06/15] cmake-utils.eclass: ban WANT_CMAKE in EAPI 6 and later Michael Palimaka
@ 2016-01-20 10:43 ` Michael Palimaka
  2016-01-21 16:29   ` Michał Górny
  2016-01-20 10:43 ` [gentoo-dev] [PATCH 08/15] cmake-utils.eclass: namespace some private functions Michael Palimaka
                   ` (7 subsequent siblings)
  14 siblings, 1 reply; 22+ messages in thread
From: Michael Palimaka @ 2016-01-20 10:43 UTC (permalink / raw
  To: gentoo-dev; +Cc: Michael Palimaka

---
 eclass/cmake-utils.eclass | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/eclass/cmake-utils.eclass b/eclass/cmake-utils.eclass
index 1de863f..e8b24bd 100644
--- a/eclass/cmake-utils.eclass
+++ b/eclass/cmake-utils.eclass
@@ -250,11 +250,11 @@ _generator_to_use() {
 	echo ${generator_name}
 }
 
-# @FUNCTION: comment_add_subdirectory
+# @FUNCTION: cmake_comment_add_subdirectory
 # @USAGE: <subdirectory>
 # @DESCRIPTION:
 # Comment out an add_subdirectory call in CMakeLists.txt in the current directory
-comment_add_subdirectory() {
+cmake_comment_add_subdirectory() {
         if [[ -z ${1} ]]; then
                 die "comment_add_subdirectory must be passed the directory name to comment"
         fi
@@ -265,6 +265,17 @@ comment_add_subdirectory() {
         fi
 }
 
+# @FUNCTION: comment_add_subdirectory
+# @USAGE: <subdirectory>
+# @DESCRIPTION:
+# Comment out an add_subdirectory call in CMakeLists.txt in the current directory
+# Banned in EAPI 6 and later - use cmake_comment_add_subdirectory instead.
+comment_add_subdirectory() {
+	has "${EAPI:-0}" 2 3 4 5 || die "comment_add_subdirectory is banned in EAPI 6 and later - use cmake_comment_add_subdirectory instead"
+
+	cmake_comment_add_subdirectory "$@"
+}
+
 # @FUNCTION: cmake-utils_use_with
 # @USAGE: <USE flag> [flag name]
 # @DESCRIPTION:
-- 
2.4.10



^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [gentoo-dev] [PATCH 08/15] cmake-utils.eclass: namespace some private functions
  2016-01-20 10:42 [gentoo-dev] [PATCH 00/15] EAPI 6 support for cmake-utils.eclas Michael Palimaka
                   ` (6 preceding siblings ...)
  2016-01-20 10:43 ` [gentoo-dev] [PATCH 07/15] cmake-utils.eclass: replace replace comment_add_subdirectory with a namespaced version Michael Palimaka
@ 2016-01-20 10:43 ` Michael Palimaka
  2016-01-20 10:43 ` [gentoo-dev] [PATCH 09/15] cmake-utils.eclass: move $S modifications to src_prepare in EAPI 6 and later Michael Palimaka
                   ` (6 subsequent siblings)
  14 siblings, 0 replies; 22+ messages in thread
From: Michael Palimaka @ 2016-01-20 10:43 UTC (permalink / raw
  To: gentoo-dev; +Cc: Michael Palimaka

---
 eclass/cmake-utils.eclass | 66 +++++++++++++++++++++++------------------------
 1 file changed, 33 insertions(+), 33 deletions(-)

diff --git a/eclass/cmake-utils.eclass b/eclass/cmake-utils.eclass
index e8b24bd..df33fd9 100644
--- a/eclass/cmake-utils.eclass
+++ b/eclass/cmake-utils.eclass
@@ -158,7 +158,7 @@ DEPEND="${CMAKEDEPEND}"
 unset CMAKEDEPEND
 
 # Internal functions used by cmake-utils_use_*
-_use_me_now() {
+_cmake_use_me_now() {
 	debug-print-function ${FUNCNAME} "$@"
 
 	local uper capitalised x
@@ -175,7 +175,7 @@ _use_me_now() {
 		done
 	fi
 }
-_use_me_now_inverted() {
+_cmake_use_me_now_inverted() {
 	debug-print-function ${FUNCNAME} "$@"
 
 	local uper capitalised x
@@ -194,7 +194,7 @@ _use_me_now_inverted() {
 }
 
 # Determine using IN or OUT source build
-_check_build_dir() {
+_cmake_check_build_dir() {
 	: ${CMAKE_USE_DIR:=${S}}
 	if [[ -n ${CMAKE_IN_SOURCE_BUILD} ]]; then
 		# we build in source dir
@@ -226,7 +226,7 @@ _check_build_dir() {
 }
 
 # Determine which generator to use
-_generator_to_use() {
+_cmake_generator_to_use() {
 	local generator_name
 
 	case ${CMAKE_MAKEFILE_GENERATOR} in
@@ -283,7 +283,7 @@ comment_add_subdirectory() {
 #
 # `cmake-utils_use_with foo FOO` echoes -DWITH_FOO=ON if foo is enabled
 # and -DWITH_FOO=OFF if it is disabled.
-cmake-utils_use_with() { _use_me_now WITH_ "$@" ; }
+cmake-utils_use_with() { _cmake_use_me_now WITH_ "$@" ; }
 
 # @FUNCTION: cmake-utils_use_enable
 # @USAGE: <USE flag> [flag name]
@@ -292,7 +292,7 @@ cmake-utils_use_with() { _use_me_now WITH_ "$@" ; }
 #
 # `cmake-utils_use_enable foo FOO` echoes -DENABLE_FOO=ON if foo is enabled
 # and -DENABLE_FOO=OFF if it is disabled.
-cmake-utils_use_enable() { _use_me_now ENABLE_ "$@" ; }
+cmake-utils_use_enable() { _cmake_use_me_now ENABLE_ "$@" ; }
 
 # @FUNCTION: cmake-utils_use_find_package
 # @USAGE: <USE flag> [flag name]
@@ -302,7 +302,7 @@ cmake-utils_use_enable() { _use_me_now ENABLE_ "$@" ; }
 # `cmake-utils_use_find_package foo LibFoo` echoes -DCMAKE_DISABLE_FIND_PACKAGE_LibFoo=OFF
 # if foo is enabled and -DCMAKE_DISABLE_FIND_PACKAGE_LibFoo=ON if it is disabled.
 # This can be used to make find_package optional.
-cmake-utils_use_find_package() { _use_me_now_inverted CMAKE_DISABLE_FIND_PACKAGE_ "$@" ; }
+cmake-utils_use_find_package() { _cmake_use_me_now_inverted CMAKE_DISABLE_FIND_PACKAGE_ "$@" ; }
 
 # @FUNCTION: cmake-utils_use_disable
 # @USAGE: <USE flag> [flag name]
@@ -311,7 +311,7 @@ cmake-utils_use_find_package() { _use_me_now_inverted CMAKE_DISABLE_FIND_PACKAGE
 #
 # `cmake-utils_use_enable foo FOO` echoes -DDISABLE_FOO=OFF if foo is enabled
 # and -DDISABLE_FOO=ON if it is disabled.
-cmake-utils_use_disable() { _use_me_now_inverted DISABLE_ "$@" ; }
+cmake-utils_use_disable() { _cmake_use_me_now_inverted DISABLE_ "$@" ; }
 
 # @FUNCTION: cmake-utils_use_no
 # @USAGE: <USE flag> [flag name]
@@ -320,7 +320,7 @@ cmake-utils_use_disable() { _use_me_now_inverted DISABLE_ "$@" ; }
 #
 # `cmake-utils_use_no foo FOO` echoes -DNO_FOO=OFF if foo is enabled
 # and -DNO_FOO=ON if it is disabled.
-cmake-utils_use_no() { _use_me_now_inverted NO_ "$@" ; }
+cmake-utils_use_no() { _cmake_use_me_now_inverted NO_ "$@" ; }
 
 # @FUNCTION: cmake-utils_use_want
 # @USAGE: <USE flag> [flag name]
@@ -329,7 +329,7 @@ cmake-utils_use_no() { _use_me_now_inverted NO_ "$@" ; }
 #
 # `cmake-utils_use_want foo FOO` echoes -DWANT_FOO=ON if foo is enabled
 # and -DWANT_FOO=OFF if it is disabled.
-cmake-utils_use_want() { _use_me_now WANT_ "$@" ; }
+cmake-utils_use_want() { _cmake_use_me_now WANT_ "$@" ; }
 
 # @FUNCTION: cmake-utils_use_build
 # @USAGE: <USE flag> [flag name]
@@ -338,7 +338,7 @@ cmake-utils_use_want() { _use_me_now WANT_ "$@" ; }
 #
 # `cmake-utils_use_build foo FOO` echoes -DBUILD_FOO=ON if foo is enabled
 # and -DBUILD_FOO=OFF if it is disabled.
-cmake-utils_use_build() { _use_me_now BUILD_ "$@" ; }
+cmake-utils_use_build() { _cmake_use_me_now BUILD_ "$@" ; }
 
 # @FUNCTION: cmake-utils_use_has
 # @USAGE: <USE flag> [flag name]
@@ -347,7 +347,7 @@ cmake-utils_use_build() { _use_me_now BUILD_ "$@" ; }
 #
 # `cmake-utils_use_has foo FOO` echoes -DHAVE_FOO=ON if foo is enabled
 # and -DHAVE_FOO=OFF if it is disabled.
-cmake-utils_use_has() { _use_me_now HAVE_ "$@" ; }
+cmake-utils_use_has() { _cmake_use_me_now HAVE_ "$@" ; }
 
 # @FUNCTION: cmake-utils_use_use
 # @USAGE: <USE flag> [flag name]
@@ -356,7 +356,7 @@ cmake-utils_use_has() { _use_me_now HAVE_ "$@" ; }
 #
 # `cmake-utils_use_use foo FOO` echoes -DUSE_FOO=ON if foo is enabled
 # and -DUSE_FOO=OFF if it is disabled.
-cmake-utils_use_use() { _use_me_now USE_ "$@" ; }
+cmake-utils_use_use() { _cmake_use_me_now USE_ "$@" ; }
 
 # @FUNCTION: cmake-utils_use
 # @USAGE: <USE flag> [flag name]
@@ -365,7 +365,7 @@ cmake-utils_use_use() { _use_me_now USE_ "$@" ; }
 #
 # `cmake-utils_use foo FOO` echoes -DFOO=ON if foo is enabled
 # and -DFOO=OFF if it is disabled.
-cmake-utils_use() { _use_me_now "" "$@" ; }
+cmake-utils_use() { _cmake_use_me_now "" "$@" ; }
 
 # @FUNCTION: cmake-utils_useno
 # @USAGE: <USE flag> [flag name]
@@ -374,11 +374,11 @@ cmake-utils_use() { _use_me_now "" "$@" ; }
 #
 # `cmake-utils_useno foo NOFOO` echoes -DNOFOO=OFF if foo is enabled
 # and -DNOFOO=ON if it is disabled.
-cmake-utils_useno() { _use_me_now_inverted "" "$@" ; }
+cmake-utils_useno() { _cmake_use_me_now_inverted "" "$@" ; }
 
 # Internal function for modifying hardcoded definitions.
 # Removes dangerous definitions that override Gentoo settings.
-_modify-cmakelists() {
+_cmake_modify-cmakelists() {
 	debug-print-function ${FUNCNAME} "$@"
 
 	# Only edit the files once
@@ -448,7 +448,7 @@ enable_cmake-utils_src_configure() {
 		done
 	fi
 
-	_check_build_dir
+	_cmake_check_build_dir
 
 	# check if CMakeLists.txt exist and if no then die
 	if [[ ! -e ${CMAKE_USE_DIR}/CMakeLists.txt ]] ; then
@@ -459,7 +459,7 @@ enable_cmake-utils_src_configure() {
 	fi
 
 	# Remove dangerous things.
-	_modify-cmakelists
+	_cmake_modify-cmakelists
 
 	# Fix xdg collision with sandbox
 	local -x XDG_CONFIG_HOME="${T}"
@@ -592,7 +592,7 @@ enable_cmake-utils_src_configure() {
 	local cmakeargs=(
 		${warn_unused_cli}
 		-C "${common_config}"
-		-G "$(_generator_to_use)"
+		-G "$(_cmake_generator_to_use)"
 		-DCMAKE_INSTALL_PREFIX="${EPREFIX}${PREFIX}"
 		"${mycmakeargs_local[@]}"
 		-DCMAKE_BUILD_TYPE="${CMAKE_BUILD_TYPE}"
@@ -641,11 +641,11 @@ _ninjaopts_from_makeopts() {
 	export NINJAOPTS="${ninjaopts[*]}"
 }
 
-# @FUNCTION: ninja_src_make
+# @FUNCTION: _cmake_ninja_src_make
 # @INTERNAL
 # @DESCRIPTION:
 # Build the package using ninja generator
-ninja_src_make() {
+_cmake_ninja_src_make() {
 	debug-print-function ${FUNCNAME} "$@"
 
 	[[ -e build.ninja ]] || die "build.ninja not found. Error during configure stage."
@@ -662,11 +662,11 @@ ninja_src_make() {
 	"$@" || die
 }
 
-# @FUNCTION: emake_src_make
+# @FUNCTION: _cmake_emake_src_make
 # @INTERNAL
 # @DESCRIPTION:
 # Build the package using make generator
-emake_src_make() {
+_cmake_emake_src_make() {
 	debug-print-function ${FUNCNAME} "$@"
 
 	[[ -e Makefile ]] || die "Makefile not found. Error during configure stage."
@@ -686,10 +686,10 @@ emake_src_make() {
 cmake-utils_src_make() {
 	debug-print-function ${FUNCNAME} "$@"
 
-	_check_build_dir
+	_cmake_check_build_dir
 	pushd "${BUILD_DIR}" > /dev/null || die
 
-	${CMAKE_MAKEFILE_GENERATOR}_src_make "$@"
+	_cmake_${CMAKE_MAKEFILE_GENERATOR}_src_make "$@"
 
 	popd > /dev/null || die
 }
@@ -697,7 +697,7 @@ cmake-utils_src_make() {
 enable_cmake-utils_src_test() {
 	debug-print-function ${FUNCNAME} "$@"
 
-	_check_build_dir
+	_cmake_check_build_dir
 	pushd "${BUILD_DIR}" > /dev/null || die
 	[[ -e CTestTestfile.cmake ]] || { echo "No tests found. Skipping."; return 0 ; }
 
@@ -728,7 +728,7 @@ enable_cmake-utils_src_test() {
 enable_cmake-utils_src_install() {
 	debug-print-function ${FUNCNAME} "$@"
 
-	_check_build_dir
+	_cmake_check_build_dir
 	pushd "${BUILD_DIR}" > /dev/null || die
 	DESTDIR="${D}" ${CMAKE_MAKEFILE_GENERATOR} install "$@" || die "died running ${CMAKE_MAKEFILE_GENERATOR} install"
 	popd > /dev/null || die
@@ -742,7 +742,7 @@ enable_cmake-utils_src_install() {
 # @DESCRIPTION:
 # Apply ebuild and user patches.
 cmake-utils_src_prepare() {
-	_execute_optionally "src_prepare" "$@"
+	_cmake_execute_optionally "src_prepare" "$@"
 }
 
 # @FUNCTION: cmake-utils_src_configure
@@ -750,7 +750,7 @@ cmake-utils_src_prepare() {
 # General function for configuring with cmake. Default behaviour is to start an
 # out-of-source build.
 cmake-utils_src_configure() {
-	_execute_optionally "src_configure" "$@"
+	_cmake_execute_optionally "src_configure" "$@"
 }
 
 # @FUNCTION: cmake-utils_src_compile
@@ -758,25 +758,25 @@ cmake-utils_src_configure() {
 # General function for compiling with cmake.
 # Automatically detects the build type. All arguments are passed to emake.
 cmake-utils_src_compile() {
-	_execute_optionally "src_compile" "$@"
+	_cmake_execute_optionally "src_compile" "$@"
 }
 
 # @FUNCTION: cmake-utils_src_test
 # @DESCRIPTION:
 # Function for testing the package. Automatically detects the build type.
 cmake-utils_src_test() {
-	_execute_optionally "src_test" "$@"
+	_cmake_execute_optionally "src_test" "$@"
 }
 
 # @FUNCTION: cmake-utils_src_install
 # @DESCRIPTION:
 # Function for installing the package. Automatically detects the build type.
 cmake-utils_src_install() {
-	_execute_optionally "src_install" "$@"
+	_cmake_execute_optionally "src_install" "$@"
 }
 
 # Optionally executes phases based on WANT_CMAKE variable/USE flag.
-_execute_optionally() {
+_cmake_execute_optionally() {
 	local phase="$1" ; shift
 	if [[ ${WANT_CMAKE} = always ]]; then
 		enable_cmake-utils_${phase} "$@"
-- 
2.4.10



^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [gentoo-dev] [PATCH 09/15] cmake-utils.eclass: move $S modifications to src_prepare in EAPI 6 and later
  2016-01-20 10:42 [gentoo-dev] [PATCH 00/15] EAPI 6 support for cmake-utils.eclas Michael Palimaka
                   ` (7 preceding siblings ...)
  2016-01-20 10:43 ` [gentoo-dev] [PATCH 08/15] cmake-utils.eclass: namespace some private functions Michael Palimaka
@ 2016-01-20 10:43 ` Michael Palimaka
  2016-01-20 10:43 ` [gentoo-dev] [PATCH 10/15] cmake-utils.eclass: ban non-array usage of mycmakeargs " Michael Palimaka
                   ` (5 subsequent siblings)
  14 siblings, 0 replies; 22+ messages in thread
From: Michael Palimaka @ 2016-01-20 10:43 UTC (permalink / raw
  To: gentoo-dev; +Cc: Michael Palimaka

This is the correct phase for source modifications, and additionally avoids a
multilib race condition.

Gentoo-bug: 513170
---
 eclass/cmake-utils.eclass | 44 +++++++++++++++++++++++++++-----------------
 1 file changed, 27 insertions(+), 17 deletions(-)

diff --git a/eclass/cmake-utils.eclass b/eclass/cmake-utils.eclass
index df33fd9..22c8718 100644
--- a/eclass/cmake-utils.eclass
+++ b/eclass/cmake-utils.eclass
@@ -409,11 +409,37 @@ _cmake_modify-cmakelists() {
 	_EOF_
 }
 
+# temporary function for moving cmake cleanups from from src_configure -> src_prepare.
+# bug #378850
+_cmake_cleanup_cmake() {
+	: ${CMAKE_USE_DIR:=${S}}
+
+	if [[ "${CMAKE_REMOVE_MODULES}" == "yes" ]] ; then
+		local name
+		for name in ${CMAKE_REMOVE_MODULES_LIST} ; do
+			find "${S}" -name ${name}.cmake -exec rm -v {} + || die
+		done
+	fi
+
+	# check if CMakeLists.txt exist and if no then die
+	if [[ ! -e ${CMAKE_USE_DIR}/CMakeLists.txt ]] ; then
+		eerror "Unable to locate CMakeLists.txt under:"
+		eerror "\"${CMAKE_USE_DIR}/CMakeLists.txt\""
+		eerror "Consider not inheriting the cmake eclass."
+		die "FATAL: Unable to find CMakeLists.txt"
+	fi
+
+	# Remove dangerous things.
+	_cmake_modify-cmakelists
+}
+
 enable_cmake-utils_src_prepare() {
 	debug-print-function ${FUNCNAME} "$@"
 
 	pushd "${S}" > /dev/null || die
 
+	has "${EAPI:-0}" 6 && _cmake_cleanup_cmake
+
 	debug-print "$FUNCNAME: PATCHES=$PATCHES"
 	[[ ${PATCHES[@]} ]] && epatch "${PATCHES[@]}"
 
@@ -441,26 +467,10 @@ enable_cmake-utils_src_prepare() {
 enable_cmake-utils_src_configure() {
 	debug-print-function ${FUNCNAME} "$@"
 
-	if [[ "${CMAKE_REMOVE_MODULES}" == "yes" ]] ; then
-		local name
-		for name in ${CMAKE_REMOVE_MODULES_LIST} ; do
-			find "${S}" -name ${name}.cmake -exec rm -v {} + || die
-		done
-	fi
+	has "${EAPI:-0}" 2 3 4 5 && _cmake_cleanup_cmake
 
 	_cmake_check_build_dir
 
-	# check if CMakeLists.txt exist and if no then die
-	if [[ ! -e ${CMAKE_USE_DIR}/CMakeLists.txt ]] ; then
-		eerror "Unable to locate CMakeLists.txt under:"
-		eerror "\"${CMAKE_USE_DIR}/CMakeLists.txt\""
-		eerror "Consider not inheriting the cmake eclass."
-		die "FATAL: Unable to find CMakeLists.txt"
-	fi
-
-	# Remove dangerous things.
-	_cmake_modify-cmakelists
-
 	# Fix xdg collision with sandbox
 	local -x XDG_CONFIG_HOME="${T}"
 
-- 
2.4.10



^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [gentoo-dev] [PATCH 10/15] cmake-utils.eclass: ban non-array usage of mycmakeargs in EAPI 6 and later
  2016-01-20 10:42 [gentoo-dev] [PATCH 00/15] EAPI 6 support for cmake-utils.eclas Michael Palimaka
                   ` (8 preceding siblings ...)
  2016-01-20 10:43 ` [gentoo-dev] [PATCH 09/15] cmake-utils.eclass: move $S modifications to src_prepare in EAPI 6 and later Michael Palimaka
@ 2016-01-20 10:43 ` Michael Palimaka
  2016-01-20 10:43 ` [gentoo-dev] [PATCH 11/15] cmake-utils.eclass: use default_src_prepare " Michael Palimaka
                   ` (4 subsequent siblings)
  14 siblings, 0 replies; 22+ messages in thread
From: Michael Palimaka @ 2016-01-20 10:43 UTC (permalink / raw
  To: gentoo-dev; +Cc: Michael Palimaka

---
 eclass/cmake-utils.eclass | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/eclass/cmake-utils.eclass b/eclass/cmake-utils.eclass
index 22c8718..e6d77ef 100644
--- a/eclass/cmake-utils.eclass
+++ b/eclass/cmake-utils.eclass
@@ -583,7 +583,11 @@ enable_cmake-utils_src_configure() {
 	local mycmakeargstype=$(declare -p mycmakeargs 2>&-)
 	if [[ "${mycmakeargstype}" != "declare -a mycmakeargs="* ]]; then
 		if [[ -n "${mycmakeargstype}" ]] ; then
-			eqawarn "Declaring mycmakeargs as a variable is deprecated. Please use an array instead."
+			if has "${EAPI:-0}" 2 3 4 5 ; then
+				eqawarn "Declaring mycmakeargs as a variable is deprecated. Please use an array instead."
+			else
+				die "Declaring mycmakeargs as a variable is banned in EAPI=${EAPI}. Please use an array instead."
+			fi
 		fi
 		local mycmakeargs_local=(${mycmakeargs})
 	else
-- 
2.4.10



^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [gentoo-dev] [PATCH 11/15] cmake-utils.eclass: use default_src_prepare in EAPI 6 and later
  2016-01-20 10:42 [gentoo-dev] [PATCH 00/15] EAPI 6 support for cmake-utils.eclas Michael Palimaka
                   ` (9 preceding siblings ...)
  2016-01-20 10:43 ` [gentoo-dev] [PATCH 10/15] cmake-utils.eclass: ban non-array usage of mycmakeargs " Michael Palimaka
@ 2016-01-20 10:43 ` Michael Palimaka
  2016-01-20 10:43 ` [gentoo-dev] [PATCH 12/15] cmake-utils.eclass: require two arguments for cmake-utils_use_find_package " Michael Palimaka
                   ` (3 subsequent siblings)
  14 siblings, 0 replies; 22+ messages in thread
From: Michael Palimaka @ 2016-01-20 10:43 UTC (permalink / raw
  To: gentoo-dev; +Cc: Michael Palimaka

---
 eclass/cmake-utils.eclass | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/eclass/cmake-utils.eclass b/eclass/cmake-utils.eclass
index e6d77ef..51da1c0 100644
--- a/eclass/cmake-utils.eclass
+++ b/eclass/cmake-utils.eclass
@@ -438,13 +438,16 @@ enable_cmake-utils_src_prepare() {
 
 	pushd "${S}" > /dev/null || die
 
-	has "${EAPI:-0}" 6 && _cmake_cleanup_cmake
-
-	debug-print "$FUNCNAME: PATCHES=$PATCHES"
-	[[ ${PATCHES[@]} ]] && epatch "${PATCHES[@]}"
+	if ! has "${EAPI:-0}" 2 3 4 5 ; then
+		default_src_prepare
+		_cmake_cleanup_cmake
+	else
+		debug-print "$FUNCNAME: PATCHES=$PATCHES"
+		[[ ${PATCHES[@]} ]] && epatch "${PATCHES[@]}"
 
-	debug-print "$FUNCNAME: applying user patches"
-	epatch_user
+		debug-print "$FUNCNAME: applying user patches"
+		epatch_user
+	fi
 
 	popd > /dev/null || die
 }
-- 
2.4.10



^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [gentoo-dev] [PATCH 12/15] cmake-utils.eclass: require two arguments for cmake-utils_use_find_package in EAPI 6 and later
  2016-01-20 10:42 [gentoo-dev] [PATCH 00/15] EAPI 6 support for cmake-utils.eclas Michael Palimaka
                   ` (10 preceding siblings ...)
  2016-01-20 10:43 ` [gentoo-dev] [PATCH 11/15] cmake-utils.eclass: use default_src_prepare " Michael Palimaka
@ 2016-01-20 10:43 ` Michael Palimaka
  2016-01-20 10:43 ` [gentoo-dev] [PATCH 13/15] cmake-utils.eclass: ban helper functions " Michael Palimaka
                   ` (2 subsequent siblings)
  14 siblings, 0 replies; 22+ messages in thread
From: Michael Palimaka @ 2016-01-20 10:43 UTC (permalink / raw
  To: gentoo-dev; +Cc: Michael Palimaka

This will allow us to remove the capitalisation variants code later.
---
 eclass/cmake-utils.eclass | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/eclass/cmake-utils.eclass b/eclass/cmake-utils.eclass
index 51da1c0..960b34b 100644
--- a/eclass/cmake-utils.eclass
+++ b/eclass/cmake-utils.eclass
@@ -295,14 +295,20 @@ cmake-utils_use_with() { _cmake_use_me_now WITH_ "$@" ; }
 cmake-utils_use_enable() { _cmake_use_me_now ENABLE_ "$@" ; }
 
 # @FUNCTION: cmake-utils_use_find_package
-# @USAGE: <USE flag> [flag name]
+# @USAGE: <USE flag> <package name>
 # @DESCRIPTION:
 # Based on use_enable. See ebuild(5).
 #
 # `cmake-utils_use_find_package foo LibFoo` echoes -DCMAKE_DISABLE_FIND_PACKAGE_LibFoo=OFF
 # if foo is enabled and -DCMAKE_DISABLE_FIND_PACKAGE_LibFoo=ON if it is disabled.
 # This can be used to make find_package optional.
-cmake-utils_use_find_package() { _cmake_use_me_now_inverted CMAKE_DISABLE_FIND_PACKAGE_ "$@" ; }
+cmake-utils_use_find_package() {
+	if ! has "${EAPI:-0}" 2 3 4 5 && [[ "$#" != 2 ]] ; then
+		die "Usage: cmake-utils_use_find_package <USE flag> <package name>"
+	fi
+
+	_cmake_use_me_now_inverted CMAKE_DISABLE_FIND_PACKAGE_ "$@" ;
+}
 
 # @FUNCTION: cmake-utils_use_disable
 # @USAGE: <USE flag> [flag name]
-- 
2.4.10



^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [gentoo-dev] [PATCH 13/15] cmake-utils.eclass: ban helper functions in EAPI 6 and later
  2016-01-20 10:42 [gentoo-dev] [PATCH 00/15] EAPI 6 support for cmake-utils.eclas Michael Palimaka
                   ` (11 preceding siblings ...)
  2016-01-20 10:43 ` [gentoo-dev] [PATCH 12/15] cmake-utils.eclass: require two arguments for cmake-utils_use_find_package " Michael Palimaka
@ 2016-01-20 10:43 ` Michael Palimaka
  2016-01-21 16:31   ` Michał Górny
  2016-01-20 10:43 ` [gentoo-dev] [PATCH 14/15] cmake-utils.eclass: enable EAPI 6 Michael Palimaka
  2016-01-20 10:43 ` [gentoo-dev] [PATCH 15/15] cmake-utils.eclass: update copyright year Michael Palimaka
  14 siblings, 1 reply; 22+ messages in thread
From: Michael Palimaka @ 2016-01-20 10:43 UTC (permalink / raw
  To: gentoo-dev; +Cc: Michael Palimaka

https://archives.gentoo.org/gentoo-dev/message/6ff6dedb44fff4289764dc5eb960e1c6

Gentoo-bug: 514384
---
 eclass/cmake-utils.eclass | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/eclass/cmake-utils.eclass b/eclass/cmake-utils.eclass
index 960b34b..507d27d 100644
--- a/eclass/cmake-utils.eclass
+++ b/eclass/cmake-utils.eclass
@@ -161,6 +161,11 @@ unset CMAKEDEPEND
 _cmake_use_me_now() {
 	debug-print-function ${FUNCNAME} "$@"
 
+	local arg=$2
+	[[ ! -z $3 ]] && arg=$3
+
+	has "${EAPI:-0}" 2 3 4 5 || die "${FUNCNAME[1]} is banned in EAPI 6 and later: use -D$1${arg}=\"\$(usex $2)\" instead"
+
 	local uper capitalised x
 	[[ -z $2 ]] && die "cmake-utils_use-$1 <USE flag> [<flag name>]"
 	if [[ ! -z $3 ]]; then
@@ -178,6 +183,13 @@ _cmake_use_me_now() {
 _cmake_use_me_now_inverted() {
 	debug-print-function ${FUNCNAME} "$@"
 
+	local arg=$2
+	[[ ! -z $3 ]] && arg=$3
+
+	if ! has "${EAPI:-0}" 2 3 4 5 && [[ "${FUNCNAME[1]}" != cmake-utils_use_find_package ]] ; then
+		die "${FUNCNAME[1]} is banned in EAPI 6 and later: use -D$1${arg}=\"\$(usex $2)\" insteadss"
+	fi
+
 	local uper capitalised x
 	[[ -z $2 ]] && die "cmake-utils_use-$1 <USE flag> [<flag name>]"
 	if [[ ! -z $3 ]]; then
-- 
2.4.10



^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [gentoo-dev] [PATCH 14/15] cmake-utils.eclass: enable EAPI 6
  2016-01-20 10:42 [gentoo-dev] [PATCH 00/15] EAPI 6 support for cmake-utils.eclas Michael Palimaka
                   ` (12 preceding siblings ...)
  2016-01-20 10:43 ` [gentoo-dev] [PATCH 13/15] cmake-utils.eclass: ban helper functions " Michael Palimaka
@ 2016-01-20 10:43 ` Michael Palimaka
  2016-01-20 10:43 ` [gentoo-dev] [PATCH 15/15] cmake-utils.eclass: update copyright year Michael Palimaka
  14 siblings, 0 replies; 22+ messages in thread
From: Michael Palimaka @ 2016-01-20 10:43 UTC (permalink / raw
  To: gentoo-dev; +Cc: Michael Palimaka

---
 eclass/cmake-utils.eclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/eclass/cmake-utils.eclass b/eclass/cmake-utils.eclass
index 507d27d..70b70e2 100644
--- a/eclass/cmake-utils.eclass
+++ b/eclass/cmake-utils.eclass
@@ -114,7 +114,7 @@ _CMAKE_UTILS_ECLASS=1
 # Should be set by user in a per-package basis in /etc/portage/package.env.
 
 case ${EAPI} in
-	2|3|4|5) : ;;
+	2|3|4|5|6) : ;;
 	*) die "EAPI=${EAPI:-0} is not supported" ;;
 esac
 
-- 
2.4.10



^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [gentoo-dev] [PATCH 15/15] cmake-utils.eclass: update copyright year
  2016-01-20 10:42 [gentoo-dev] [PATCH 00/15] EAPI 6 support for cmake-utils.eclas Michael Palimaka
                   ` (13 preceding siblings ...)
  2016-01-20 10:43 ` [gentoo-dev] [PATCH 14/15] cmake-utils.eclass: enable EAPI 6 Michael Palimaka
@ 2016-01-20 10:43 ` Michael Palimaka
  2016-01-21 16:32   ` Michał Górny
  14 siblings, 1 reply; 22+ messages in thread
From: Michael Palimaka @ 2016-01-20 10:43 UTC (permalink / raw
  To: gentoo-dev; +Cc: Michael Palimaka

---
 eclass/cmake-utils.eclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/eclass/cmake-utils.eclass b/eclass/cmake-utils.eclass
index 70b70e2..9e8e71e 100644
--- a/eclass/cmake-utils.eclass
+++ b/eclass/cmake-utils.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2015 Gentoo Foundation
+# Copyright 1999-2016 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 # $Id$
 
-- 
2.4.10



^ permalink raw reply related	[flat|nested] 22+ messages in thread

* Re: [gentoo-dev] [PATCH 07/15] cmake-utils.eclass: replace replace comment_add_subdirectory with a namespaced version
  2016-01-20 10:43 ` [gentoo-dev] [PATCH 07/15] cmake-utils.eclass: replace replace comment_add_subdirectory with a namespaced version Michael Palimaka
@ 2016-01-21 16:29   ` Michał Górny
  2016-01-22  9:36     ` [gentoo-dev] " Michael Palimaka
  0 siblings, 1 reply; 22+ messages in thread
From: Michał Górny @ 2016-01-21 16:29 UTC (permalink / raw
  To: gentoo-dev

Dnia 20 stycznia 2016 11:43:05 CET, Michael Palimaka <kensington@gentoo.org> napisał(a):
>---
> eclass/cmake-utils.eclass | 15 +++++++++++++--
> 1 file changed, 13 insertions(+), 2 deletions(-)
>
>diff --git a/eclass/cmake-utils.eclass b/eclass/cmake-utils.eclass
>index 1de863f..e8b24bd 100644
>--- a/eclass/cmake-utils.eclass
>+++ b/eclass/cmake-utils.eclass
>@@ -250,11 +250,11 @@ _generator_to_use() {
> 	echo ${generator_name}
> }
> 
>-# @FUNCTION: comment_add_subdirectory
>+# @FUNCTION: cmake_comment_add_subdirectory
> # @USAGE: <subdirectory>
> # @DESCRIPTION:
># Comment out an add_subdirectory call in CMakeLists.txt in the current
>directory
>-comment_add_subdirectory() {
>+cmake_comment_add_subdirectory() {
>         if [[ -z ${1} ]]; then
>die "comment_add_subdirectory must be passed the directory name to
>comment"
>         fi
>@@ -265,6 +265,17 @@ comment_add_subdirectory() {
>         fi
> }
> 
>+# @FUNCTION: comment_add_subdirectory
>+# @USAGE: <subdirectory>
>+# @DESCRIPTION:
>+# Comment out an add_subdirectory call in CMakeLists.txt in the
>current directory
>+# Banned in EAPI 6 and later - use cmake_comment_add_subdirectory
>instead.
>+comment_add_subdirectory() {
>+	has "${EAPI:-0}" 2 3 4 5 || die "comment_add_subdirectory is banned
>in EAPI 6 and later - use cmake_comment_add_subdirectory instead"
>+
>+	cmake_comment_add_subdirectory "$@"
>+}
>+
> # @FUNCTION: cmake-utils_use_with
> # @USAGE: <USE flag> [flag name]
> # @DESCRIPTION:

Enough to 'replace' once :-P (commit message).
-- 
Best regards,
Michał Górny (by phone)


^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [gentoo-dev] [PATCH 13/15] cmake-utils.eclass: ban helper functions in EAPI 6 and later
  2016-01-20 10:43 ` [gentoo-dev] [PATCH 13/15] cmake-utils.eclass: ban helper functions " Michael Palimaka
@ 2016-01-21 16:31   ` Michał Górny
  2016-01-22  9:36     ` [gentoo-dev] " Michael Palimaka
  0 siblings, 1 reply; 22+ messages in thread
From: Michał Górny @ 2016-01-21 16:31 UTC (permalink / raw
  To: gentoo-dev, Michael Palimaka; +Cc: Michael Palimaka

Dnia 20 stycznia 2016 11:43:11 CET, Michael Palimaka <kensington@gentoo.org> napisał(a):
>https://archives.gentoo.org/gentoo-dev/message/6ff6dedb44fff4289764dc5eb960e1c6
>
>Gentoo-bug: 514384
>---
> eclass/cmake-utils.eclass | 12 ++++++++++++
> 1 file changed, 12 insertions(+)
>
>diff --git a/eclass/cmake-utils.eclass b/eclass/cmake-utils.eclass
>index 960b34b..507d27d 100644
>--- a/eclass/cmake-utils.eclass
>+++ b/eclass/cmake-utils.eclass
>@@ -161,6 +161,11 @@ unset CMAKEDEPEND
> _cmake_use_me_now() {
> 	debug-print-function ${FUNCNAME} "$@"
> 
>+	local arg=$2
>+	[[ ! -z $3 ]] && arg=$3
>+
>+	has "${EAPI:-0}" 2 3 4 5 || die "${FUNCNAME[1]} is banned in EAPI 6
>and later: use -D$1${arg}=\"\$(usex $2)\" instead"
>+
> 	local uper capitalised x
> 	[[ -z $2 ]] && die "cmake-utils_use-$1 <USE flag> [<flag name>]"
> 	if [[ ! -z $3 ]]; then
>@@ -178,6 +183,13 @@ _cmake_use_me_now() {
> _cmake_use_me_now_inverted() {
> 	debug-print-function ${FUNCNAME} "$@"
> 
>+	local arg=$2
>+	[[ ! -z $3 ]] && arg=$3
>+
>+	if ! has "${EAPI:-0}" 2 3 4 5 && [[ "${FUNCNAME[1]}" !=
>cmake-utils_use_find_package ]] ; then
>+		die "${FUNCNAME[1]} is banned in EAPI 6 and later: use
>-D$1${arg}=\"\$(usex $2)\" insteadss"
>+	fi
>+
> 	local uper capitalised x
> 	[[ -z $2 ]] && die "cmake-utils_use-$1 <USE flag> [<flag name>]"
> 	if [[ ! -z $3 ]]; then

I suggest making it more explicit what kind of helper functions are banned in the commit message.
-- 
Best regards,
Michał Górny (by phone)


^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [gentoo-dev] [PATCH 15/15] cmake-utils.eclass: update copyright year
  2016-01-20 10:43 ` [gentoo-dev] [PATCH 15/15] cmake-utils.eclass: update copyright year Michael Palimaka
@ 2016-01-21 16:32   ` Michał Górny
  2016-01-22  9:34     ` [gentoo-dev] " Michael Palimaka
  0 siblings, 1 reply; 22+ messages in thread
From: Michał Górny @ 2016-01-21 16:32 UTC (permalink / raw
  To: gentoo-dev, Michael Palimaka; +Cc: Michael Palimaka

Dnia 20 stycznia 2016 11:43:13 CET, Michael Palimaka <kensington@gentoo.org> napisał(a):
>---
> eclass/cmake-utils.eclass | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
>diff --git a/eclass/cmake-utils.eclass b/eclass/cmake-utils.eclass
>index 70b70e2..9e8e71e 100644
>--- a/eclass/cmake-utils.eclass
>+++ b/eclass/cmake-utils.eclass
>@@ -1,4 +1,4 @@
>-# Copyright 1999-2015 Gentoo Foundation
>+# Copyright 1999-2016 Gentoo Foundation
> # Distributed under the terms of the GNU General Public License v2
> # $Id$
>

Now I'm being picky but this should have happened in the first commit.


-- 
Best regards,
Michał Górny (by phone)


^ permalink raw reply	[flat|nested] 22+ messages in thread

* [gentoo-dev] Re: [PATCH 15/15] cmake-utils.eclass: update copyright year
  2016-01-21 16:32   ` Michał Górny
@ 2016-01-22  9:34     ` Michael Palimaka
  0 siblings, 0 replies; 22+ messages in thread
From: Michael Palimaka @ 2016-01-22  9:34 UTC (permalink / raw
  To: gentoo-dev

On 01/22/2016 03:32 AM, Michał Górny wrote:
> Dnia 20 stycznia 2016 11:43:13 CET, Michael Palimaka <kensington@gentoo.org> napisał(a):
>> ---
>> eclass/cmake-utils.eclass | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/eclass/cmake-utils.eclass b/eclass/cmake-utils.eclass
>> index 70b70e2..9e8e71e 100644
>> --- a/eclass/cmake-utils.eclass
>> +++ b/eclass/cmake-utils.eclass
>> @@ -1,4 +1,4 @@
>> -# Copyright 1999-2015 Gentoo Foundation
>> +# Copyright 1999-2016 Gentoo Foundation
>> # Distributed under the terms of the GNU General Public License v2
>> # $Id$
>>
> 
> Now I'm being picky but this should have happened in the first commit.
> 
> 

I'll squash this into the first commit.



^ permalink raw reply	[flat|nested] 22+ messages in thread

* [gentoo-dev] Re: [PATCH 07/15] cmake-utils.eclass: replace replace comment_add_subdirectory with a namespaced version
  2016-01-21 16:29   ` Michał Górny
@ 2016-01-22  9:36     ` Michael Palimaka
  0 siblings, 0 replies; 22+ messages in thread
From: Michael Palimaka @ 2016-01-22  9:36 UTC (permalink / raw
  To: gentoo-dev

On 01/22/2016 03:29 AM, Michał Górny wrote:
> Dnia 20 stycznia 2016 11:43:05 CET, Michael Palimaka <kensington@gentoo.org> napisał(a):
>> ---
>> eclass/cmake-utils.eclass | 15 +++++++++++++--
>> 1 file changed, 13 insertions(+), 2 deletions(-)
>>
>> diff --git a/eclass/cmake-utils.eclass b/eclass/cmake-utils.eclass
>> index 1de863f..e8b24bd 100644
>> --- a/eclass/cmake-utils.eclass
>> +++ b/eclass/cmake-utils.eclass
>> @@ -250,11 +250,11 @@ _generator_to_use() {
>> 	echo ${generator_name}
>> }
>>
>> -# @FUNCTION: comment_add_subdirectory
>> +# @FUNCTION: cmake_comment_add_subdirectory
>> # @USAGE: <subdirectory>
>> # @DESCRIPTION:
>> # Comment out an add_subdirectory call in CMakeLists.txt in the current
>> directory
>> -comment_add_subdirectory() {
>> +cmake_comment_add_subdirectory() {
>>         if [[ -z ${1} ]]; then
>> die "comment_add_subdirectory must be passed the directory name to
>> comment"
>>         fi
>> @@ -265,6 +265,17 @@ comment_add_subdirectory() {
>>         fi
>> }
>>
>> +# @FUNCTION: comment_add_subdirectory
>> +# @USAGE: <subdirectory>
>> +# @DESCRIPTION:
>> +# Comment out an add_subdirectory call in CMakeLists.txt in the
>> current directory
>> +# Banned in EAPI 6 and later - use cmake_comment_add_subdirectory
>> instead.
>> +comment_add_subdirectory() {
>> +	has "${EAPI:-0}" 2 3 4 5 || die "comment_add_subdirectory is banned
>> in EAPI 6 and later - use cmake_comment_add_subdirectory instead"
>> +
>> +	cmake_comment_add_subdirectory "$@"
>> +}
>> +
>> # @FUNCTION: cmake-utils_use_with
>> # @USAGE: <USE flag> [flag name]
>> # @DESCRIPTION:
> 
> Enough to 'replace' once :-P (commit message).
> 

Thanks, fixed.



^ permalink raw reply	[flat|nested] 22+ messages in thread

* [gentoo-dev] Re: [PATCH 13/15] cmake-utils.eclass: ban helper functions in EAPI 6 and later
  2016-01-21 16:31   ` Michał Górny
@ 2016-01-22  9:36     ` Michael Palimaka
  0 siblings, 0 replies; 22+ messages in thread
From: Michael Palimaka @ 2016-01-22  9:36 UTC (permalink / raw
  To: gentoo-dev

On 01/22/2016 03:31 AM, Michał Górny wrote:
> Dnia 20 stycznia 2016 11:43:11 CET, Michael Palimaka <kensington@gentoo.org> napisał(a):
>> https://archives.gentoo.org/gentoo-dev/message/6ff6dedb44fff4289764dc5eb960e1c6
>>
>> Gentoo-bug: 514384
>> ---
>> eclass/cmake-utils.eclass | 12 ++++++++++++
>> 1 file changed, 12 insertions(+)
>>
>> diff --git a/eclass/cmake-utils.eclass b/eclass/cmake-utils.eclass
>> index 960b34b..507d27d 100644
>> --- a/eclass/cmake-utils.eclass
>> +++ b/eclass/cmake-utils.eclass
>> @@ -161,6 +161,11 @@ unset CMAKEDEPEND
>> _cmake_use_me_now() {
>> 	debug-print-function ${FUNCNAME} "$@"
>>
>> +	local arg=$2
>> +	[[ ! -z $3 ]] && arg=$3
>> +
>> +	has "${EAPI:-0}" 2 3 4 5 || die "${FUNCNAME[1]} is banned in EAPI 6
>> and later: use -D$1${arg}=\"\$(usex $2)\" instead"
>> +
>> 	local uper capitalised x
>> 	[[ -z $2 ]] && die "cmake-utils_use-$1 <USE flag> [<flag name>]"
>> 	if [[ ! -z $3 ]]; then
>> @@ -178,6 +183,13 @@ _cmake_use_me_now() {
>> _cmake_use_me_now_inverted() {
>> 	debug-print-function ${FUNCNAME} "$@"
>>
>> +	local arg=$2
>> +	[[ ! -z $3 ]] && arg=$3
>> +
>> +	if ! has "${EAPI:-0}" 2 3 4 5 && [[ "${FUNCNAME[1]}" !=
>> cmake-utils_use_find_package ]] ; then
>> +		die "${FUNCNAME[1]} is banned in EAPI 6 and later: use
>> -D$1${arg}=\"\$(usex $2)\" insteadss"
>> +	fi
>> +
>> 	local uper capitalised x
>> 	[[ -z $2 ]] && die "cmake-utils_use-$1 <USE flag> [<flag name>]"
>> 	if [[ ! -z $3 ]]; then
> 
> I suggest making it more explicit what kind of helper functions are banned in the commit message.
> 

I'll add the full list of affected functions.



^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2016-01-22  9:45 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-20 10:42 [gentoo-dev] [PATCH 00/15] EAPI 6 support for cmake-utils.eclas Michael Palimaka
2016-01-20 10:42 ` [gentoo-dev] [PATCH 01/15] cmake-utils.eclass: reorder a bit Michael Palimaka
2016-01-20 10:43 ` [gentoo-dev] [PATCH 02/15] cmake-utils.eclass: declare some variables local Michael Palimaka
2016-01-20 10:43 ` [gentoo-dev] [PATCH 03/15] cmake-utils.eclass: check exit codes of executed commands Michael Palimaka
2016-01-20 10:43 ` [gentoo-dev] [PATCH 04/15] cmake-utils.eclass: use a proper if statement Michael Palimaka
2016-01-20 10:43 ` [gentoo-dev] [PATCH 05/15] cmake-utils.eclass: remove duplicate CMAKE_REMOVE_MODULES Michael Palimaka
2016-01-20 10:43 ` [gentoo-dev] [PATCH 06/15] cmake-utils.eclass: ban WANT_CMAKE in EAPI 6 and later Michael Palimaka
2016-01-20 10:43 ` [gentoo-dev] [PATCH 07/15] cmake-utils.eclass: replace replace comment_add_subdirectory with a namespaced version Michael Palimaka
2016-01-21 16:29   ` Michał Górny
2016-01-22  9:36     ` [gentoo-dev] " Michael Palimaka
2016-01-20 10:43 ` [gentoo-dev] [PATCH 08/15] cmake-utils.eclass: namespace some private functions Michael Palimaka
2016-01-20 10:43 ` [gentoo-dev] [PATCH 09/15] cmake-utils.eclass: move $S modifications to src_prepare in EAPI 6 and later Michael Palimaka
2016-01-20 10:43 ` [gentoo-dev] [PATCH 10/15] cmake-utils.eclass: ban non-array usage of mycmakeargs " Michael Palimaka
2016-01-20 10:43 ` [gentoo-dev] [PATCH 11/15] cmake-utils.eclass: use default_src_prepare " Michael Palimaka
2016-01-20 10:43 ` [gentoo-dev] [PATCH 12/15] cmake-utils.eclass: require two arguments for cmake-utils_use_find_package " Michael Palimaka
2016-01-20 10:43 ` [gentoo-dev] [PATCH 13/15] cmake-utils.eclass: ban helper functions " Michael Palimaka
2016-01-21 16:31   ` Michał Górny
2016-01-22  9:36     ` [gentoo-dev] " Michael Palimaka
2016-01-20 10:43 ` [gentoo-dev] [PATCH 14/15] cmake-utils.eclass: enable EAPI 6 Michael Palimaka
2016-01-20 10:43 ` [gentoo-dev] [PATCH 15/15] cmake-utils.eclass: update copyright year Michael Palimaka
2016-01-21 16:32   ` Michał Górny
2016-01-22  9:34     ` [gentoo-dev] " Michael Palimaka

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox