commit:     0515195fe51c244e1b85ce0a78b9cea3a7a5c2bc
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sun Apr  9 04:43:48 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Apr  9 04:43:48 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0515195f

net-libs/webkit-gtk: handle more RUBY_EXECUTABLE cases

postprocess-asm invokes another Ruby script by itself, so let's just
fix the shebangs.

Closes: https://bugs.gentoo.org/771744
Signed-off-by: Sam James <sam <AT> gentoo.org>

 net-libs/webkit-gtk/webkit-gtk-2.38.5-r410.ebuild | 9 +++++++--
 net-libs/webkit-gtk/webkit-gtk-2.38.5-r500.ebuild | 9 +++++++--
 net-libs/webkit-gtk/webkit-gtk-2.38.5.ebuild      | 9 +++++++--
 net-libs/webkit-gtk/webkit-gtk-2.40.0-r410.ebuild | 9 +++++++--
 net-libs/webkit-gtk/webkit-gtk-2.40.0-r600.ebuild | 9 +++++++--
 net-libs/webkit-gtk/webkit-gtk-2.40.0.ebuild      | 9 +++++++--
 6 files changed, 42 insertions(+), 12 deletions(-)

diff --git a/net-libs/webkit-gtk/webkit-gtk-2.38.5-r410.ebuild 
b/net-libs/webkit-gtk/webkit-gtk-2.38.5-r410.ebuild
index e153b458de45..d36da49abdb9 100644
--- a/net-libs/webkit-gtk/webkit-gtk-2.38.5-r410.ebuild
+++ b/net-libs/webkit-gtk/webkit-gtk-2.38.5-r410.ebuild
@@ -185,14 +185,19 @@ src_configure() {
        # Ruby situation is a bit complicated. See bug 513888
        local rubyimpl
        local ruby_interpreter=""
+       local RUBY
        for rubyimpl in ${USE_RUBY}; do
                if has_version -b "virtual/rubygems[ruby_targets_${rubyimpl}]"; 
then
-                       ruby_interpreter="-DRUBY_EXECUTABLE=$(type -P 
${rubyimpl})"
+                       RUBY="$(type -P ${rubyimpl})"
+                       ruby_interpreter="-DRUBY_EXECUTABLE=${RUBY}"
                fi
        done
        # This will rarely occur. Only a couple of corner cases could lead us to
        # that failure. See bug 513888
-       [[ -z $ruby_interpreter ]] && die "No suitable ruby interpreter found"
+       [[ -z ${ruby_interpreter} ]] && die "No suitable ruby interpreter found"
+       # JavaScriptCore/Scripts/postprocess-asm invokes another Ruby script 
directly
+       # so it doesn't respect RUBY_EXECUTABLE, bug #771744.
+       sed -i -e "s:#!/usr/bin/env ruby:#!${RUBY}:" $(grep -rl "/usr/bin/env 
ruby" Source/JavaScriptCore || die) || die
 
        # TODO: Check Web Audio support
        # should somehow let user select between them?

diff --git a/net-libs/webkit-gtk/webkit-gtk-2.38.5-r500.ebuild 
b/net-libs/webkit-gtk/webkit-gtk-2.38.5-r500.ebuild
index 2ff1d54297c4..6e59f1ad2650 100644
--- a/net-libs/webkit-gtk/webkit-gtk-2.38.5-r500.ebuild
+++ b/net-libs/webkit-gtk/webkit-gtk-2.38.5-r500.ebuild
@@ -187,14 +187,19 @@ src_configure() {
        # Ruby situation is a bit complicated. See bug 513888
        local rubyimpl
        local ruby_interpreter=""
+       local RUBY
        for rubyimpl in ${USE_RUBY}; do
                if has_version -b "virtual/rubygems[ruby_targets_${rubyimpl}]"; 
then
-                       ruby_interpreter="-DRUBY_EXECUTABLE=$(type -P 
${rubyimpl})"
+                       RUBY="$(type -P ${rubyimpl})"
+                       ruby_interpreter="-DRUBY_EXECUTABLE=${RUBY}"
                fi
        done
        # This will rarely occur. Only a couple of corner cases could lead us to
        # that failure. See bug 513888
-       [[ -z $ruby_interpreter ]] && die "No suitable ruby interpreter found"
+       [[ -z ${ruby_interpreter} ]] && die "No suitable ruby interpreter found"
+       # JavaScriptCore/Scripts/postprocess-asm invokes another Ruby script 
directly
+       # so it doesn't respect RUBY_EXECUTABLE, bug #771744.
+       sed -i -e "s:#!/usr/bin/env ruby:#!${RUBY}:" $(grep -rl "/usr/bin/env 
ruby" Source/JavaScriptCore || die) || die
 
        # TODO: Check Web Audio support
        # should somehow let user select between them?

diff --git a/net-libs/webkit-gtk/webkit-gtk-2.38.5.ebuild 
b/net-libs/webkit-gtk/webkit-gtk-2.38.5.ebuild
index a845061cb588..e2f9861228c6 100644
--- a/net-libs/webkit-gtk/webkit-gtk-2.38.5.ebuild
+++ b/net-libs/webkit-gtk/webkit-gtk-2.38.5.ebuild
@@ -183,14 +183,19 @@ src_configure() {
        # Ruby situation is a bit complicated. See bug 513888
        local rubyimpl
        local ruby_interpreter=""
+       local RUBY
        for rubyimpl in ${USE_RUBY}; do
                if has_version -b "virtual/rubygems[ruby_targets_${rubyimpl}]"; 
then
-                       ruby_interpreter="-DRUBY_EXECUTABLE=$(type -P 
${rubyimpl})"
+                       RUBY="$(type -P ${rubyimpl})"
+                       ruby_interpreter="-DRUBY_EXECUTABLE=${RUBY}"
                fi
        done
        # This will rarely occur. Only a couple of corner cases could lead us to
        # that failure. See bug 513888
-       [[ -z $ruby_interpreter ]] && die "No suitable ruby interpreter found"
+       [[ -z ${ruby_interpreter} ]] && die "No suitable ruby interpreter found"
+       # JavaScriptCore/Scripts/postprocess-asm invokes another Ruby script 
directly
+       # so it doesn't respect RUBY_EXECUTABLE, bug #771744.
+       sed -i -e "s:#!/usr/bin/env ruby:#!${RUBY}:" $(grep -rl "/usr/bin/env 
ruby" Source/JavaScriptCore || die) || die
 
        # TODO: Check Web Audio support
        # should somehow let user select between them?

diff --git a/net-libs/webkit-gtk/webkit-gtk-2.40.0-r410.ebuild 
b/net-libs/webkit-gtk/webkit-gtk-2.40.0-r410.ebuild
index ef3510d3d31e..80ebcb3d8538 100644
--- a/net-libs/webkit-gtk/webkit-gtk-2.40.0-r410.ebuild
+++ b/net-libs/webkit-gtk/webkit-gtk-2.40.0-r410.ebuild
@@ -174,14 +174,19 @@ src_configure() {
        # Ruby situation is a bit complicated. See bug 513888
        local rubyimpl
        local ruby_interpreter=""
+       local RUBY
        for rubyimpl in ${USE_RUBY}; do
                if has_version -b "virtual/rubygems[ruby_targets_${rubyimpl}]"; 
then
-                       ruby_interpreter="-DRUBY_EXECUTABLE=$(type -P 
${rubyimpl})"
+                       RUBY="$(type -P ${rubyimpl})"
+                       ruby_interpreter="-DRUBY_EXECUTABLE=${RUBY}"
                fi
        done
        # This will rarely occur. Only a couple of corner cases could lead us to
        # that failure. See bug 513888
-       [[ -z $ruby_interpreter ]] && die "No suitable ruby interpreter found"
+       [[ -z ${ruby_interpreter} ]] && die "No suitable ruby interpreter found"
+       # JavaScriptCore/Scripts/postprocess-asm invokes another Ruby script 
directly
+       # so it doesn't respect RUBY_EXECUTABLE, bug #771744.
+       sed -i -e "s:#!/usr/bin/env ruby:#!${RUBY}:" $(grep -rl "/usr/bin/env 
ruby" Source/JavaScriptCore || die) || die
 
        # TODO: Check Web Audio support
        # should somehow let user select between them?

diff --git a/net-libs/webkit-gtk/webkit-gtk-2.40.0-r600.ebuild 
b/net-libs/webkit-gtk/webkit-gtk-2.40.0-r600.ebuild
index 520cc3925b2f..4dbf4738cb41 100644
--- a/net-libs/webkit-gtk/webkit-gtk-2.40.0-r600.ebuild
+++ b/net-libs/webkit-gtk/webkit-gtk-2.40.0-r600.ebuild
@@ -175,14 +175,19 @@ src_configure() {
        # Ruby situation is a bit complicated. See bug 513888
        local rubyimpl
        local ruby_interpreter=""
+       local RUBY
        for rubyimpl in ${USE_RUBY}; do
                if has_version -b "virtual/rubygems[ruby_targets_${rubyimpl}]"; 
then
-                       ruby_interpreter="-DRUBY_EXECUTABLE=$(type -P 
${rubyimpl})"
+                       RUBY="$(type -P ${rubyimpl})"
+                       ruby_interpreter="-DRUBY_EXECUTABLE=${RUBY}"
                fi
        done
        # This will rarely occur. Only a couple of corner cases could lead us to
        # that failure. See bug 513888
-       [[ -z $ruby_interpreter ]] && die "No suitable ruby interpreter found"
+       [[ -z ${ruby_interpreter} ]] && die "No suitable ruby interpreter found"
+       # JavaScriptCore/Scripts/postprocess-asm invokes another Ruby script 
directly
+       # so it doesn't respect RUBY_EXECUTABLE, bug #771744.
+       sed -i -e "s:#!/usr/bin/env ruby:#!${RUBY}:" $(grep -rl "/usr/bin/env 
ruby" Source/JavaScriptCore || die) || die
 
        # TODO: Check Web Audio support
        # should somehow let user select between them?

diff --git a/net-libs/webkit-gtk/webkit-gtk-2.40.0.ebuild 
b/net-libs/webkit-gtk/webkit-gtk-2.40.0.ebuild
index 07c7e859bc5b..8f448fa012f1 100644
--- a/net-libs/webkit-gtk/webkit-gtk-2.40.0.ebuild
+++ b/net-libs/webkit-gtk/webkit-gtk-2.40.0.ebuild
@@ -172,14 +172,19 @@ src_configure() {
        # Ruby situation is a bit complicated. See bug 513888
        local rubyimpl
        local ruby_interpreter=""
+       local RUBY
        for rubyimpl in ${USE_RUBY}; do
                if has_version -b "virtual/rubygems[ruby_targets_${rubyimpl}]"; 
then
-                       ruby_interpreter="-DRUBY_EXECUTABLE=$(type -P 
${rubyimpl})"
+                       RUBY="$(type -P ${rubyimpl})"
+                       ruby_interpreter="-DRUBY_EXECUTABLE=${RUBY}"
                fi
        done
        # This will rarely occur. Only a couple of corner cases could lead us to
        # that failure. See bug 513888
-       [[ -z $ruby_interpreter ]] && die "No suitable ruby interpreter found"
+       [[ -z ${ruby_interpreter} ]] && die "No suitable ruby interpreter found"
+       # JavaScriptCore/Scripts/postprocess-asm invokes another Ruby script 
directly
+       # so it doesn't respect RUBY_EXECUTABLE, bug #771744.
+       sed -i -e "s:#!/usr/bin/env ruby:#!${RUBY}:" $(grep -rl "/usr/bin/env 
ruby" Source/JavaScriptCore || die) || die
 
        # TODO: Check Web Audio support
        # should somehow let user select between them?

Reply via email to