Date: Fri, 2 Sep 2011 15:20:36 -0400 (EDT) From: "Mikhail T." <mi@aldan.algebra.com> To: FreeBSD-gnats-submit@FreeBSD.org Cc: portmgr@FreeBSD.org Subject: ports/160404: Unbreaking databases/ruby-bdb1 for Ruby-1.9 Message-ID: <201109021920.p82JKaLq028370@narawntapu.narawntapu> Resent-Message-ID: <201109021930.p82JUCTC028432@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 160404 >Category: ports >Synopsis: Unbreaking databases/ruby-bdb1 for Ruby-1.9 >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Fri Sep 02 19:30:11 UTC 2011 >Closed-Date: >Last-Modified: >Originator: Mikhail T. >Release: FreeBSD 8.2-STABLE amd64 >Organization: Virtual Estates, Inc. http://sybpipe.com/ >Environment: System: FreeBSD narawntapu 8.2-STABLE FreeBSD 8.2-STABLE #0: Sun Jun 12 22:48:33 EDT 2011 root@narawntapu:/usr/obj/home/src/sys/POWEREDGE2900 amd64 >Description: The below patches allow ruby-bdb1 to compile against Ruby-1.9. They also add the "regression-test" target to the port's Makefile. (When the RUBY_VER is 1.8, the test-target is automatically triggered after build.) Although some of the regression tests still fail under Ruby-1.9, the binary is now "good enough" for portupgrade to work (an upgrade is running here as I type this.) Thus, ruby-bdb1 will not be any worse, than ruby-bdb, which, currently, also has numerous problems with Ruby-1.9, see: http://www.freebsd.org/cgi/query-pr.cgi?pr=160402 >How-To-Repeat: >Fix: Index: Makefile =================================================================== RCS file: /home/pcvs/ports/databases/ruby-bdb1/Makefile,v retrieving revision 1.21 diff -U 2 -r1.21 Makefile --- Makefile 4 Jul 2011 17:46:08 -0000 1.21 +++ Makefile 2 Sep 2011 19:14:27 -0000 @@ -32,4 +32,7 @@ docs/doc +test regression-test check: + ${MAKE} -C ${WRKSRC} test + post-build: .if !defined(NOPORTDOCS) @@ -49,5 +52,13 @@ .include <bsd.port.pre.mk> .if ${RUBY_VER} == 1.9 -BROKEN= does not build with ruby 1.9 +pre-everything:: + ######################################################## + # Although it is now possible to compile ${PORTNAME} + # against Ruby-${RUBY_VER}, the resulting binary is not + # fully functional due to changes in Ruby API. + # Use of Ruby-1.8 is recommended for full compatibility. + ######################################################## +.elif ${RUBY_VER} == 1.8 +post-build: test .endif .include <bsd.port.post.mk> Index: files/patch-delegate =================================================================== RCS file: files/patch-delegate diff -N files/patch-delegate --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ files/patch-delegate 2 Sep 2011 19:14:27 -0000 @@ -0,0 +1,10 @@ +--- src/delegate.c 2006-09-19 13:06:40.000000000 -0400 ++++ src/delegate.c 2011-09-02 13:28:23.000000000 -0400 +@@ -171,5 +171,6 @@ + ary = rb_class_instance_methods(1, &tmp, rb_mKernel); + for (i = 0; i < RARRAY_LEN(ary); i++) { +- method = StringValuePtr(RARRAY_PTR(ary)[i]); ++ tmp = rb_obj_as_string(RARRAY_PTR(ary)[i]); ++ method = StringValuePtr(tmp); + if (!strcmp(method, "==") || + !strcmp(method, "===") || !strcmp(method, "=~")) continue; Index: files/patch-super =================================================================== RCS file: files/patch-super diff -N files/patch-super --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ files/patch-super 2 Sep 2011 19:14:27 -0000 @@ -0,0 +1,16 @@ +The RCLASS_SUPER define is present in both Ruby 1.8 and 1.9. + +Direct access to "super" no longer works in 1.9 (the field is +not there), but the define continues to work properly. + + -mi + +--- src/bdb1.c 2006-09-20 12:41:01.000000000 -0400 ++++ src/bdb1.c 2011-09-02 12:27:34.000000000 -0400 +@@ -692,5 +692,5 @@ + break; + } +- cl = RCLASS(cl)->super; ++ cl = RCLASS_SUPER(cl); + } + if (!cl) { >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201109021920.p82JKaLq028370>