public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Jeroen Roovers" <jer@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: www-client/elinks/, www-client/elinks/files/
Date: Mon, 26 Mar 2018 18:07:10 +0000 (UTC)	[thread overview]
Message-ID: <1522087628.951209198db135ba00611ae2b54e300e022fbd10.jer@gentoo> (raw)

commit:     951209198db135ba00611ae2b54e300e022fbd10
Author:     Jeroen Roovers <jer <AT> gentoo <DOT> org>
AuthorDate: Mon Mar 26 18:02:33 2018 +0000
Commit:     Jeroen Roovers <jer <AT> gentoo <DOT> org>
CommitDate: Mon Mar 26 18:07:08 2018 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=95120919

www-client/elinks: Fix ruby check/compat by Felix Janda (bug #649948).

Package-Manager: Portage-2.3.24, Repoman-2.3.6

 .../elinks/elinks-0.13_pre_pre20180225.ebuild      |   3 +-
 www-client/elinks/files/elinks-0.13-ruby.patch     | 183 +++++++++++++++++++++
 2 files changed, 185 insertions(+), 1 deletion(-)

diff --git a/www-client/elinks/elinks-0.13_pre_pre20180225.ebuild b/www-client/elinks/elinks-0.13_pre_pre20180225.ebuild
index a0b8366f121..9a4f291cc06 100644
--- a/www-client/elinks/elinks-0.13_pre_pre20180225.ebuild
+++ b/www-client/elinks/elinks-0.13_pre_pre20180225.ebuild
@@ -43,7 +43,8 @@ RDEPEND="${DEPEND}"
 
 PATCHES=(
 	"${FILESDIR}"/${PN}-9999-parallel-make.patch
-	)
+	"${FILESDIR}"/${PN}-0.13-ruby.patch
+)
 
 src_prepare() {
 	default

diff --git a/www-client/elinks/files/elinks-0.13-ruby.patch b/www-client/elinks/files/elinks-0.13-ruby.patch
new file mode 100644
index 00000000000..a716439b512
--- /dev/null
+++ b/www-client/elinks/files/elinks-0.13-ruby.patch
@@ -0,0 +1,183 @@
+--- a/config/m4/ruby.m4
++++ b/config/m4/ruby.m4
+@@ -32,36 +32,40 @@ if test "$CONFIG_SCRIPTING_RUBY" = "yes"; then
+ 	if test "$CONFIG_SCRIPTING_RUBY" != "no"; then
+ 
+ 		AC_MSG_CHECKING(Ruby version)
+-		if $CONFIG_SCRIPTING_RUBY -e 'exit((VERSION or RUBY_VERSION) >= "1.6.0")' >/dev/null 2>/dev/null; then
++		if $CONFIG_SCRIPTING_RUBY -e 'exit((VERSION rescue RUBY_VERSION) >= "1.6.0")' >/dev/null 2>/dev/null; then
+ 			ruby_version=`$CONFIG_SCRIPTING_RUBY -e 'puts "#{VERSION rescue RUBY_VERSION}"'`
+ 			AC_MSG_RESULT($ruby_version)
+ 
+ 			AC_MSG_CHECKING(for Ruby header files)
+-			rubyhdrdir=`$CONFIG_SCRIPTING_RUBY -r mkmf -e 'print Config::CONFIG[["archdir"]] || $hdrdir' 2>/dev/null`
++			rubyhdrdir=`$CONFIG_SCRIPTING_RUBY -r mkmf -e 'print RbConfig::CONFIG[["rubyhdrdir"]] || RbConfig::CONFIG[["archdir"]] || $hdrdir' 2>/dev/null`
+ 
+ 			if test "X$rubyhdrdir" != "X"; then
+ 				AC_MSG_RESULT($rubyhdrdir)
+ 				RUBY_CFLAGS="-I$rubyhdrdir"
+-				rubylibs=`$CONFIG_SCRIPTING_RUBY -r rbconfig -e 'print Config::CONFIG[["LIBS"]]'`
++				rubyarch=`$CONFIG_SCRIPTING_RUBY -r rbconfig -e 'print RbConfig::CONFIG[["arch"]]'`
++				if test -d "$rubyhdrdir/$rubyarch"; then
++					RUBY_CFLAGS="$RUBY_CFLAGS -I$rubyhdrdir/$rubyarch"
++				fi
++				rubylibs=`$CONFIG_SCRIPTING_RUBY -r rbconfig -e 'print RbConfig::CONFIG[["LIBS"]]'`
+ 
+ 				if test "X$rubylibs" != "X"; then
+ 					RUBY_LIBS="$rubylibs"
+ 				fi
+ 
+-				librubyarg=`$CONFIG_SCRIPTING_RUBY -r rbconfig -e 'print Config.expand(Config::CONFIG[["LIBRUBYARG"]])'`
++				librubyarg=`$CONFIG_SCRIPTING_RUBY -r rbconfig -e 'print RbConfig.expand(RbConfig::CONFIG[["LIBRUBYARG"]])'`
+ 
+ 				if test -f "$rubyhdrdir/$librubyarg"; then
+ 					librubyarg="$rubyhdrdir/$librubyarg"
+ 
+ 				else
+-					rubylibdir=`$CONFIG_SCRIPTING_RUBY -r rbconfig -e 'print Config.expand(Config::CONFIG[["libdir"]])'`
++					rubylibdir=`$CONFIG_SCRIPTING_RUBY -r rbconfig -e 'print RbConfig.expand(RbConfig::CONFIG[["libdir"]])'`
+ 					if test -f "$rubylibdir/$librubyarg"; then
+ 						librubyarg="$rubylibdir/$librubyarg"
+ 					elif test "$librubyarg" = "libruby.a"; then
+ 						dnl required on Mac OS 10.3 where libruby.a doesn't exist
+ 						librubyarg="-lruby"
+ 					else
+-						librubyarg=`$CONFIG_SCRIPTING_RUBY -r rbconfig -e "print '$librubyarg'.gsub(/-L\./, %'-L#{Config.expand(Config::CONFIG[\"libdir\"])}')"`
++						librubyarg=`$CONFIG_SCRIPTING_RUBY -r rbconfig -e "print '$librubyarg'.gsub(/-L\./, %'-L#{RbConfig.expand(RbConfig::CONFIG[\"libdir\"])}')"`
+ 					fi
+ 				fi
+ 
+@@ -69,7 +73,7 @@ if test "$CONFIG_SCRIPTING_RUBY" = "yes"; then
+ 					RUBY_LIBS="$librubyarg $RUBY_LIBS"
+ 				fi
+ 
+-				rubyldflags=`$CONFIG_SCRIPTING_RUBY -r rbconfig -e 'print Config::CONFIG[["LDFLAGS"]]'`
++				rubyldflags=`$CONFIG_SCRIPTING_RUBY -r rbconfig -e 'print RbConfig::CONFIG[["LDFLAGS"]]'`
+ 				if test "X$rubyldflags" != "X"; then
+ 					LDFLAGS="$rubyldflags $LDFLAGS"
+ 				fi
+@@ -86,6 +90,15 @@ if test "$CONFIG_SCRIPTING_RUBY" = "yes"; then
+ 			AC_MSG_RESULT(too old; need Ruby version 1.6.0 or later)
+ 		fi
+ 	fi
++	if test "$CONFIG_SCRIPTING_RUBY" = "yes"; then
++		AC_MSG_CHECKING([for rb_errinfo])
++		AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <ruby.h>]], [[rb_errinfo();]])],have_rb_errinfo="yes",have_rb_errinfo="no")
++		AC_MSG_RESULT($have_rb_errinfo)
++		if test "$have_rb_errinfo" = "yes"; then
++			AC_DEFINE([HAVE_RB_ERRINFO], [1],
++				[Define to 1 if you have the `rb_errinfo' function.])
++		fi
++	fi
+ fi
+ 
+ EL_RESTORE_FLAGS
+--- a/src/scripting/ruby/core.c
++++ b/src/scripting/ruby/core.c
+@@ -76,10 +76,10 @@ erb_report_error(struct session *ses, int error)
+ 		break;
+ 	case TAG_RAISE:
+ 	case TAG_FATAL:
+-		eclass = CLASS_OF(ruby_errinfo);
+-		einfo = rb_obj_as_string(ruby_errinfo);
++		eclass = CLASS_OF(RB_ERRINFO);
++		einfo = rb_obj_as_string(RB_ERRINFO);
+ 
+-		if (eclass == rb_eRuntimeError && RSTRING(einfo)->len == 0) {
++		if (eclass == rb_eRuntimeError && RSTRING_LEN(einfo) == 0) {
+ 			msg = "unhandled exception";
+ 
+ 		} else {
+@@ -88,7 +88,7 @@ erb_report_error(struct session *ses, int error)
+ 
+ 			epath = rb_class_path(eclass);
+ 			snprintf(buff, MAX_STR_LEN, "%s: %s",
+-				RSTRING(epath)->ptr, RSTRING(einfo)->ptr);
++				RSTRING_PTR(epath), RSTRING_PTR(einfo));
+ 
+ 			p = strchr((const char *)buff, '\n');
+ 			if (p) *p = '\0';
+@@ -116,7 +116,7 @@ erb_module_message(VALUE self, VALUE str)
+ 	struct terminal *term;
+ 
+ 	str = rb_obj_as_string(str);
+-	message = memacpy(RSTRING(str)->ptr, RSTRING(str)->len);
++	message = memacpy(RSTRING_PTR(str), RSTRING_PTR(str));
+ 	if (!message) return Qnil;
+ 
+ 	line_end = strchr((const char *)message, '\n');
+@@ -165,8 +165,8 @@ erb_stdout_p(int argc, VALUE *argv, VALUE self)
+ 		 * the inspect() method, which adds quotes to the strings, so
+ 		 * gently ignore them. */
+ 
+-		ptr = RSTRING(substr)->ptr;
+-		len = RSTRING(substr)->len;
++		ptr = RSTRING_PTR(substr);
++		len = RSTRING_LEN(substr);
+ 
+ 		if (*ptr == '"')
+ 			ptr++, len--;
+--- a/src/scripting/ruby/core.h
++++ b/src/scripting/ruby/core.h
+@@ -7,6 +7,20 @@ struct session;
+ 
+ #include <ruby.h>	/* for VALUE */
+ 
++#ifndef RSTRING_LEN
++#define RSTRING_LEN(string) (RSTRING(string)->len)
++#endif
++
++#ifndef RSTRING_PTR
++#define RSTRING_PTR(string) (RSTRING(string)->ptr)
++#endif
++
++#ifdef HAVE_RB_ERRINFO
++#define RB_ERRINFO (rb_errinfo())
++#else
++#define RB_ERRINFO (ruby_errinfo)
++#endif
++
+ VALUE erb_module;
+ 
+ void alert_ruby_error(struct session *ses, unsigned char *msg);
+--- a/src/scripting/ruby/hooks.c
++++ b/src/scripting/ruby/hooks.c
+@@ -83,7 +83,7 @@ script_hook_goto_url(va_list ap, void *data)
+ 	{
+ 		unsigned char *new_url;
+ 
+-		new_url = memacpy(RSTRING(result)->ptr, RSTRING(result)->len);
++		new_url = memacpy(RSTRING_PTR(result), RSTRING_LEN(result));
+ 		if (new_url) {
+ 			mem_free_set(url, new_url);
+ 		}
+@@ -126,7 +126,7 @@ script_hook_follow_url(va_list ap, void *data)
+ 	{
+ 		unsigned char *new_url;
+ 
+-		new_url = memacpy(RSTRING(result)->ptr, RSTRING(result)->len);
++		new_url = memacpy(RSTRING_PTR(result), RSTRING_LEN(result));
+ 		if (new_url) {
+ 			mem_free_set(url, new_url);
+ 		}
+@@ -170,9 +170,9 @@ script_hook_pre_format_html(va_list ap, void *data)
+ 	switch (rb_type(result)) {
+ 	case T_STRING:
+ 	{
+-		int len = RSTRING(result)->len;
++		int len = RSTRING_LEN(result);
+ 
+-		add_fragment(cached, 0, RSTRING(result)->ptr, len);
++		add_fragment(cached, 0, RSTRING_PTR(result), len);
+ 		normalize_cache_entry(cached, len);
+ 
+ 		break;
+@@ -216,7 +216,7 @@ script_hook_get_proxy(va_list ap, void *data)
+ 	{
+ 		unsigned char *proxy;
+ 
+-		proxy = memacpy(RSTRING(result)->ptr, RSTRING(result)->len);
++		proxy = memacpy(RSTRING_PTR(result), RSTRING_LEN(result));
+ 		if (proxy) {
+ 			mem_free_set(new_proxy_url, proxy);
+ 		}


             reply	other threads:[~2018-03-26 18:07 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-26 18:07 Jeroen Roovers [this message]
  -- strict thread matches above, loose matches on Subject: below --
2025-02-16 16:36 [gentoo-commits] repo/gentoo:master commit in: www-client/elinks/, www-client/elinks/files/ Sam James
2025-01-22 23:44 Sam James
2024-10-28 11:42 Sam James
2024-07-16 21:28 Conrad Kostecki
2023-07-03 15:16 Sam James
2022-10-13 19:56 Sam James
2020-09-13 18:39 Sam James
2017-10-22 16:55 Patrice Clement

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1522087628.951209198db135ba00611ae2b54e300e022fbd10.jer@gentoo \
    --to=jer@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox