public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] [PATCH 1/3] ruby-ng.eclass: add support for EAPI=6
@ 2017-02-19  8:03 Hans de Graaff
  2017-02-19  8:03 ` [gentoo-dev] [PATCH 2/3] ruby-ng.eclass: Use eapply for RUBY_PATCHES in EAPI 6 Hans de Graaff
  2017-02-19  8:03 ` [gentoo-dev] [PATCH 3/3] ruby-ng.eclass: Remove support for jruby " Hans de Graaff
  0 siblings, 2 replies; 7+ messages in thread
From: Hans de Graaff @ 2017-02-19  8:03 UTC (permalink / raw
  To: gentoo-dev; +Cc: Hans de Graaff

---
 eclass/ruby-ng.eclass | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/eclass/ruby-ng.eclass b/eclass/ruby-ng.eclass
index c83778d..cd6a5ae 100644
--- a/eclass/ruby-ng.eclass
+++ b/eclass/ruby-ng.eclass
@@ -81,7 +81,7 @@ case ${EAPI} in
 	0|1)
 		die "Unsupported EAPI=${EAPI} (too old) for ruby-ng.eclass" ;;
 	2|3) ;;
-	4|5)
+	4|5|6)
 		# S is no longer automatically assigned when it doesn't exist.
 		S="${WORKDIR}"
 		;;
@@ -263,7 +263,7 @@ ruby_get_use_targets() {
 # confuse this function with ruby_implementation_depend().
 #
 # @EXAMPLE:
-# EAPI=4
+# EAPI=6
 # RUBY_OPTIONAL=yes
 #
 # inherit ruby-ng
@@ -286,7 +286,7 @@ if [[ ${RUBY_OPTIONAL} != yes ]]; then
 	RDEPEND="${RDEPEND} $(ruby_implementations_depend)"
 
 	case ${EAPI:-0} in
-		4|5)
+		4|5|6)
 			REQUIRED_USE+=" || ( $(ruby_get_use_targets) )"
 			;;
 	esac
@@ -295,7 +295,7 @@ fi
 _ruby_invoke_environment() {
 	old_S=${S}
 	case ${EAPI} in
-		4|5)
+		4|5|6)
 			if [ -z "${RUBY_S}" ]; then
 				sub_S=${P}
 			else
@@ -434,6 +434,12 @@ ruby-ng_src_prepare() {
 
 	_ruby_invoke_environment all _ruby_apply_patches
 
+	case ${EAPI} in
+		6)
+			eapply_user
+			;;
+	esac
+
 	_PHASE="source copy" \
 		_ruby_each_implementation _ruby_source_copy
 
-- 
2.10.2



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

* [gentoo-dev] [PATCH 2/3] ruby-ng.eclass: Use eapply for RUBY_PATCHES in EAPI 6
  2017-02-19  8:03 [gentoo-dev] [PATCH 1/3] ruby-ng.eclass: add support for EAPI=6 Hans de Graaff
@ 2017-02-19  8:03 ` Hans de Graaff
  2017-02-19  8:26   ` Michał Górny
  2017-02-19  8:03 ` [gentoo-dev] [PATCH 3/3] ruby-ng.eclass: Remove support for jruby " Hans de Graaff
  1 sibling, 1 reply; 7+ messages in thread
From: Hans de Graaff @ 2017-02-19  8:03 UTC (permalink / raw
  To: gentoo-dev; +Cc: Hans de Graaff

This also removes the need for inheriting eutils in EAPI 6.
---
 eclass/ruby-ng.eclass | 23 ++++++++++++++++++++---
 1 file changed, 20 insertions(+), 3 deletions(-)

diff --git a/eclass/ruby-ng.eclass b/eclass/ruby-ng.eclass
index cd6a5ae..bc42e66 100644
--- a/eclass/ruby-ng.eclass
+++ b/eclass/ruby-ng.eclass
@@ -73,7 +73,14 @@
 # (e.g. selenium's firefox driver extension). When set this argument is
 # passed to "grep -E" to remove reporting of these shared objects.
 
-inherit eutils java-utils-2 multilib toolchain-funcs ruby-utils
+local inherits=""
+case ${EAPI} in
+	2|3|4|5)
+		inherits="eutils"
+		;;
+esac
+
+inherit ${inherits} java-utils-2 multilib toolchain-funcs ruby-utils
 
 EXPORT_FUNCTIONS src_unpack src_prepare src_configure src_compile src_test src_install pkg_setup
 
@@ -400,13 +407,23 @@ ruby-ng_src_unpack() {
 
 _ruby_apply_patches() {
 	for patch in "${RUBY_PATCHES[@]}"; do
+		local patch_file=""
 		if [ -f "${patch}" ]; then
-			epatch "${patch}"
+			patch_file="${patch}"
 		elif [ -f "${FILESDIR}/${patch}" ]; then
-			epatch "${FILESDIR}/${patch}"
+			patch_file="${FILESDIR}/${patch}"
 		else
 			die "Cannot find patch ${patch}"
 		fi
+
+		case ${EAPI} in
+			2|3|4|5)
+				epatch "${patch_file}"
+				;;
+			6)
+				eapply "${patch_file}"
+				;;
+		esac
 	done
 
 	# This is a special case: instead of executing just in the special
-- 
2.10.2



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

* [gentoo-dev] [PATCH 3/3] ruby-ng.eclass: Remove support for jruby in EAPI 6
  2017-02-19  8:03 [gentoo-dev] [PATCH 1/3] ruby-ng.eclass: add support for EAPI=6 Hans de Graaff
  2017-02-19  8:03 ` [gentoo-dev] [PATCH 2/3] ruby-ng.eclass: Use eapply for RUBY_PATCHES in EAPI 6 Hans de Graaff
@ 2017-02-19  8:03 ` Hans de Graaff
  2017-02-19  8:29   ` Michał Górny
  1 sibling, 1 reply; 7+ messages in thread
From: Hans de Graaff @ 2017-02-19  8:03 UTC (permalink / raw
  To: gentoo-dev; +Cc: Hans de Graaff

jruby has not been supported for some time. Removing support for it in
EAPI 6 allows us to drop the java-utils-2 eclass which in turn also
inherits eutils.
---
 eclass/ruby-ng.eclass | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/eclass/ruby-ng.eclass b/eclass/ruby-ng.eclass
index bc42e66..8a3bc18 100644
--- a/eclass/ruby-ng.eclass
+++ b/eclass/ruby-ng.eclass
@@ -76,11 +76,11 @@
 local inherits=""
 case ${EAPI} in
 	2|3|4|5)
-		inherits="eutils"
+		inherits="eutils java-utils-2"
 		;;
 esac
 
-inherit ${inherits} java-utils-2 multilib toolchain-funcs ruby-utils
+inherit ${inherits} multilib toolchain-funcs ruby-utils
 
 EXPORT_FUNCTIONS src_unpack src_prepare src_configure src_compile src_test src_install pkg_setup
 
@@ -385,7 +385,11 @@ ruby-ng_pkg_setup() {
 	# it's a special case.
 	_ruby_each_implementation
 
-	has ruby_targets_jruby ${IUSE} && use ruby_targets_jruby && java-pkg_setup-vm
+	case ${EAPI} in
+		2|3|4|5)
+			has ruby_targets_jruby ${IUSE} && use ruby_targets_jruby && java-pkg_setup-vm
+			;;
+	esac
 }
 
 # @FUNCTION: ruby-ng_src_unpack
-- 
2.10.2



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

* Re: [gentoo-dev] [PATCH 2/3] ruby-ng.eclass: Use eapply for RUBY_PATCHES in EAPI 6
  2017-02-19  8:03 ` [gentoo-dev] [PATCH 2/3] ruby-ng.eclass: Use eapply for RUBY_PATCHES in EAPI 6 Hans de Graaff
@ 2017-02-19  8:26   ` Michał Górny
  2017-02-21 19:20     ` Hans de Graaff
  0 siblings, 1 reply; 7+ messages in thread
From: Michał Górny @ 2017-02-19  8:26 UTC (permalink / raw
  To: gentoo-dev; +Cc: Hans de Graaff

[-- Attachment #1: Type: text/plain, Size: 1770 bytes --]

W dniu 19.02.2017, nie o godzinie 09∶03 +0100, użytkownik Hans de Graaff
napisał:
> This also removes the need for inheriting eutils in EAPI 6.
> ---
>  eclass/ruby-ng.eclass | 23 ++++++++++++++++++++---
>  1 file changed, 20 insertions(+), 3 deletions(-)
> 
> diff --git a/eclass/ruby-ng.eclass b/eclass/ruby-ng.eclass
> index cd6a5ae..bc42e66 100644
> --- a/eclass/ruby-ng.eclass
> +++ b/eclass/ruby-ng.eclass
> @@ -73,7 +73,14 @@
>  # (e.g. selenium's firefox driver extension). When set this argument is
>  # passed to "grep -E" to remove reporting of these shared objects.
>  
> -inherit eutils java-utils-2 multilib toolchain-funcs ruby-utils
> +local inherits=""
> +case ${EAPI} in
> +	2|3|4|5)
> +		inherits="eutils"
> +		;;
> +esac
> +
> +inherit ${inherits} java-utils-2 multilib toolchain-funcs ruby-utils
>  
>  EXPORT_FUNCTIONS src_unpack src_prepare src_configure src_compile src_test src_install pkg_setup
>  
> @@ -400,13 +407,23 @@ ruby-ng_src_unpack() {
>  
>  _ruby_apply_patches() {
>  	for patch in "${RUBY_PATCHES[@]}"; do
> +		local patch_file=""
>  		if [ -f "${patch}" ]; then
> -			epatch "${patch}"
> +			patch_file="${patch}"
>  		elif [ -f "${FILESDIR}/${patch}" ]; then
> -			epatch "${FILESDIR}/${patch}"
> +			patch_file="${FILESDIR}/${patch}"

Wouldn't EAPI 6 be a good opportunity to kill this dualism and just
require people to say FILESDIR explicitly?

>  		else
>  			die "Cannot find patch ${patch}"
>  		fi
> +
> +		case ${EAPI} in
> +			2|3|4|5)
> +				epatch "${patch_file}"
> +				;;
> +			6)
> +				eapply "${patch_file}"
> +				;;
> +		esac
>  	done
>  
>  	# This is a special case: instead of executing just in the special

-- 
Best regards,
Michał Górny

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 963 bytes --]

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

* Re: [gentoo-dev] [PATCH 3/3] ruby-ng.eclass: Remove support for jruby in EAPI 6
  2017-02-19  8:03 ` [gentoo-dev] [PATCH 3/3] ruby-ng.eclass: Remove support for jruby " Hans de Graaff
@ 2017-02-19  8:29   ` Michał Górny
  2017-02-21 19:15     ` Hans de Graaff
  0 siblings, 1 reply; 7+ messages in thread
From: Michał Górny @ 2017-02-19  8:29 UTC (permalink / raw
  To: gentoo-dev; +Cc: Hans de Graaff

[-- Attachment #1: Type: text/plain, Size: 1500 bytes --]

W dniu 19.02.2017, nie o godzinie 09∶03 +0100, użytkownik Hans de Graaff
napisał:
> jruby has not been supported for some time. Removing support for it in
> EAPI 6 allows us to drop the java-utils-2 eclass which in turn also
> inherits eutils.
> ---
>  eclass/ruby-ng.eclass | 10 +++++++---
>  1 file changed, 7 insertions(+), 3 deletions(-)
> 
> diff --git a/eclass/ruby-ng.eclass b/eclass/ruby-ng.eclass
> index bc42e66..8a3bc18 100644
> --- a/eclass/ruby-ng.eclass
> +++ b/eclass/ruby-ng.eclass
> @@ -76,11 +76,11 @@
>  local inherits=""
>  case ${EAPI} in
>  	2|3|4|5)
> -		inherits="eutils"
> +		inherits="eutils java-utils-2"
>  		;;
>  esac
>  
> -inherit ${inherits} java-utils-2 multilib toolchain-funcs ruby-utils
> +inherit ${inherits} multilib toolchain-funcs ruby-utils
>  
>  EXPORT_FUNCTIONS src_unpack src_prepare src_configure src_compile src_test src_install pkg_setup
>  
> @@ -385,7 +385,11 @@ ruby-ng_pkg_setup() {
>  	# it's a special case.
>  	_ruby_each_implementation
>  
> -	has ruby_targets_jruby ${IUSE} && use ruby_targets_jruby && java-pkg_setup-vm
> +	case ${EAPI} in
> +		2|3|4|5)
> +			has ruby_targets_jruby ${IUSE} && use ruby_targets_jruby && java-pkg_setup-vm

Hmm, don't you have to change something more to make jruby disappear
from the targets? Like, ban it in ruby_get_use_targets() or something
like that?

> +			;;
> +	esac
>  }
>  
>  # @FUNCTION: ruby-ng_src_unpack

-- 
Best regards,
Michał Górny

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 963 bytes --]

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

* Re: [gentoo-dev] [PATCH 3/3] ruby-ng.eclass: Remove support for jruby in EAPI 6
  2017-02-19  8:29   ` Michał Górny
@ 2017-02-21 19:15     ` Hans de Graaff
  0 siblings, 0 replies; 7+ messages in thread
From: Hans de Graaff @ 2017-02-21 19:15 UTC (permalink / raw
  To: gentoo-dev

[-- Attachment #1: Type: text/plain, Size: 671 bytes --]

On Sun, 2017-02-19 at 09:29 +0100, Michał Górny wrote:
> W dniu 19.02.2017, nie o godzinie 09∶03 +0100, użytkownik Hans de
> Graaff
> napisał:
> > 
> > jruby has not been supported for some time. Removing support for it
> > in
> > EAPI 6 allows us to drop the java-utils-2 eclass which in turn also
> > inherits eutils.
> > 
> Hmm, don't you have to change something more to make jruby disappear
> from the targets? Like, ban it in ruby_get_use_targets() or something
> like that?

Maybe. I guess it makes more sense to drop all jruby support at the
same time (including packages, profiles, and eclasses), so I'll skip
this patch for now.

Hans

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

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

* Re: [gentoo-dev] [PATCH 2/3] ruby-ng.eclass: Use eapply for RUBY_PATCHES in EAPI 6
  2017-02-19  8:26   ` Michał Górny
@ 2017-02-21 19:20     ` Hans de Graaff
  0 siblings, 0 replies; 7+ messages in thread
From: Hans de Graaff @ 2017-02-21 19:20 UTC (permalink / raw
  To: gentoo-dev

[-- Attachment #1: Type: text/plain, Size: 3353 bytes --]

On Sun, 2017-02-19 at 09:26 +0100, Michał Górny wrote:
> W dniu 19.02.2017, nie o godzinie 09∶03 +0100, użytkownik Hans de
> Graaff
> napisał:
> > 
> > This also removes the need for inheriting eutils in EAPI 6.
> > 
> Wouldn't EAPI 6 be a good opportunity to kill this dualism and just
> require people to say FILESDIR explicitly?

Which made me think: why have RUBY_PATCHES at all. I think we added
that at the time to allow bash arrays as input. So I've changed this
patch to use the default phase in EAPI 6 instead, removing the need for
explicit eapply_user and PATCHES support.

Hans

1b2b8abde99a59e72fbcc0bc8f9e835dcaee2176
Author:     Hans de Graaff <graaff@gentoo.org>
AuthorDate: Sun Feb 19 08:42:31 2017 +0100
Commit:     Hans de Graaff <graaff@gentoo.org>
CommitDate: Tue Feb 21 20:18:17 2017 +0100

Parent:     1d36503 ruby-ng.eclass: add support for EAPI=6
Merged:     eapi6 master
Containing: eapi6

ruby-ng.eclass: use the default src_prepare in EAPI 6

This removes the need for inheriting eutils in EAPI 6.  It also use
the standard PATCHES support instead of RUBY_PATCHES, which was
introduced to handle arrays on patches at the time.

The default phase also handles eapply_user to handle user patches.

1 file changed, 30 insertions(+), 13 deletions(-)
eclass/ruby-ng.eclass | 43 ++++++++++++++++++++++++++++++-------------

modified   eclass/ruby-ng.eclass
@@ -73,7 +73,14 @@
 # (e.g. selenium's firefox driver extension). When set this argument
is
 # passed to "grep -E" to remove reporting of these shared objects.
 
-inherit eutils java-utils-2 multilib toolchain-funcs ruby-utils
+local inherits=""
+case ${EAPI} in
+	2|3|4|5)
+		inherits="eutils"
+		;;
+esac
+
+inherit ${inherits} java-utils-2 multilib toolchain-funcs ruby-utils
 
 EXPORT_FUNCTIONS src_unpack src_prepare src_configure src_compile
src_test src_install pkg_setup
 
@@ -399,15 +406,24 @@ ruby-ng_src_unpack() {
 }
 
 _ruby_apply_patches() {
-	for patch in "${RUBY_PATCHES[@]}"; do
-		if [ -f "${patch}" ]; then
-			epatch "${patch}"
-		elif [ -f "${FILESDIR}/${patch}" ]; then
-			epatch "${FILESDIR}/${patch}"
-		else
-			die "Cannot find patch ${patch}"
-		fi
-	done
+	case ${EAPI} in
+		2|3|4|5)
+			for patch in "${RUBY_PATCHES[@]}"; do
+				if [ -f "${patch}" ]; then
+					epatch "${patch}"
+				elif [ -f "${FILESDIR}/${patch}" ];
then
+					epatch "${FILESDIR}/${patch}"
+				else
+					die "Cannot find patch
${patch}"
+				fi
+			done
+			;;
+		6)
+			if [[ -n ${RUBY_PATCHES[@]} ]]; then
+			   eqawarn "RUBY_PATCHES is no longer
supported, use PATCHES instead"
+			fi
+			;;
+	esac
 
 	# This is a special case: instead of executing just in the
special
 	# "all" environment, this will actually copy the effects on
_all_
@@ -432,14 +448,15 @@ ruby-ng_src_prepare() {
 	# almost every other ebuild.
 	find . -name '._*' -delete
 
-	_ruby_invoke_environment all _ruby_apply_patches
-
+	# Handle PATCHES and user supplied patches via the default
phase
 	case ${EAPI} in
 		6)
-			eapply_user
+			_ruby_invoke_environment all default
 			;;
 	esac
 
+	_ruby_invoke_environment all _ruby_apply_patches
+
 	_PHASE="source copy" \
 		_ruby_each_implementation _ruby_source_copy
 

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

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

end of thread, other threads:[~2017-02-21 19:21 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-02-19  8:03 [gentoo-dev] [PATCH 1/3] ruby-ng.eclass: add support for EAPI=6 Hans de Graaff
2017-02-19  8:03 ` [gentoo-dev] [PATCH 2/3] ruby-ng.eclass: Use eapply for RUBY_PATCHES in EAPI 6 Hans de Graaff
2017-02-19  8:26   ` Michał Górny
2017-02-21 19:20     ` Hans de Graaff
2017-02-19  8:03 ` [gentoo-dev] [PATCH 3/3] ruby-ng.eclass: Remove support for jruby " Hans de Graaff
2017-02-19  8:29   ` Michał Górny
2017-02-21 19:15     ` Hans de Graaff

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