net-libs/webkit-gtk: add support for ruby25
authorVirgil Dupras <vdupras@gentoo.org>
Wed, 18 Jul 2018 13:05:47 +0000 (09:05 -0400)
committerMart Raudsepp <leio@gentoo.org>
Mon, 23 Jul 2018 22:23:37 +0000 (01:23 +0300)
Also, improve ruby interpreter detection logic.

Closes: https://bugs.gentoo.org/659130
Bug: https://bugs.gentoo.org/513888
Package-Manager: Portage-2.3.40, Repoman-2.3.9

net-libs/webkit-gtk/webkit-gtk-2.20.3.ebuild

index d07aadc54b8df4cd3351d1a498caa60ed5f80737..5990cd0d5eafd0d73067829c1506ac8d99356cfc 100644 (file)
@@ -4,7 +4,7 @@
 EAPI=6
 CMAKE_MAKEFILE_GENERATOR="ninja"
 PYTHON_COMPAT=( python2_7 )
-USE_RUBY="ruby22 ruby23 ruby24"
+USE_RUBY="ruby23 ruby24 ruby25"
 
 inherit check-reqs cmake-utils eutils flag-o-matic gnome2 pax-utils python-any-r1 ruby-single toolchain-funcs versionator virtualx
 
@@ -188,17 +188,17 @@ src_configure() {
        # Multiple rendering bugs on youtube, github, etc without this, bug #547224
        append-flags $(test-flags -fno-strict-aliasing)
 
+       # Ruby situation is a bit complicated. See bug 513888
+       local rubyimpl
        local ruby_interpreter=""
-
-       if has_version "virtual/rubygems[ruby_targets_ruby24]"; then
-               ruby_interpreter="-DRUBY_EXECUTABLE=$(type -P ruby24)"
-       elif has_version "virtual/rubygems[ruby_targets_ruby23]"; then
-               ruby_interpreter="-DRUBY_EXECUTABLE=$(type -P ruby23)"
-       elif has_version "virtual/rubygems[ruby_targets_ruby22]"; then
-               ruby_interpreter="-DRUBY_EXECUTABLE=$(type -P ruby22)"
-       else
-               ruby_interpreter="-DRUBY_EXECUTABLE=$(type -P ruby21)"
-       fi
+       for rubyimpl in ${USE_RUBY}; do
+               if has_version "virtual/rubygems[ruby_targets_${rubyimpl}]"; then
+                       ruby_interpreter="-DRUBY_EXECUTABLE=$(type -P ${rubyimpl})"
+               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"
 
        # TODO: Check Web Audio support
        # should somehow let user select between them?