Subject: pkg/20683: Update to Ruby 1.6.8
To: None <gnats-bugs@gnats.netbsd.org>
From: None <sketch@rd.bbc.co.uk>
List: netbsd-bugs
Date: 03/13/2003 05:49:02
>Number:         20683
>Category:       pkg
>Synopsis:       Update to Ruby 1.6.8
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Mar 13 05:50:01 PST 2003
>Closed-Date:
>Last-Modified:
>Originator:     Jonathan Perkin
>Release:        1.6
>Organization:
British Broadcasting Corporation
>Environment:
NetBSD batfink.intra.nut 1.6 NetBSD 1.6 (GENERIC) #0: Sun Sep  8 19:43:40 UTC 2002     autobuild@tgm.daemon.org:/autobuild/i386/OBJ/autobuild/src/sys/arch/i386/compile/GENERIC i386
SunOS desk00 5.8 Generic sun4u sparc SUNW,Ultra-60
>Description:
The patch below upgrades pkgsrc/lang/ruby-base to 1.6.8

It has some issues:

 1) It changes where the arch-dependant stuff lives.  Clarification
    is asked for regarding this in a recent post to tech-pkg with
    the subject "Solaris MACHINE_GNU_PLATFORM", but basically I've
    made everything install to ${MACHINE_GNU_PLATFORM} explicitly,
    and updated the ruby Makefile.common to reflect that so that
    PLIST entries are now correct.  This needs a small patch to the
    ruby source to install to where explicitly told via the --host
    configure argument.  I would say this is the `cleanest' fix, but
    there may be issues I haven't thought of.  This of course will
    mean people need to rebuild all their ruby modules.

 2) For fixing solaris builds I've had to add more patches to the
    ruby source for solaris*) case to change what I consider to be
    the sane default of libruby.MAJOR.MINOR.TEENY to the (IMHO)
    bizarre libruby.MAJORMINOR.TEENY naming scheme.  Can someone
    please expand on this, because at the moment our desire to see
    pkgsrc on all platforms is going to mean huge patches to go from
    the sane to the bizarre just to satisfy PLISTs.

 3) It requires the patch I posted on the above tech-pkg thread to
    truly complete the Solaris PLIST fix.
>How-To-Repeat:

>Fix:
Ruby patch below (and available at
http://www.perkin.org.uk/projects/netbsd/ruby168.patch).  Note that it
requires patches/patch-ak to be deleted.

Index: Makefile
===================================================================
RCS file: /cvsroot/pkgsrc/lang/ruby-base/Makefile,v
retrieving revision 1.10
diff -u -r1.10 Makefile
--- Makefile    2003/02/17 15:28:01     1.10
+++ Makefile    2003/03/13 13:34:33
@@ -3,7 +3,6 @@
 
 DISTNAME=      ${RUBY_DISTNAME}
 PKGNAME=       ${RUBY_PKGNAMEPREFIX}base-${RUBY_VERSION}
-PKGREVISION=   3
 CATEGORIES=    lang
 MASTER_SITES=  ${MASTER_SITE_RUBY}
 
@@ -36,7 +35,7 @@
 REPLACE_RUBY=  ext/curses/hello.rb ext/curses/rain.rb ext/curses/view.rb \
                lib/matrix.rb sample/biorhythm.rb sample/cal.rb \
                sample/exyacc.rb sample/from.rb sample/fullpath.rb \
-               sample/goodfriday.rb sample/irb.rb sample/less.rb \
+               sample/goodfriday.rb sample/less.rb \
                sample/mine.rb sample/mpart.rb sample/observ.rb \
                sample/pi.rb sample/rcs.rb sample/test.rb \
                sample/time.rb sample/trojan.rb sample/uumerge.rb
@@ -65,9 +64,6 @@
 pre-build:
        @${FIND} ${WRKSRC} -name '*.orig' -exec ${RM} -f {} \;
 
-post-build:
-       ${MV} -f ${WRKSRC}/sample/irb.rb ${WRKDIR}/irb.rb
-
 post-install:
        strip ${RUBY}
 .if empty(RUBY_SUFFIX)
@@ -79,7 +75,6 @@
 .endif
        ${LN} -fs ruby${_RUBY_SUFFIX}.1 ${PREFIX}/man/man1/ruby.1
        ${INSTALL_DATA_DIR} ${RUBY_EXAMPLESDIR}
-       ${INSTALL_SCRIPT} ${WRKDIR}/irb.rb ${PREFIX}/bin/irb
        ${INSTALL_DATA} ${WRKSRC}/sample/* ${RUBY_EXAMPLESDIR}
        ${INSTALL_DATA_DIR} ${RUBY_EXAMPLESDIR}/curses
        ${INSTALL_DATA} ${RUBY_WRKSRC}/ext/curses/hello.rb \
Index: Makefile.common
===================================================================
RCS file: /cvsroot/pkgsrc/lang/ruby-base/Makefile.common,v
retrieving revision 1.10
diff -u -r1.10 Makefile.common
--- Makefile.common     2002/12/07 02:38:58     1.10
+++ Makefile.common     2003/03/13 13:34:33
@@ -65,14 +65,14 @@
 RUBY?=                 ${LOCALBASE}/bin/${RUBY_NAME}
 
 .if ${RUBY_VER} < 1.7
-RUBY_VERSION?=         1.6.7
+RUBY_VERSION?=         1.6.8
 RUBY_SUFFIX?=          # empty
 .else
 RUBY_VERSION?=         1.7                     # current, not tested.
 RUBY_SUFFIX?=          ${_RUBY_SUFFIX}
 .endif
 
-RUBY_ARCH?=            ${MACHINE_GNU_PLATFORM:S/--/-/}
+RUBY_ARCH?=            ${MACHINE_GNU_PLATFORM}
 RUBY_NAME?=            ruby${RUBY_SUFFIX}
 
 RUBY_DISTNAME?=                ruby-${RUBY_VERSION}
Index: distinfo
===================================================================
RCS file: /cvsroot/pkgsrc/lang/ruby-base/distinfo,v
retrieving revision 1.6
diff -u -r1.6 distinfo
--- distinfo    2002/10/06 14:56:59     1.6
+++ distinfo    2003/03/13 13:34:33
@@ -1,12 +1,11 @@
 $NetBSD: distinfo,v 1.6 2002/10/06 14:56:59 taca Exp $
 
-SHA1 (ruby/ruby-1.6.7.tar.gz) = fd1523f17e64fd80741f2e6a77050fde16164053
-Size (ruby/ruby-1.6.7.tar.gz) = 998151 bytes
-SHA1 (patch-aa) = 62f1bd7d422a1e644896fb6548f182b709d57f23
-SHA1 (patch-ab) = 75b6b2fd6fa5c472c8b2ee0cae5bab19f8edc989
+SHA1 (ruby/ruby-1.6.8.tar.gz) = 4b475ac1c837cd62b6dfe85359e1502a71b08cd1
+Size (ruby/ruby-1.6.8.tar.gz) = 1023403 bytes
+SHA1 (patch-aa) = 6619df547fc338ccfed5ed9a296d023a315d1b1b
+SHA1 (patch-ab) = 411895bbb6155c4f4e3641c39974aac5d786b3c3
 SHA1 (patch-ac) = 5b897041345ec4077fa2165e3c4c58a6671b942d
-SHA1 (patch-ae) = 294af53a7509372f0d7c17230c605d790f1e7bb2
+SHA1 (patch-ae) = 82784bc3ae6c054c4c310da6368a22214730d59a
 SHA1 (patch-af) = 0eb2fd9784b5924bcc233d3b81128821130c578c
 SHA1 (patch-ag) = 4b5893b55253526af687bc81a9acea3686a00d39
 SHA1 (patch-aj) = d61950c108cda41a7a5227f02c583bc6e85e43bb
-SHA1 (patch-ak) = 7a2bcb46c1a7818f226e552bfd4f19acedba6733
Index: patches/patch-aa
===================================================================
RCS file: /cvsroot/pkgsrc/lang/ruby-base/patches/patch-aa,v
retrieving revision 1.4
diff -u -r1.4 patch-aa
--- patches/patch-aa    2002/05/13 15:00:02     1.4
+++ patches/patch-aa    2003/03/13 13:34:33
@@ -1,17 +1,27 @@
 $NetBSD: patch-aa,v 1.4 2002/05/13 15:00:02 yyamano Exp $
 
---- configure.in.orig  Wed Feb  6 18:13:15 2002
+--- configure.in.orig  Wed Nov 13 18:59:18 2002
 +++ configure.in
-@@ -872,7 +872,7 @@
+@@ -884,6 +884,9 @@
+       ;;
+     solaris*)
+       XLDFLAGS='-R${prefix}/lib'
++      LIBRUBY_SO='lib$(RUBY_INSTALL_NAME).so.$(MAJOR)$(MINOR).$(TEENY)'
++      LIBRUBYARG='-Wl,-R -Wl,${prefix}/lib -L${prefix}/lib -L. -l$(RUBY_INSTALL_NAME)'
++      LIBRUBY_ALIASES='lib$(RUBY_INSTALL_NAME).so.$(MAJOR)$(MINOR) lib$(RUBY_INSTALL_NAME).so'
+       ;;
+     hpux*)
+       XLDFLAGS='-Wl,+s,+b,$(prefix)/lib'
+@@ -911,7 +915,7 @@
      darwin*)
        LIBRUBY_SO='lib$(RUBY_INSTALL_NAME).$(MAJOR).$(MINOR).$(TEENY).dylib'
        LIBRUBY_LDSHARED='cc -dynamiclib -undefined suppress -flat_namespace'
--      LIBRUBY_DLDFLAGS='-install_name lib$(RUBY_INSTALL_NAME).dylib -current_version $(MAJOR).$(MINOR).$(TEENY) -compatibility_version $(MAJOR).$(MINOR)'
-+      LIBRUBY_DLDFLAGS='-install_name $(prefix)/lib/lib$(RUBY_INSTALL_NAME).dylib -current_version $(MAJOR).$(MINOR).$(TEENY) -compatibility_version $(MAJOR).$(MINOR)'
+-      LIBRUBY_DLDFLAGS='-install_name $(prefix)/lib/lib$(RUBY_INSTALL_NAME).dylib -current_version $(MAJOR).$(MINOR).$(TEENY) -compatibility_version $(MAJOR).$(MINOR)'
++      LIBRUBY_DLDFLAGS='-install_name lib$(RUBY_INSTALL_NAME).dylib -current_version $(MAJOR).$(MINOR).$(TEENY) -compatibility_version $(MAJOR).$(MINOR)'
        LIBRUBY_ALIASES='lib$(RUBY_INSTALL_NAME).$(MAJOR).$(MINOR).dylib lib$(RUBY_INSTALL_NAME).dylib'
        ;;
      *)
-@@ -951,6 +951,7 @@
+@@ -990,6 +994,7 @@
        ;;
  esac
  
@@ -19,3 +29,12 @@
  AC_SUBST(LIBRUBY_LDSHARED)
  AC_SUBST(LIBRUBY_DLDFLAGS)
  AC_SUBST(RUBY_INSTALL_NAME)
+@@ -1057,7 +1062,7 @@
+                  "${RUBY_SITE_LIB_PATH}/" __ARCHITECTURE__ "-${target_os}")
+     AC_DEFINE_UNQUOTED(RUBY_PLATFORM, __ARCHITECTURE__ "-${target_os}")
+ else
+-    arch="${target_cpu}-${target_os}"
++    arch="${host}"
+     AC_DEFINE_UNQUOTED(RUBY_PLATFORM, "${arch}")
+ fi
+ 
Index: patches/patch-ab
===================================================================
RCS file: /cvsroot/pkgsrc/lang/ruby-base/patches/patch-ab,v
retrieving revision 1.3
diff -u -r1.3 patch-ab
--- patches/patch-ab    2002/05/13 15:00:02     1.3
+++ patches/patch-ab    2003/03/13 13:34:33
@@ -1,17 +1,27 @@
 $NetBSD: patch-ab,v 1.3 2002/05/13 15:00:02 yyamano Exp $
 
---- configure.orig     Mon Feb 11 03:05:48 2002
+--- configure.orig     Tue Nov 19 11:49:26 2002
 +++ configure
-@@ -5054,7 +5054,7 @@
-     darwin*)
-       LIBRUBY_SO='lib$(RUBY_INSTALL_NAME).$(MAJOR).$(MINOR).$(TEENY).dylib'
-       LIBRUBY_LDSHARED='cc -dynamiclib -undefined suppress -flat_namespace'
--      LIBRUBY_DLDFLAGS='-install_name lib$(RUBY_INSTALL_NAME).dylib -current_version $(MAJOR).$(MINOR).$(TEENY) -compatibility_version $(MAJOR).$(MINOR)'
-+      LIBRUBY_DLDFLAGS='-install_name $(prefix)/lib/lib$(RUBY_INSTALL_NAME).dylib -current_version $(MAJOR).$(MINOR).$(TEENY) -compatibility_version $(MAJOR).$(MINOR)'
-       LIBRUBY_ALIASES='lib$(RUBY_INSTALL_NAME).$(MAJOR).$(MINOR).dylib lib$(RUBY_INSTALL_NAME).dylib'
-       ;;
-     *)
-@@ -5444,6 +5444,7 @@
+@@ -5096,6 +5096,9 @@
+       ;;
+     solaris*)
+       XLDFLAGS='-R${prefix}/lib'
++      LIBRUBY_SO='lib$(RUBY_INSTALL_NAME).so.$(MAJOR)$(MINOR).$(TEENY)'
++      LIBRUBYARG='-Wl,-R -Wl,${prefix}/lib -L${prefix}/lib -L. -l$(RUBY_INSTALL_NAME)'
++      LIBRUBY_ALIASES='lib$(RUBY_INSTALL_NAME).so.$(MAJOR)$(MINOR) lib$(RUBY_INSTALL_NAME).so'
+       ;;
+     hpux*)
+       XLDFLAGS='-Wl,+s,+b,$(prefix)/lib'
+@@ -5286,7 +5290,7 @@
+ EOF
+ 
+ else
+-    arch="${target_cpu}-${target_os}"
++    arch="${host}"
+     cat >> confdefs.h <<EOF
+ #define RUBY_PLATFORM "${arch}"
+ EOF
+@@ -5516,6 +5520,7 @@
  s%@setup@%$setup%g
  s%@MINIRUBY@%$MINIRUBY%g
  s%@PREP@%$PREP%g
Index: patches/patch-ae
===================================================================
RCS file: /cvsroot/pkgsrc/lang/ruby-base/patches/patch-ae,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 patch-ae
--- patches/patch-ae    2001/06/30 08:07:10     1.1.1.1
+++ patches/patch-ae    2003/03/13 13:34:33
@@ -1,14 +1,17 @@
 $NetBSD: patch-ae,v 1.1.1.1 2001/06/30 08:07:10 taca Exp $
 
---- instruby.rb.orig   Tue May  1 17:43:15 2001
+--- instruby.rb.orig   Mon Dec  2 16:53:03 2002
 +++ instruby.rb
-@@ -76,27 +76,25 @@
+@@ -65,7 +65,7 @@
+ File.makedirs sitearchlibdir, true
+ 
+ if RUBY_PLATFORM =~ /-aix/
+-  File.install "ruby.imp", archlibdir, 0644, true
++  File.install "ruby.imp", archlibdir, 0444, true
  end
- Dir.chdir CONFIG["srcdir"]
  
--File.install "sample/irb.rb", "#{bindir}/irb", 0755, true
--
- Find.find("lib") do |f|
+ Dir.chdir "ext"
+@@ -117,21 +117,21 @@
    next unless /\.rb$/ =~ f || /help-message$/ =~ f
    dir = rubylibdir+"/"+File.dirname(f[4..-1])
    File.makedirs dir, true unless File.directory? dir
@@ -22,7 +25,8 @@
  end
  if RUBY_PLATFORM =~ /mswin32|mingw/
    File.makedirs archlibdir + "/win32", true
-   File.install "win32/win32.h", archlibdir + "/win32", 0644, true
+-  File.install "win32/win32.h", archlibdir + "/win32", 0644, true
++  File.install "win32/win32.h", archlibdir + "/win32", 0444, true
  end
 -File.install wdir+'/'+CONFIG['LIBRUBY_A'], archlibdir, 0644, true
 +File.install wdir+'/'+CONFIG['LIBRUBY_A'], archlibdir, 0444, true

Patch to fix PLIST on Solaris (and available at
http://www.perkin.org.uk/projects/netbsd/bsd.prefs.mk.patch):

Index: bsd.prefs.mk
===================================================================
RCS file: /cvsroot/pkgsrc/mk/bsd.prefs.mk,v
retrieving revision 1.106
diff -u -r1.106 bsd.prefs.mk
--- bsd.prefs.mk        2003/01/25 22:39:56     1.106
+++ bsd.prefs.mk        2003/03/13 13:47:46
@@ -84,7 +84,7 @@
 MAKEFLAGS+=            LOWER_ARCH=${LOWER_ARCH}
 .  endif
 LOWER_VENDOR?=         sun
-LOWER_OPSYS?=          solaris
+LOWER_OPSYS?=          solaris2
 
 .elif ${OPSYS} == "Linux"
 LOWER_OPSYS?=          linux
>Release-Note:
>Audit-Trail:
>Unformatted: