public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] [PATCH 0/8] EAPI 7 in my eclasses, part one
@ 2018-05-03 10:18 Michał Górny
  2018-05-03 10:18 ` [gentoo-dev] [PATCH 1/8] bash-completion-r1.eclass: Allow EAPI 7 (no changes) Michał Górny
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: Michał Górny @ 2018-05-03 10:18 UTC (permalink / raw
  To: gentoo-dev; +Cc: Michał Górny

Hi,

Here's quick batch of patches that enable EAPI 7 support in most
of my eclasses.  Only git-r3, multilib-build and scons-utils eclasses
ask for specific changes -- the remaining cases required just confirming
that things work.

I have intentionally skipped llvm.eclass here as I need to figure out
how it's supposed to work wrt DEPEND/BDEPEND.  Also python@ eclasses
are deferred into a second batch.

--
Best regards,
Michał Górny


Michał Górny (8):
  bash-completion-r1.eclass: Allow EAPI 7 (no changes)
  git-r3.eclass: Support EAPI 7
  multibuild.eclass: Enable EAPI 7 (no changes)
  multilib-build.eclass: Enable EAPI 7 support
  ninja-utils.eclass: Enable EAPI 7 (no changes)
  out-of-source.eclass: Enable EAPI 7 (no changes)
  scons-utils.eclass: Support EAPI 7
  multilib-minimal.eclass: Enable EAPI 7 (no changes)

 eclass/bash-completion-r1.eclass |  4 ++--
 eclass/git-r3.eclass             | 39 ++++++++++++++++++++++----------
 eclass/multibuild.eclass         |  4 ++--
 eclass/multilib-build.eclass     | 22 +++++++++---------
 eclass/multilib-minimal.eclass   |  4 ++--
 eclass/ninja-utils.eclass        |  4 ++--
 eclass/out-of-source.eclass      |  4 ++--
 eclass/scons-utils.eclass        | 13 +++++++----
 8 files changed, 57 insertions(+), 37 deletions(-)

-- 
2.17.0



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

* [gentoo-dev] [PATCH 1/8] bash-completion-r1.eclass: Allow EAPI 7 (no changes)
  2018-05-03 10:18 [gentoo-dev] [PATCH 0/8] EAPI 7 in my eclasses, part one Michał Górny
@ 2018-05-03 10:18 ` Michał Górny
  2018-05-03 10:18 ` [gentoo-dev] [PATCH 2/8] git-r3.eclass: Support EAPI 7 Michał Górny
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Michał Górny @ 2018-05-03 10:18 UTC (permalink / raw
  To: gentoo-dev; +Cc: Michał Górny

---
 eclass/bash-completion-r1.eclass | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/eclass/bash-completion-r1.eclass b/eclass/bash-completion-r1.eclass
index eb2dfce4c7fe..eff5e68c437e 100644
--- a/eclass/bash-completion-r1.eclass
+++ b/eclass/bash-completion-r1.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2014 Gentoo Foundation
+# Copyright 1999-2018 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 # @ECLASS: bash-completion-r1.eclass
@@ -25,7 +25,7 @@
 inherit toolchain-funcs
 
 case ${EAPI:-0} in
-	0|1|2|3|4|5|6) ;;
+	0|1|2|3|4|5|6|7) ;;
 	*) die "EAPI ${EAPI} unsupported (yet)."
 esac
 
-- 
2.17.0



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

* [gentoo-dev] [PATCH 2/8] git-r3.eclass: Support EAPI 7
  2018-05-03 10:18 [gentoo-dev] [PATCH 0/8] EAPI 7 in my eclasses, part one Michał Górny
  2018-05-03 10:18 ` [gentoo-dev] [PATCH 1/8] bash-completion-r1.eclass: Allow EAPI 7 (no changes) Michał Górny
@ 2018-05-03 10:18 ` Michał Górny
  2018-05-03 10:18 ` [gentoo-dev] [PATCH 3/8] multibuild.eclass: Enable EAPI 7 (no changes) Michał Górny
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Michał Górny @ 2018-05-03 10:18 UTC (permalink / raw
  To: gentoo-dev; +Cc: Michał Górny

Enable support for EAPI 7.  Use BDEPEND for dev-vcs/git dependency
since git is run at build time.  Update has_version logic appropriately.
---
 eclass/git-r3.eclass | 39 +++++++++++++++++++++++++++------------
 1 file changed, 27 insertions(+), 12 deletions(-)

diff --git a/eclass/git-r3.eclass b/eclass/git-r3.eclass
index 75a589d0168d..279f03269314 100644
--- a/eclass/git-r3.eclass
+++ b/eclass/git-r3.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2017 Gentoo Foundation
+# Copyright 1999-2018 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 # @ECLASS: git-r3.eclass
@@ -10,7 +10,7 @@
 # git as remote repository.
 
 case "${EAPI:-0}" in
-	0|1|2|3|4|5|6)
+	0|1|2|3|4|5|6|7)
 		;;
 	*)
 		die "Unsupported EAPI=${EAPI} (unknown) for ${ECLASS}"
@@ -22,7 +22,11 @@ EXPORT_FUNCTIONS src_unpack
 if [[ ! ${_GIT_R3} ]]; then
 
 if [[ ! ${_INHERITED_BY_GIT_2} ]]; then
-	DEPEND=">=dev-vcs/git-1.8.2.1"
+	if [[ ${EAPI:-0} != [0123456] ]]; then
+		BDEPEND=">=dev-vcs/git-1.8.2.1"
+	else
+		DEPEND=">=dev-vcs/git-1.8.2.1"
+	fi
 fi
 
 # @ECLASS-VARIABLE: EGIT_CLONE_TYPE
@@ -648,16 +652,27 @@ git-r3_fetch() {
 			local clone_type=${EGIT_CLONE_TYPE}
 
 			if [[ ${r} == http://* || ${r} == https://* ]] &&
-					[[ ! ${EGIT_CURL_WARNED} ]] &&
-					! ROOT=/ has_version 'dev-vcs/git[curl]'
+					[[ ! ${EGIT_CURL_WARNED} ]]
 			then
-				ewarn "git-r3: fetching from HTTP(S) requested. In order to support HTTP(S),"
-				ewarn "dev-vcs/git needs to be built with USE=curl. Example solution:"
-				ewarn
-				ewarn "	echo dev-vcs/git curl >> /etc/portage/package.use"
-				ewarn "	emerge -1v dev-vcs/git"
-				ewarn
-				ewarn "HTTP(S) URIs will be skipped."
+				case ${EAPI:-0} in
+					0|1|2|3|4)
+						ROOT=/ has_version 'dev-vcs/git[curl]';;
+					5|6)
+						has_version --host-root 'dev-vcs/git[curl]';;
+					*)
+						has_version -b 'dev-vcs/git[curl]';;
+				esac
+
+				if [[ ${?} -ne 0 ]]; then
+					ewarn "git-r3: fetching from HTTP(S) requested. In order to support HTTP(S),"
+					ewarn "dev-vcs/git needs to be built with USE=curl. Example solution:"
+					ewarn
+					ewarn "	echo dev-vcs/git curl >> /etc/portage/package.use"
+					ewarn "	emerge -1v dev-vcs/git"
+					ewarn
+					ewarn "HTTP(S) URIs will be skipped."
+				fi
+
 				EGIT_CURL_WARNED=1
 			fi
 
-- 
2.17.0



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

* [gentoo-dev] [PATCH 3/8] multibuild.eclass: Enable EAPI 7 (no changes)
  2018-05-03 10:18 [gentoo-dev] [PATCH 0/8] EAPI 7 in my eclasses, part one Michał Górny
  2018-05-03 10:18 ` [gentoo-dev] [PATCH 1/8] bash-completion-r1.eclass: Allow EAPI 7 (no changes) Michał Górny
  2018-05-03 10:18 ` [gentoo-dev] [PATCH 2/8] git-r3.eclass: Support EAPI 7 Michał Górny
@ 2018-05-03 10:18 ` Michał Górny
  2018-05-03 10:18 ` [gentoo-dev] [PATCH 4/8] multilib-build.eclass: Enable EAPI 7 support Michał Górny
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Michał Górny @ 2018-05-03 10:18 UTC (permalink / raw
  To: gentoo-dev; +Cc: Michał Górny

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

diff --git a/eclass/multibuild.eclass b/eclass/multibuild.eclass
index 0f89e4ec0b83..9574e3debadb 100644
--- a/eclass/multibuild.eclass
+++ b/eclass/multibuild.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2014 Gentoo Foundation
+# Copyright 1999-2018 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 # @ECLASS: multibuild.eclass
@@ -16,7 +16,7 @@ case "${EAPI:-0}" in
 	0|1|2|3)
 		die "Unsupported EAPI=${EAPI:-0} (too old) for ${ECLASS}"
 		;;
-	4|5|6)
+	4|5|6|7)
 		;;
 	*)
 		die "Unsupported EAPI=${EAPI} (unknown) for ${ECLASS}"
-- 
2.17.0



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

* [gentoo-dev] [PATCH 4/8] multilib-build.eclass: Enable EAPI 7 support
  2018-05-03 10:18 [gentoo-dev] [PATCH 0/8] EAPI 7 in my eclasses, part one Michał Górny
                   ` (2 preceding siblings ...)
  2018-05-03 10:18 ` [gentoo-dev] [PATCH 3/8] multibuild.eclass: Enable EAPI 7 (no changes) Michał Górny
@ 2018-05-03 10:18 ` Michał Górny
  2018-05-03 10:18 ` [gentoo-dev] [PATCH 5/8] ninja-utils.eclass: Enable EAPI 7 (no changes) Michał Górny
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Michał Górny @ 2018-05-03 10:18 UTC (permalink / raw
  To: gentoo-dev; +Cc: Michał Górny

Enable EAPI 7.  Correct all ${ED} references to account both for
trailing slash being present and absent.
---
 eclass/multilib-build.eclass | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/eclass/multilib-build.eclass b/eclass/multilib-build.eclass
index 6356350c43b3..261f0f4a170b 100644
--- a/eclass/multilib-build.eclass
+++ b/eclass/multilib-build.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2015 Gentoo Foundation
+# Copyright 1999-2018 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 # @ECLASS: multilib-build.eclass
@@ -20,7 +20,7 @@ if [[ ! ${_MULTILIB_BUILD} ]]; then
 
 # EAPI=4 is required for meaningful MULTILIB_USEDEP.
 case ${EAPI:-0} in
-	4|5|6) ;;
+	4|5|6|7) ;;
 	*) die "EAPI=${EAPI} is not supported" ;;
 esac
 
@@ -269,8 +269,8 @@ multilib_check_headers() {
 	_multilib_header_cksum() {
 		set -o pipefail
 
-		if [[ -d ${ED}usr/include ]]; then
-			find "${ED}"usr/include -type f \
+		if [[ -d ${ED%/}/usr/include ]]; then
+			find "${ED%/}"/usr/include -type f \
 				-exec cksum {} + | sort -k2
 		fi
 	}
@@ -390,7 +390,7 @@ multilib_prepare_wrappers() {
 
 	[[ ${#} -le 1 ]] || die "${FUNCNAME}: too many arguments"
 
-	local root=${1:-${ED}}
+	local root=${1:-${ED%/}}
 	local f
 
 	if [[ ${COMPLETE_MULTILIB} == yes ]]; then
@@ -458,9 +458,9 @@ multilib_prepare_wrappers() {
 
 				# Some ABIs may have install less files than others.
 				if [[ -f ${root}/usr/include${f} ]]; then
-					local wrapper=${ED}/tmp/multilib-include${f}
+					local wrapper=${ED%/}/tmp/multilib-include${f}
 
-					if [[ ! -f ${ED}/tmp/multilib-include${f} ]]; then
+					if [[ ! -f ${ED%/}/tmp/multilib-include${f} ]]; then
 						dodir "/tmp/multilib-include${dir}"
 						# a generic template
 						cat > "${wrapper}" <<_EOF_ || die
@@ -518,7 +518,7 @@ _EOF_
 
 					# $CHOST shall be set by multilib_toolchain_setup
 					dodir "/tmp/multilib-include/${CHOST}${dir}"
-					mv "${root}/usr/include${f}" "${ED}/tmp/multilib-include/${CHOST}${dir}/" || die
+					mv "${root}/usr/include${f}" "${ED%/}/tmp/multilib-include/${CHOST}${dir}/" || die
 
 					# Note: match a space afterwards to avoid collision potential.
 					sed -e "/${MULTILIB_ABI_FLAG} /s&error.*&include <${CHOST}${f}>&" \
@@ -558,11 +558,11 @@ multilib_install_wrappers() {
 
 	local root=${1:-${ED}}
 
-	if [[ -d "${ED}"/tmp/multilib-include ]]; then
+	if [[ -d ${ED%/}/tmp/multilib-include ]]; then
 		multibuild_merge_root \
-			"${ED}"/tmp/multilib-include "${root}"/usr/include
+			"${ED%/}"/tmp/multilib-include "${root}"/usr/include
 		# it can fail if something else uses /tmp
-		rmdir "${ED}"/tmp &>/dev/null
+		rmdir "${ED%/}"/tmp &>/dev/null
 	fi
 }
 
-- 
2.17.0



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

* [gentoo-dev] [PATCH 5/8] ninja-utils.eclass: Enable EAPI 7 (no changes)
  2018-05-03 10:18 [gentoo-dev] [PATCH 0/8] EAPI 7 in my eclasses, part one Michał Górny
                   ` (3 preceding siblings ...)
  2018-05-03 10:18 ` [gentoo-dev] [PATCH 4/8] multilib-build.eclass: Enable EAPI 7 support Michał Górny
@ 2018-05-03 10:18 ` Michał Górny
  2018-05-03 10:18 ` [gentoo-dev] [PATCH 6/8] out-of-source.eclass: " Michał Górny
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Michał Górny @ 2018-05-03 10:18 UTC (permalink / raw
  To: gentoo-dev; +Cc: Michał Górny

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

diff --git a/eclass/ninja-utils.eclass b/eclass/ninja-utils.eclass
index 69216176ba61..0a390ed89612 100644
--- a/eclass/ninja-utils.eclass
+++ b/eclass/ninja-utils.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2017 Gentoo Foundation
+# Copyright 1999-2018 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 # @ECLASS: ninja-utils.eclass
@@ -22,7 +22,7 @@ if [[ -z ${_NINJA_UTILS_ECLASS} ]]; then
 case ${EAPI:-0} in
 	0|1|3) die "EAPI=${EAPI:-0} is not supported (too old)";;
 	# copied from cmake-utils
-	2|4|5|6) ;;
+	2|4|5|6|7) ;;
 	*) die "EAPI=${EAPI} is not yet supported" ;;
 esac
 
-- 
2.17.0



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

* [gentoo-dev] [PATCH 6/8] out-of-source.eclass: Enable EAPI 7 (no changes)
  2018-05-03 10:18 [gentoo-dev] [PATCH 0/8] EAPI 7 in my eclasses, part one Michał Górny
                   ` (4 preceding siblings ...)
  2018-05-03 10:18 ` [gentoo-dev] [PATCH 5/8] ninja-utils.eclass: Enable EAPI 7 (no changes) Michał Górny
@ 2018-05-03 10:18 ` Michał Górny
  2018-05-03 10:18 ` [gentoo-dev] [PATCH 7/8] scons-utils.eclass: Support EAPI 7 Michał Górny
  2018-05-03 10:18 ` [gentoo-dev] [PATCH 8/8] multilib-minimal.eclass: Enable EAPI 7 (no changes) Michał Górny
  7 siblings, 0 replies; 9+ messages in thread
From: Michał Górny @ 2018-05-03 10:18 UTC (permalink / raw
  To: gentoo-dev; +Cc: Michał Górny

---
 eclass/out-of-source.eclass | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/eclass/out-of-source.eclass b/eclass/out-of-source.eclass
index 4d9c8d05fd64..951a20adaca4 100644
--- a/eclass/out-of-source.eclass
+++ b/eclass/out-of-source.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2017 Gentoo Foundation
+# Copyright 1999-2018 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 # @ECLASS: out-of-source.eclass
@@ -32,7 +32,7 @@
 # @CODE
 
 case ${EAPI} in
-	6);;
+	6|7);;
 	*) die "EAPI ${EAPI:-0} unsupported (too old)";;
 esac
 
-- 
2.17.0



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

* [gentoo-dev] [PATCH 7/8] scons-utils.eclass: Support EAPI 7
  2018-05-03 10:18 [gentoo-dev] [PATCH 0/8] EAPI 7 in my eclasses, part one Michał Górny
                   ` (5 preceding siblings ...)
  2018-05-03 10:18 ` [gentoo-dev] [PATCH 6/8] out-of-source.eclass: " Michał Górny
@ 2018-05-03 10:18 ` Michał Górny
  2018-05-03 10:18 ` [gentoo-dev] [PATCH 8/8] multilib-minimal.eclass: Enable EAPI 7 (no changes) Michał Górny
  7 siblings, 0 replies; 9+ messages in thread
From: Michał Górny @ 2018-05-03 10:18 UTC (permalink / raw
  To: gentoo-dev; +Cc: Michał Górny

Enable EAPI 7 support.  Move dev-util/scons to BDEPEND in EAPI 7
since it needs to run on the build host.
---
 eclass/scons-utils.eclass | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/eclass/scons-utils.eclass b/eclass/scons-utils.eclass
index 41a86adfa14a..02c9061ba95d 100644
--- a/eclass/scons-utils.eclass
+++ b/eclass/scons-utils.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2015 Gentoo Foundation
+# Copyright 1999-2018 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 # @ECLASS: scons-utils.eclass
@@ -93,7 +93,7 @@
 # -- EAPI support check --
 
 case ${EAPI:-0} in
-	0|1|2|3|4|5|6) ;;
+	0|1|2|3|4|5|6|7) ;;
 	*) die "EAPI ${EAPI} unsupported."
 esac
 
@@ -102,9 +102,14 @@ inherit multiprocessing
 # -- ebuild variables setup --
 
 if [[ -n ${SCONS_MIN_VERSION} ]]; then
-	DEPEND=">=dev-util/scons-${SCONS_MIN_VERSION}"
+	BDEPEND=">=dev-util/scons-${SCONS_MIN_VERSION}"
 else
-	DEPEND="dev-util/scons"
+	BDEPEND="dev-util/scons"
+fi
+
+if [[ ${EAPI:-0} == [0123456] ]]; then
+	DEPEND=${BDEPEND}
+	unset BDEPEND
 fi
 
 # -- public functions --
-- 
2.17.0



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

* [gentoo-dev] [PATCH 8/8] multilib-minimal.eclass: Enable EAPI 7 (no changes)
  2018-05-03 10:18 [gentoo-dev] [PATCH 0/8] EAPI 7 in my eclasses, part one Michał Górny
                   ` (6 preceding siblings ...)
  2018-05-03 10:18 ` [gentoo-dev] [PATCH 7/8] scons-utils.eclass: Support EAPI 7 Michał Górny
@ 2018-05-03 10:18 ` Michał Górny
  7 siblings, 0 replies; 9+ messages in thread
From: Michał Górny @ 2018-05-03 10:18 UTC (permalink / raw
  To: gentoo-dev; +Cc: Michał Górny

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

diff --git a/eclass/multilib-minimal.eclass b/eclass/multilib-minimal.eclass
index de46762ca61a..ae40eeb25895 100644
--- a/eclass/multilib-minimal.eclass
+++ b/eclass/multilib-minimal.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2014 Gentoo Foundation
+# Copyright 1999-2018 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 # @ECLASS: multilib-minimal.eclass
@@ -24,7 +24,7 @@
 
 # EAPI=4 is required for meaningful MULTILIB_USEDEP.
 case ${EAPI:-0} in
-	4|5|6) ;;
+	4|5|6|7) ;;
 	*) die "EAPI=${EAPI} is not supported" ;;
 esac
 
-- 
2.17.0



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

end of thread, other threads:[~2018-05-03 10:21 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-05-03 10:18 [gentoo-dev] [PATCH 0/8] EAPI 7 in my eclasses, part one Michał Górny
2018-05-03 10:18 ` [gentoo-dev] [PATCH 1/8] bash-completion-r1.eclass: Allow EAPI 7 (no changes) Michał Górny
2018-05-03 10:18 ` [gentoo-dev] [PATCH 2/8] git-r3.eclass: Support EAPI 7 Michał Górny
2018-05-03 10:18 ` [gentoo-dev] [PATCH 3/8] multibuild.eclass: Enable EAPI 7 (no changes) Michał Górny
2018-05-03 10:18 ` [gentoo-dev] [PATCH 4/8] multilib-build.eclass: Enable EAPI 7 support Michał Górny
2018-05-03 10:18 ` [gentoo-dev] [PATCH 5/8] ninja-utils.eclass: Enable EAPI 7 (no changes) Michał Górny
2018-05-03 10:18 ` [gentoo-dev] [PATCH 6/8] out-of-source.eclass: " Michał Górny
2018-05-03 10:18 ` [gentoo-dev] [PATCH 7/8] scons-utils.eclass: Support EAPI 7 Michał Górny
2018-05-03 10:18 ` [gentoo-dev] [PATCH 8/8] multilib-minimal.eclass: Enable EAPI 7 (no changes) Michał Górny

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