From 03845d8f8f17fe4442e70e4cfb9548505bdd6b7f Mon Sep 17 00:00:00 2001
From: Aurelien Larcher <aurelien.larcher@gmail.com>
Date: Sat, 10 Feb 2018 20:35:16 +0100
Subject: [PATCH] ruby-23: use gcc-6

---
 components/ruby/ruby-23/Makefile                   |   13 +++++++++++--
 components/ruby/ruby-23/Solaris/rbconfig.sedscript |    8 ++++----
 2 files changed, 15 insertions(+), 6 deletions(-)

diff --git a/components/ruby/ruby-23/Makefile b/components/ruby/ruby-23/Makefile
index 05bfee2..11db8f1 100644
--- a/components/ruby/ruby-23/Makefile
+++ b/components/ruby/ruby-23/Makefile
@@ -27,6 +27,7 @@
 
 COMPONENT_NAME=		ruby
 COMPONENT_VERSION=	2.3.6
+COMPONENT_REVISION=     1
 COMPONENT_PROJECT_URL=	http://www.ruby-lang.org/
 COMPONENT_SRC=	\
 	$(COMPONENT_NAME)-$(COMPONENT_VERSION)
@@ -73,7 +74,10 @@
 	    -e "s/RUBY_LIB_VER/$(RUBY_LIB_VER)/" Solaris/ruby.1.sedscript \
 	    > Solaris/ruby.1.sedscript.mod ; \
 	$(GSED) -e  "s/RUBY_VER/$(RUBY_VER)/" \
-	    -e "s/RUBY_LIB_VER/$(RUBY_LIB_VER)/" Solaris/rbconfig.sedscript \
+	    -e "s/RUBY_LIB_VER/$(RUBY_LIB_VER)/" \
+	    -e "s,%%CC%%,$(CC)," \
+	    -e "s,%%CXX%%,$(CXX)," \
+	    Solaris/rbconfig.sedscript \
 	    > Solaris/rbconfig.sedscript.mod ; \
 	$(GSED) -i -f Solaris/ruby.1.sedscript.mod \
 	    $(PROTORUBYDIR)/share/man/man1/ruby.1 ; \
@@ -89,6 +93,10 @@
 # don't use LD_Z_IGNORE: causes ruby linker problems with
 # unreferenced symbol tgetent in libreadline, similar to bug #15617172
 LD_Z_IGNORE=
+
+# Set the locale to generate documentation correctly
+COMPONENT_BUILD_ENV += LC_ALL=en_US.UTF-8
+COMPONENT_INSTALL_ENV += LC_ALL=en_US.UTF-8
 
 CONFIGURE_PREFIX =	$(USRDIR)/$(COMPONENT_NAME)/$(RUBY_VER)
 
@@ -125,6 +133,8 @@
 # RuntimeError: Error in TestGem#test_self_install_in_rescue
 test:	$(TEST_32)
 
+# Auto-generated dependencies
+REQUIRED_PACKAGES += SUNWcs
 REQUIRED_PACKAGES += library/database/gdbm
 REQUIRED_PACKAGES += library/libffi
 REQUIRED_PACKAGES += library/libyaml
@@ -137,7 +147,6 @@
 REQUIRED_PACKAGES += runtime/tcl-8
 REQUIRED_PACKAGES += runtime/tk-8
 REQUIRED_PACKAGES += shell/bash
-REQUIRED_PACKAGES += SUNWcs
 REQUIRED_PACKAGES += system/library
 REQUIRED_PACKAGES += system/library/g++-6-runtime
 REQUIRED_PACKAGES += system/library/math
diff --git a/components/ruby/ruby-23/Solaris/rbconfig.sedscript b/components/ruby/ruby-23/Solaris/rbconfig.sedscript
index 551fdb4..3eb1d2c 100644
--- a/components/ruby/ruby-23/Solaris/rbconfig.sedscript
+++ b/components/ruby/ruby-23/Solaris/rbconfig.sedscript
@@ -30,10 +30,10 @@
 # Note that for the first two command lines below,
 # /usr/bin/sed correctly substitutes; /usr/bin/gsed does not.
 # Use /usr/bin/sed for this script.
-s/\'CC=.*\/cc\'/\'CC=\/usr\/bin\/gcc\'/
-s/\'CXX=.*\/CC\'/\'CXX=\/usr\/bin\/g++\'/
-s/CONFIG\[\"CC\"\].*$/CONFIG\[\"CC\"\] = \"\/usr\/bin\/gcc\"/
-s/CONFIG\[\"CXX\"\].*$/CONFIG\[\"CXX\"\] = \"\/usr\/bin\/g++\"/
+s|\'CC=.*/cc\'|\'CC=%%CC%%\'|
+s|\'CXX=.*/CC\'|\'CXX=%%CXX%%\'|
+s|CONFIG\[\"CC\"\].*$|CONFIG\[\"CC\"\] = \"%%CC%%\"|
+s|CONFIG\[\"CXX\"\].*$|CONFIG\[\"CXX\"\] = \"%%CXX%%\"|
 s/CONFIG\[\"CFLAGS\"\].*$/CONFIG\[\"CFLAGS\"\] = \"-g -O3 -fPIC\"/
 s/CONFIG\[\"CCDLFLAGS\"\].*$/CONFIG\[\"CCDLFLAGS\"\] = \"-fPIC\"/
 s/"$(CC) -G"/"$(CC) -shared"/

--
Gitblit v1.9.3