commit:     5118d7463975feaa6c2962c31655684444123e99
Author:     Akinori Hattori <hattya <AT> gentoo <DOT> org>
AuthorDate: Wed Jul  4 13:10:34 2018 +0000
Commit:     Akinori Hattori <hattya <AT> gentoo <DOT> org>
CommitDate: Wed Jul  4 13:23:46 2018 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5118d746

www-servers/h2o: specify ruby version

Package-Manager: Portage-2.3.40, Repoman-2.3.9

 www-servers/h2o/h2o-2.2.4.ebuild | 19 +++++++++++++++++++
 www-servers/h2o/h2o-9999.ebuild  | 19 +++++++++++++++++++
 2 files changed, 38 insertions(+)

diff --git a/www-servers/h2o/h2o-2.2.4.ebuild b/www-servers/h2o/h2o-2.2.4.ebuild
index 579c8e92940..449ca5e6711 100644
--- a/www-servers/h2o/h2o-2.2.4.ebuild
+++ b/www-servers/h2o/h2o-2.2.4.ebuild
@@ -33,6 +33,25 @@ pkg_setup() {
        enewuser ${PN} -1 -1 -1 ${PN}
 }
 
+src_prepare() {
+       cmake-utils_src_prepare
+
+       local ruby="ruby"
+       if use mruby; then
+               for ruby in ${RUBY_TARGETS_PREFERENCE}; do
+                       if has_version dev-lang/ruby:${ruby:4:1}.${ruby:5}; then
+                               break
+                       fi
+                       ruby=
+               done
+               [[ -z ${ruby} ]] && die "no suitable ruby version found"
+       fi
+
+       sed -i \
+               -e "s: ruby: ${ruby}:" \
+               CMakeLists.txt
+}
+
 src_configure() {
        local mycmakeargs=(
                -DCMAKE_INSTALL_SYSCONFDIR="${EPREFIX}"/etc/${PN}

diff --git a/www-servers/h2o/h2o-9999.ebuild b/www-servers/h2o/h2o-9999.ebuild
index d6c5d65d823..0d21e4e8bee 100644
--- a/www-servers/h2o/h2o-9999.ebuild
+++ b/www-servers/h2o/h2o-9999.ebuild
@@ -31,6 +31,25 @@ pkg_setup() {
        enewuser ${PN} -1 -1 -1 ${PN}
 }
 
+src_prepare() {
+       cmake-utils_src_prepare
+
+       local ruby="ruby"
+       if use mruby; then
+               for ruby in ${RUBY_TARGETS_PREFERENCE}; do
+                       if has_version dev-lang/ruby:${ruby:4:1}.${ruby:5}; then
+                               break
+                       fi
+                       ruby=
+               done
+               [[ -z ${ruby} ]] && die "no suitable ruby version found"
+       fi
+
+       sed -i \
+               -e "s: ruby: ${ruby}:" \
+               CMakeLists.txt
+}
+
 src_configure() {
        local mycmakeargs=(
                -DCMAKE_INSTALL_SYSCONFDIR="${EPREFIX}"/etc/${PN}

Reply via email to