summaryrefslogtreecommitdiffstats
path: root/meta-ruby
diff options
context:
space:
mode:
authorTudor Florea <tudor.florea@enea.com>2015-10-08 22:51:41 +0200
committerTudor Florea <tudor.florea@enea.com>2015-10-08 22:51:41 +0200
commit1219bf8a90a7bf8cd3a5363551ef635d51e8fc8e (patch)
treea21a5fc103bb3bd65ecd85ed22be5228fc54e447 /meta-ruby
downloadmeta-openembedded-1219bf8a90a7bf8cd3a5363551ef635d51e8fc8e.tar.gz
initial commit for Enea Linux 5.0 arm
Signed-off-by: Tudor Florea <tudor.florea@enea.com>
Diffstat (limited to 'meta-ruby')
-rw-r--r--meta-ruby/COPYING.MIT17
-rw-r--r--meta-ruby/README22
-rw-r--r--meta-ruby/classes/ruby.bbclass125
-rw-r--r--meta-ruby/conf/layer.conf15
-rw-r--r--meta-ruby/recipes-devtools/ruby/bundler_git.bb29
-rw-r--r--meta-ruby/recipes-devtools/ruby/ruby.inc42
-rw-r--r--meta-ruby/recipes-devtools/ruby/ruby/0001-socket-extconf-hardcode-wide-getaddr-info-test-outco.patch26
-rw-r--r--meta-ruby/recipes-devtools/ruby/ruby/extmk.patch13
-rw-r--r--meta-ruby/recipes-devtools/ruby/ruby/remove-the-dependency-on-dir.patch37
-rw-r--r--meta-ruby/recipes-devtools/ruby/ruby/ruby-1.9.3-always-use-i386.patch11
-rw-r--r--meta-ruby/recipes-devtools/ruby/ruby/ruby-1.9.3-custom-rubygems-location.patch86
-rw-r--r--meta-ruby/recipes-devtools/ruby/ruby/ruby-1.9.3-disable-versioned-paths.patch149
-rw-r--r--meta-ruby/recipes-devtools/ruby/ruby/ruby-1.9.3-install-cross.patch16
-rw-r--r--meta-ruby/recipes-devtools/ruby/ruby/ruby-1.9.3-mkmf-verbose.patch11
-rw-r--r--meta-ruby/recipes-devtools/ruby/ruby/ruby-1.9.3-rubygems-1.8.11-uninstaller.patch76
-rw-r--r--meta-ruby/recipes-devtools/ruby/ruby/ruby-mkmf.rb-fix-race-conditions-at-install-ext.patch31
-rw-r--r--meta-ruby/recipes-devtools/ruby/ruby/rubygems-1.8.11-binary-extensions.patch296
-rw-r--r--meta-ruby/recipes-devtools/ruby/ruby_1.9.3-p547.bb50
18 files changed, 1052 insertions, 0 deletions
diff --git a/meta-ruby/COPYING.MIT b/meta-ruby/COPYING.MIT
new file mode 100644
index 000000000..fb950dc69
--- /dev/null
+++ b/meta-ruby/COPYING.MIT
@@ -0,0 +1,17 @@
1Permission is hereby granted, free of charge, to any person obtaining a copy
2of this software and associated documentation files (the "Software"), to deal
3in the Software without restriction, including without limitation the rights
4to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
5copies of the Software, and to permit persons to whom the Software is
6furnished to do so, subject to the following conditions:
7
8The above copyright notice and this permission notice shall be included in
9all copies or substantial portions of the Software.
10
11THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
12IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
13FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
14AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
15LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
16OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
17THE SOFTWARE.
diff --git a/meta-ruby/README b/meta-ruby/README
new file mode 100644
index 000000000..65db19e7c
--- /dev/null
+++ b/meta-ruby/README
@@ -0,0 +1,22 @@
1This layer depends on:
2
3URI: git://github.com/openembedded/oe-core.git
4branch: dizzy
5revision: HEAD
6
7URI: git://github.com/openembedded/meta-oe.git
8branch: dizzy
9revision: HEAD
10
11Send pull requests to openembedded-devel@lists.openembedded.org with '[meta-ruby][dizzy]' in the subject'
12
13When sending single patches, please using something like:
14'git send-email -M -1 --to openembedded-devel@lists.openembedded.org --subject-prefix=meta-ruby][dizzy][PATCH'
15
16Interim layer maintainer: Martin Jansa <Martin.Jansa@gmail.com>
17
18Dizzy branch maintainers:
19 Otavio Salvador <otavio@ossystems.com.br>
20 Armin Kuster <akuster808@gmail.com>
21
22Prefix email subject with: [dizzy]
diff --git a/meta-ruby/classes/ruby.bbclass b/meta-ruby/classes/ruby.bbclass
new file mode 100644
index 000000000..9c4fcf9c3
--- /dev/null
+++ b/meta-ruby/classes/ruby.bbclass
@@ -0,0 +1,125 @@
1BPV ?= "${PV}"
2
3DEPENDS += " \
4 ruby-native \
5"
6RDEPENDS_${PN} += " \
7 ruby \
8"
9
10def get_rubyversion(p):
11 import re
12 from os.path import isfile
13 import subprocess
14 found_version = "SOMETHING FAILED!"
15
16 cmd = "%s/ruby" % p
17
18 if not isfile(cmd):
19 return found_version
20
21 version = subprocess.Popen([cmd, "--version"], stdout=subprocess.PIPE).communicate()[0]
22
23 r = re.compile("ruby ([0-9]+\.[0-9]+\.[0-9]+)*")
24 m = r.match(version)
25 if m:
26 found_version = m.group(1)
27
28 return found_version
29
30def get_rubygemslocation(p):
31 import re
32 from os.path import isfile
33 import subprocess
34 found_loc = "SOMETHING FAILED!"
35
36 cmd = "%s/gem" % p
37
38 if not isfile(cmd):
39 return found_loc
40
41 loc = subprocess.Popen([cmd, "env"], stdout=subprocess.PIPE).communicate()[0]
42
43 r = re.compile(".*\- (/usr.*/ruby/gems/.*)")
44 for line in loc.split('\n'):
45 m = r.match(line)
46 if m:
47 found_loc = m.group(1)
48 break
49
50 return found_loc
51
52def get_rubygemsversion(p):
53 import re
54 from os.path import isfile
55 import subprocess
56 found_version = "SOMETHING FAILED!"
57
58 cmd = "%s/gem" % p
59
60 if not isfile(cmd):
61 return found_version
62
63 version = subprocess.Popen([cmd, "env", "gemdir"], stdout=subprocess.PIPE).communicate()[0]
64
65 r = re.compile(".*([0-9]+\.[0-9]+\.[0-9]+)$")
66 m = r.match(version)
67 if m:
68 found_version = m.group(1)
69
70 return found_version
71
72RUBY_VERSION ?= "${@get_rubyversion("${STAGING_BINDIR_NATIVE}")}"
73RUBY_GEM_DIRECTORY ?= "${@get_rubygemslocation("${STAGING_BINDIR_NATIVE}")}"
74RUBY_GEM_VERSION ?= "${@get_rubygemsversion("${STAGING_BINDIR_NATIVE}")}"
75
76export GEM_HOME = "${STAGING_DIR_NATIVE}/usr/lib/ruby/gems/${RUBY_GEM_VERSION}"
77
78RUBY_BUILD_GEMS ?= "${BPN}.gemspec"
79RUBY_INSTALL_GEMS ?= "${BPN}-${BPV}.gem"
80
81RUBY_COMPILE_FLAGS ?= 'LANG="en_US.UTF-8" LC_ALL="en_US.UTF-8"'
82
83ruby_do_compile() {
84 for gem in ${RUBY_BUILD_GEMS}; do
85 ${RUBY_COMPILE_FLAGS} gem build $gem
86 done
87}
88
89
90ruby_do_install() {
91 for gem in ${RUBY_INSTALL_GEMS}; do
92 gem install --ignore-dependencies --local --env-shebang --install-dir ${D}/${libdir}/ruby/gems/${RUBY_GEM_VERSION}/ $gem
93 done
94
95 # create symlink from the gems bin directory to /usr/bin
96 for i in ${D}/${libdir}/ruby/gems/${RUBY_GEM_VERSION}/bin/*; do
97 if [ -e "$i" ]; then
98 if [ ! -d ${D}/${bindir} ]; then mkdir -p ${D}/${bindir}; fi
99 b=`basename $i`
100 ln -sf ${libdir}/ruby/gems/${RUBY_GEM_VERSION}/bin/$b ${D}/${bindir}/$b
101 fi
102 done
103}
104
105EXPORT_FUNCTIONS do_compile do_install
106
107PACKAGES = "${PN}-dbg ${PN} ${PN}-doc ${PN}-dev"
108
109FILES_${PN}-dbg += " \
110 ${libdir}/ruby/gems/${RUBY_GEM_VERSION}/gems/*/*/.debug \
111 ${libdir}/ruby/gems/${RUBY_GEM_VERSION}/gems/*/*/*/.debug \
112 ${libdir}/ruby/gems/${RUBY_GEM_VERSION}/gems/*/*/*/*/.debug \
113 ${libdir}/ruby/gems/${RUBY_GEM_VERSION}/gems/*/*/*/*/*/.debug \
114 "
115
116FILES_${PN} += " \
117 ${libdir}/ruby/gems/${RUBY_GEM_VERSION}/gems \
118 ${libdir}/ruby/gems/${RUBY_GEM_VERSION}/cache \
119 ${libdir}/ruby/gems/${RUBY_GEM_VERSION}/bin \
120 ${libdir}/ruby/gems/${RUBY_GEM_VERSION}/specifications \
121 "
122
123FILES_${PN}-doc += " \
124 ${libdir}/ruby/gems/${RUBY_GEM_VERSION}/doc \
125 "
diff --git a/meta-ruby/conf/layer.conf b/meta-ruby/conf/layer.conf
new file mode 100644
index 000000000..b526a5d39
--- /dev/null
+++ b/meta-ruby/conf/layer.conf
@@ -0,0 +1,15 @@
1# We have a conf and classes directory, append to BBPATH
2BBPATH .= ":${LAYERDIR}"
3
4# We have a recipes directory, add to BBFILES
5BBFILES += "${LAYERDIR}/recipes-*/*/*.bb ${LAYERDIR}/recipes-*/*/*.bbappend"
6
7BBFILE_COLLECTIONS += "ruby-layer"
8BBFILE_PATTERN_ruby-layer := "^${LAYERDIR}/"
9BBFILE_PRIORITY_ruby-layer = "7"
10
11# This should only be incremented on significant changes that will
12# cause compatibility issues with other layers
13LAYERVERSION_ruby-layer = "1"
14
15LAYERDEPENDS_ruby-layer = "core openembedded-layer"
diff --git a/meta-ruby/recipes-devtools/ruby/bundler_git.bb b/meta-ruby/recipes-devtools/ruby/bundler_git.bb
new file mode 100644
index 000000000..2adde4d21
--- /dev/null
+++ b/meta-ruby/recipes-devtools/ruby/bundler_git.bb
@@ -0,0 +1,29 @@
1SUMMARY = "Makes sure Ruby applications run the same code on every machine."
2DESCRIPTION = "Bundler makes sure Ruby applications run the same code \
3on every machine. It does this by managing the gems that the \
4application depends on. Given a list of gems, it can automatically \
5download and install those gems, as well as any other gems needed by \
6the gems that are listed. Before installing gems, it checks the \
7versions of every gem to make sure that they are compatible, and can \
8all be loaded at the same time. After the gems have been installed, \
9Bundler can help you update some or all of them when new versions \
10become available. Finally, it records the exact versions that have \
11been installed, so that others can install the exact same gems."
12
13LICENSE = "MIT"
14LIC_FILES_CHKSUM = "file://LICENSE.md;md5=196bb963e601609817d7e9ac9a64a867"
15
16PR = "r0"
17
18PV = "1.6.2"
19SRCREV = "06e3647c117da210ffd15a174624497830addd7b"
20
21S = "${WORKDIR}/git"
22
23SRC_URI = " \
24 git://github.com/bundler/bundler.git \
25 "
26
27inherit ruby
28
29BBCLASSEXTEND = "native"
diff --git a/meta-ruby/recipes-devtools/ruby/ruby.inc b/meta-ruby/recipes-devtools/ruby/ruby.inc
new file mode 100644
index 000000000..770286960
--- /dev/null
+++ b/meta-ruby/recipes-devtools/ruby/ruby.inc
@@ -0,0 +1,42 @@
1SUMMARY = "An interpreter of object-oriented scripting language"
2DESCRIPTION = "Ruby is an interpreted scripting language for quick \
3and easy object-oriented programming. It has many features to process \
4text files and to do system management tasks (as in Perl). \
5It is simple, straight-forward, and extensible. \
6"
7HOMEPAGE = "http://www.ruby-lang.org/"
8SECTION = "devel/ruby"
9LICENSE = "Ruby | BSD | GPLv2"
10LIC_FILES_CHKSUM = "\
11 file://COPYING;md5=837b32593517ae48b9c3b5c87a5d288c \
12 file://BSDL;md5=3949e007205deef714bd225e1ee4a8ea \
13 file://GPL;md5=393a5ca445f6965873eca0259a17f833 \
14 file://LEGAL;md5=3ce1fae39fe573b818c0af162bce6579 \
15"
16
17DEPENDS = "ruby-native zlib openssl tcl libyaml db gdbm readline"
18DEPENDS_class-native = "libyaml-native"
19
20INC_PR = "r1"
21
22SHRT_VER = "${@bb.data.getVar('PV',d,1).split('.')[0]}.${@bb.data.getVar('PV',d,1).split('.')[1]}"
23SRC_URI = "http://cache.ruby-lang.org/pub/ruby/${SHRT_VER}/ruby-${PV}.tar.gz \
24 file://extmk.patch \
25"
26
27S = "${WORKDIR}/ruby-${PV}"
28
29inherit autotools
30
31
32# This snippet lets compiled extensions which rely on external libraries,
33# such as zlib, compile properly. If we don't do this, then when extmk.rb
34# runs, it uses the native libraries instead of the target libraries, and so
35# none of the linking operations succeed -- which makes extconf.rb think
36# that the libraries aren't available and hence that the extension can't be
37# built.
38
39do_configure_prepend() {
40 sed -i "s#%%TARGET_CFLAGS%%#$TARGET_CFLAGS#; s#%%TARGET_LDFLAGS%%#$TARGET_LDFLAGS#" ${S}/common.mk
41 rm -rf ${S}/ruby/
42}
diff --git a/meta-ruby/recipes-devtools/ruby/ruby/0001-socket-extconf-hardcode-wide-getaddr-info-test-outco.patch b/meta-ruby/recipes-devtools/ruby/ruby/0001-socket-extconf-hardcode-wide-getaddr-info-test-outco.patch
new file mode 100644
index 000000000..712602ace
--- /dev/null
+++ b/meta-ruby/recipes-devtools/ruby/ruby/0001-socket-extconf-hardcode-wide-getaddr-info-test-outco.patch
@@ -0,0 +1,26 @@
1From 9341293e71c03fe606edc9157bf1e13e3dd5b507 Mon Sep 17 00:00:00 2001
2From: Koen Kooi <koen@dominion.thruhere.net>
3Date: Fri, 17 Dec 2010 11:35:38 +0100
4Subject: [PATCH] socket extconf: hardcode wide-getaddr info test outcome to true
5
6Without this the socket extension doesn't build correctly
7
8Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
9---
10 ext/socket/extconf.rb | 5 +++++
11 1 file changed, 5 insertions(+)
12
13--- a/ext/socket/extconf.rb
14+++ b/ext/socket/extconf.rb
15@@ -356,6 +356,11 @@
16 exit(EXIT_FAILURE);
17 }
18 EOF
19+
20+# Ignore the actual result of the above test and assume that
21+# everything is OK.
22+getaddr_info_ok = true
23+
24 if ipv6 and not getaddr_info_ok
25 abort <<EOS
26
diff --git a/meta-ruby/recipes-devtools/ruby/ruby/extmk.patch b/meta-ruby/recipes-devtools/ruby/ruby/extmk.patch
new file mode 100644
index 000000000..8b6845034
--- /dev/null
+++ b/meta-ruby/recipes-devtools/ruby/ruby/extmk.patch
@@ -0,0 +1,13 @@
1diff -ru ruby-1.8.7-p248.orig/ext/extmk.rb ruby-1.8.7-p248/ext/extmk.rb
2--- ruby-1.8.7-p248.orig/ext/extmk.rb 2009-12-24 03:01:58.000000000 -0600
3+++ ruby-1.8.7-p248/ext/extmk.rb 2010-02-12 15:55:27.370061558 -0600
4@@ -354,8 +354,8 @@
5 $ruby = '$(topdir)/miniruby' + EXEEXT
6 end
7 $ruby << " -I'$(topdir)'"
8+$ruby << " -I'$(top_srcdir)/lib'"
9 unless CROSS_COMPILING
10- $ruby << " -I'$(top_srcdir)/lib'"
11 $ruby << " -I'$(extout)/$(arch)' -I'$(extout)/common'" if $extout
12 $ruby << " -I./- -I'$(top_srcdir)/ext' -rpurelib.rb"
13 ENV["RUBYLIB"] = "-"
diff --git a/meta-ruby/recipes-devtools/ruby/ruby/remove-the-dependency-on-dir.patch b/meta-ruby/recipes-devtools/ruby/ruby/remove-the-dependency-on-dir.patch
new file mode 100644
index 000000000..a4ac3eacc
--- /dev/null
+++ b/meta-ruby/recipes-devtools/ruby/ruby/remove-the-dependency-on-dir.patch
@@ -0,0 +1,37 @@
1remove a duplicate dependency
2
3Upstream-status: Pending
4
5The install-rb-default dependency is as below:
6
7pre-install-rb-default:
8 mkdir -p $(RUBYLIBDIR)/bigdecimal
9
10install-rb-default: pre-install-rb-default $(RUBYLIBDIR)/bigdecimal
11
12In fact, dependency on $(RUBYLIBDIR)/bigdecimal is duplicate, and not rule
13for $(RUBYLIBDIR)/bigdecimal, once $(RUBYLIBDIR)/bigdecimal is checked before
14pre-install-rb-default, the below error will happen
15 *** No rule to make target `../../.ext/common/yaml', needed by `install-rb-default'. Stop
16
17Signed-off-by: Roy Li <rongqing.li@windriver.com>
18---
19 lib/mkmf.rb | 2 +-
20 1 file changed, 1 insertion(+), 1 deletion(-)
21
22diff --git a/lib/mkmf.rb b/lib/mkmf.rb
23index 1f5ed76..556684c 100644
24--- a/lib/mkmf.rb
25+++ b/lib/mkmf.rb
26@@ -2054,7 +2054,7 @@ static: $(STATIC_LIB)#{$extout ? " install-rb" : ""}
27 end
28 for f in files
29 dest = "#{dir}/#{File.basename(f)}"
30- mfile.print("install-rb#{sfx}: #{dest} #{dir}\n")
31+ mfile.print("install-rb#{sfx}: #{dest}\n")
32 mfile.print("#{dest}: #{f}\n")
33 mfile.print("\t$(Q) $(#{$extout ? 'COPY' : 'INSTALL_DATA'}) #{f} $(@D#{sep})\n")
34 if defined?($installed_list) and !$extout
35--
361.7.10.4
37
diff --git a/meta-ruby/recipes-devtools/ruby/ruby/ruby-1.9.3-always-use-i386.patch b/meta-ruby/recipes-devtools/ruby/ruby/ruby-1.9.3-always-use-i386.patch
new file mode 100644
index 000000000..f5a8c3de3
--- /dev/null
+++ b/meta-ruby/recipes-devtools/ruby/ruby/ruby-1.9.3-always-use-i386.patch
@@ -0,0 +1,11 @@
1--- a/configure.in.orig 2011-10-18 08:56:21.587594685 +0200
2+++ b/configure.in 2011-10-18 08:56:59.751593321 +0200
3@@ -2935,6 +2935,8 @@
4 configure_args=$ac_configure_args
5 AC_SUBST(configure_args)dnl
6
7+target_cpu=`echo $target_cpu | sed s/i.86/i386/`
8+
9 if test "${universal_binary-no}" = yes ; then
10 arch="universal-${target_os}"
11 AC_CACHE_CHECK(whether __ARCHITECTURE__ is available, rb_cv_architecture_available,
diff --git a/meta-ruby/recipes-devtools/ruby/ruby/ruby-1.9.3-custom-rubygems-location.patch b/meta-ruby/recipes-devtools/ruby/ruby/ruby-1.9.3-custom-rubygems-location.patch
new file mode 100644
index 000000000..e11febc75
--- /dev/null
+++ b/meta-ruby/recipes-devtools/ruby/ruby/ruby-1.9.3-custom-rubygems-location.patch
@@ -0,0 +1,86 @@
1From 279a693ce4ef3a887ce8d4fa59e0f2616a14d91a Mon Sep 17 00:00:00 2001
2From: =?UTF-8?q?V=C3=ADt=20Ondruch?= <vondruch@redhat.com>
3Date: Fri, 11 Nov 2011 13:14:45 +0100
4Subject: [PATCH] Allow to install RubyGems into custom location, outside of
5 Ruby tree.
6
7---
8 configure.in | 8 ++++++++
9 tool/mkconfig.rb | 1 +
10 tool/rbinstall.rb | 9 +++++++++
11 version.c | 4 ++++
12 4 files changed, 22 insertions(+)
13
14--- a/configure.in
15+++ b/configure.in
16@@ -2801,6 +2801,13 @@
17 dir="${VENDOR_DIR}"
18 done
19
20+AC_ARG_WITH(rubygemsdir,
21+ AS_HELP_STRING([--with-rubygemsdir=DIR], [custom rubygems directory]),
22+ [rubygemsdir=$withval])
23+if test "$rubygemsdir" != ""; then
24+ AC_DEFINE_UNQUOTED(RUBYGEMS_DIR,"$rubygemsdir")
25+fi
26+
27 if test "${LOAD_RELATIVE+set}"; then
28 AC_DEFINE_UNQUOTED(LOAD_RELATIVE, $LOAD_RELATIVE)
29 RUBY_EXEC_PREFIX=""
30@@ -2921,6 +2928,7 @@
31 AC_SUBST(rubyhdrdir)dnl
32 AC_SUBST(sitehdrdir)dnl
33 AC_SUBST(vendorhdrdir)dnl
34+AC_SUBST(rubygemsdir)dnl
35
36 AC_ARG_WITH(opt-dir,
37 AS_HELP_STRING([--with-opt-dir=DIR], [add optional headers and libraries DIR]))
38--- a/tool/mkconfig.rb
39+++ b/tool/mkconfig.rb
40@@ -78,6 +78,7 @@
41 when /^RUBY_SO_NAME$/; next if $so_name
42 when /^arch$/; if val.empty? then val = arch else arch = val end
43 when /^sitearch/; val = '$(arch)' if val.empty?
44+ when /^rubygemsdir/; next if val.empty?
45 end
46 case val
47 when /^\$\(ac_\w+\)$/; next
48--- a/tool/rbinstall.rb
49+++ b/tool/rbinstall.rb
50@@ -300,6 +300,7 @@
51 sitearchlibdir = CONFIG["sitearchdir"]
52 vendorlibdir = CONFIG["vendorlibdir"]
53 vendorarchlibdir = CONFIG["vendorarchdir"]
54+rubygemsdir = CONFIG["rubygemsdir"]
55 mandir = CONFIG["mandir"]
56 capidir = CONFIG["docdir"]
57 configure_args = Shellwords.shellwords(CONFIG["configure_args"])
58@@ -487,7 +488,15 @@
59 install?(:local, :comm, :lib) do
60 prepare "library scripts", rubylibdir
61 noinst = %w[README* *.txt *.rdoc]
62+ noinst += %w[*ubygems.rb rubygems/ datadir.rb] if rubygemsdir
63 install_recursive(File.join(srcdir, "lib"), rubylibdir, :no_install => noinst, :mode => $data_mode)
64+ if rubygemsdir
65+ noinst = %w[obsolete.rb]
66+ install_recursive(File.join(srcdir, "lib", "rubygems"), File.join(rubygemsdir, "rubygems"), :mode => $data_mode)
67+ install_recursive(File.join(srcdir, "lib", "rbconfig"), File.join(rubygemsdir, "rbconfig"), :no_install => noinst, :mode => $data_mode)
68+ install(File.join(srcdir, "lib", "ubygems.rb"), File.join(rubygemsdir, "ubygems.rb"), :mode => $data_mode)
69+ install(File.join(srcdir, "lib", "rubygems.rb"), File.join(rubygemsdir, "rubygems.rb"), :mode => $data_mode)
70+ end
71 end
72
73 install?(:local, :arch, :lib) do
74--- a/version.c
75+++ b/version.c
76@@ -97,6 +97,10 @@
77 #endif
78 #endif
79
80+#ifdef RUBYGEMS_DIR
81+ RUBYGEMS_DIR "\0"
82+#endif
83+
84 RUBY_LIB "\0"
85 #ifdef RUBY_THIN_ARCHLIB
86 RUBY_THIN_ARCHLIB "\0"
diff --git a/meta-ruby/recipes-devtools/ruby/ruby/ruby-1.9.3-disable-versioned-paths.patch b/meta-ruby/recipes-devtools/ruby/ruby/ruby-1.9.3-disable-versioned-paths.patch
new file mode 100644
index 000000000..6d0c5e1ac
--- /dev/null
+++ b/meta-ruby/recipes-devtools/ruby/ruby/ruby-1.9.3-disable-versioned-paths.patch
@@ -0,0 +1,149 @@
1From fa1a50ad10814f724b8713865dc222724cb955ab Mon Sep 17 00:00:00 2001
2From: =?UTF-8?q?V=C3=ADt=20Ondruch?= <vondruch@redhat.com>
3Date: Thu, 25 Aug 2011 14:33:51 +0200
4Subject: [PATCH] Allow to disable versioned paths.
5
6---
7 configure.in | 11 +++++++++++
8 tool/mkconfig.rb | 9 ++++++---
9 version.c | 10 ++++++++++
10 3 files changed, 27 insertions(+), 3 deletions(-)
11
12diff --git a/configure.in b/configure.in
13index e742e74..86cb68f 100644
14--- a/configure.in
15+++ b/configure.in
16@@ -2963,6 +2963,17 @@ else
17 fi
18 AC_SUBST(USE_RUBYGEMS)
19
20+AC_ARG_ENABLE(versioned-paths,
21+ AS_HELP_STRING([--disable-versioned-paths], [disable paths with version number]),
22+ [enable_versioned_paths="$enableval"], [enable_versioned_paths=yes])
23+if test x"$enable_versioned_paths" = xno; then
24+ AC_DEFINE(DISABLE_VERSIONED_PATHS, 1)
25+ USE_VERSIONED_PATHS=NO
26+else
27+ USE_VERSIONED_PATHS=YES
28+fi
29+AC_SUBST(USE_VERSIONED_PATHS)
30+
31 arch_hdrdir="${EXTOUT}/include/${arch}/ruby"
32 AS_MKDIR_P("${arch_hdrdir}")
33 config_h="${arch_hdrdir}/config.h"
34diff --git a/tool/mkconfig.rb b/tool/mkconfig.rb
35index a2221f0..47d8c8f 100755
36--- a/tool/mkconfig.rb
37+++ b/tool/mkconfig.rb
38@@ -42,6 +42,7 @@ v_others = []
39 vars = {}
40 continued_name = nil
41 continued_line = nil
42+path_version = "/$(ruby_version)"
43 File.foreach "config.status" do |line|
44 next if /^#/ =~ line
45 name = nil
46@@ -138,6 +139,8 @@ File.foreach "config.status" do |line|
47 case name
48 when "ruby_version"
49 version = val[/\A"(.*)"\z/, 1]
50+ when /^USE_VERSIONED_PATHS$/
51+ path_version = nil if /NO/ =~ val
52 end
53 end
54 # break if /^CEOF/
55@@ -203,15 +206,15 @@ end
56 print(*v_fast)
57 print(*v_others)
58 print <<EOS
59- CONFIG["rubylibdir"] = "$(rubylibprefix)/$(ruby_version)"
60+ CONFIG["rubylibdir"] = "$(rubylibprefix)#{path_version}"
61 CONFIG["archdir"] = "$(rubylibdir)/$(arch)"
62 EOS
63 print <<EOS unless v_disabled["sitedir"]
64- CONFIG["sitelibdir"] = "$(sitedir)/$(ruby_version)"
65+ CONFIG["sitelibdir"] = "$(sitedir)#{path_version}"
66 CONFIG["sitearchdir"] = "$(sitelibdir)/$(sitearch)"
67 EOS
68 print <<EOS unless v_disabled["vendordir"]
69- CONFIG["vendorlibdir"] = "$(vendordir)/$(ruby_version)"
70+ CONFIG["vendorlibdir"] = "$(vendordir)#{path_version}"
71 CONFIG["vendorarchdir"] = "$(vendorlibdir)/$(sitearch)"
72 EOS
73 print <<EOS
74diff --git a/version.c b/version.c
75index 59d4e5e..641dc33 100644
76--- a/version.c
77+++ b/version.c
78@@ -38,9 +38,15 @@
79 #define RUBY_VENDOR_LIB RUBY_LIB_PREFIX"/vendor_ruby"
80 #endif
81
82+#ifdef DISABLE_VERSIONED_PATHS
83+#define RUBY_LIB RUBY_LIB_PREFIX
84+#define RUBY_SITE_LIB2 RUBY_SITE_LIB
85+#define RUBY_VENDOR_LIB2 RUBY_VENDOR_LIB
86+#else
87 #define RUBY_LIB RUBY_LIB_PREFIX "/"RUBY_LIB_VERSION
88 #define RUBY_SITE_LIB2 RUBY_SITE_LIB "/"RUBY_LIB_VERSION
89 #define RUBY_VENDOR_LIB2 RUBY_VENDOR_LIB "/"RUBY_LIB_VERSION
90+#endif
91 #define RUBY_ARCHLIB RUBY_LIB "/"RUBY_ARCH
92 #define RUBY_SITE_ARCHLIB RUBY_SITE_LIB2 "/"RUBY_SITEARCH
93 #define RUBY_VENDOR_ARCHLIB RUBY_VENDOR_LIB2 "/"RUBY_SITEARCH
94@@ -75,8 +81,10 @@ const char ruby_initial_load_paths[] =
95 RUBY_SITE_THIN_ARCHLIB "\0"
96 #endif
97 RUBY_SITE_ARCHLIB "\0"
98+#ifndef DISABLE_VERSIONED_PATHS
99 RUBY_SITE_LIB "\0"
100 #endif
101+#endif
102
103 #ifndef NO_RUBY_VENDOR_LIB
104 RUBY_VENDOR_LIB2 "\0"
105@@ -84,8 +92,10 @@ const char ruby_initial_load_paths[] =
106 RUBY_VENDOR_THIN_ARCHLIB "\0"
107 #endif
108 RUBY_VENDOR_ARCHLIB "\0"
109+#ifndef DISABLE_VERSIONED_PATHS
110 RUBY_VENDOR_LIB "\0"
111 #endif
112+#endif
113
114 RUBY_LIB "\0"
115 #ifdef RUBY_THIN_ARCHLIB
116--
1171.7.7.3
118diff --git a/lib/rdoc/ri/paths.rb b/lib/rdoc/ri/paths.rb
119index a3c65bf..0575730 100644
120--- a/lib/rdoc/ri/paths.rb
121+++ b/lib/rdoc/ri/paths.rb
122@@ -11,9 +11,9 @@ module RDoc::RI::Paths
123 version = RbConfig::CONFIG['ruby_version']
124
125 base = if RbConfig::CONFIG.key? 'ridir' then
126- File.join RbConfig::CONFIG['ridir'], version
127+ File.join [RbConfig::CONFIG['ridir'], RbConfig::CONFIG['USE_VERSIONED_PATHS'] == 'YES' ? version : nil].compact
128 else
129- File.join RbConfig::CONFIG['datadir'], 'ri', version
130+ File.join [RbConfig::CONFIG['datadir'], 'ri', RbConfig::CONFIG['USE_VERSIONED_PATHS'] == 'YES' ? version : nil].compact
131 end
132
133 SYSDIR = File.join base, "system"
134diff --git a/tool/rbinstall.rb b/tool/rbinstall.rb
135index cec8c9f..fed14d2 100755
136--- a/tool/rbinstall.rb
137+++ b/tool/rbinstall.rb
138@@ -379,7 +379,7 @@ end
139
140 install?(:doc, :rdoc) do
141 if $rdocdir
142- ridatadir = File.join(CONFIG['ridir'], CONFIG['ruby_version'], "system")
143+ ridatadir = File.join([CONFIG['ridir'], RbConfig::CONFIG['USE_VERSIONED_PATHS'] == 'YES' ? version : nil, "system"].compact)
144 prepare "rdoc", ridatadir
145 install_recursive($rdocdir, ridatadir, :mode => $data_mode)
146 end
147--
1481.7.6
149
diff --git a/meta-ruby/recipes-devtools/ruby/ruby/ruby-1.9.3-install-cross.patch b/meta-ruby/recipes-devtools/ruby/ruby/ruby-1.9.3-install-cross.patch
new file mode 100644
index 000000000..9515ece83
--- /dev/null
+++ b/meta-ruby/recipes-devtools/ruby/ruby/ruby-1.9.3-install-cross.patch
@@ -0,0 +1,16 @@
1---
2 Makefile.in | 3 ++-
3 1 file changed, 2 insertions(+), 1 deletion(-)
4
5--- a/Makefile.in
6+++ b/Makefile.in
7@@ -210,7 +210,8 @@
8 @$(RM) fake.rb fake-rbconfig.rb
9 $(INSTALL_DATA) $(arch_hdrdir)/ruby/config.h $(XRUBY_RUBYHDRDIR)/$(arch)/ruby
10 $(INSTALL_DATA) $(top_srcdir)/include/ruby/win32.h $(XRUBY_RUBYHDRDIR)/ruby
11- $(INSTALL_DATA) $(LIBRUBY) $(LIBRUBY_A) $(XRUBY_RUBYLIBDIR)/$(arch)
12+ $(INSTALL_DATA) $(LIBRUBY) $(XRUBY_RUBYLIBDIR)/$(arch)
13+ $(INSTALL_DATA) $(LIBRUBY_A) $(XRUBY_RUBYLIBDIR)/$(arch)
14 $(INSTALL_PROGRAM) $(LIBRUBY_SO) $(XRUBY_RUBYLIBDIR)/$(arch)
15
16 Makefile: $(srcdir)/Makefile.in $(srcdir)/enc/Makefile.in
diff --git a/meta-ruby/recipes-devtools/ruby/ruby/ruby-1.9.3-mkmf-verbose.patch b/meta-ruby/recipes-devtools/ruby/ruby/ruby-1.9.3-mkmf-verbose.patch
new file mode 100644
index 000000000..7da66c8e6
--- /dev/null
+++ b/meta-ruby/recipes-devtools/ruby/ruby/ruby-1.9.3-mkmf-verbose.patch
@@ -0,0 +1,11 @@
1--- ruby-1.9.3-p0/lib/mkmf.rb.debug 2011-08-11 15:07:37.000000000 +0900
2+++ ruby-1.9.3-p0/lib/mkmf.rb 2012-01-29 21:34:17.000000000 +0900
3@@ -1638,7 +1638,7 @@
4 SHELL = /bin/sh
5
6 # V=0 quiet, V=1 verbose. other values don't work.
7-V = 0
8+V = 1
9 Q1 = $(V:1=)
10 Q = $(Q1:0=@)
11 n=$(NULLCMD)
diff --git a/meta-ruby/recipes-devtools/ruby/ruby/ruby-1.9.3-rubygems-1.8.11-uninstaller.patch b/meta-ruby/recipes-devtools/ruby/ruby/ruby-1.9.3-rubygems-1.8.11-uninstaller.patch
new file mode 100644
index 000000000..af1cff250
--- /dev/null
+++ b/meta-ruby/recipes-devtools/ruby/ruby/ruby-1.9.3-rubygems-1.8.11-uninstaller.patch
@@ -0,0 +1,76 @@
1--- ruby-1.9.3-p0/lib/rubygems/uninstaller.rb.orig 2011-10-31 10:22:36.321579483 +0100
2+++ ruby-1.9.3-p0/lib/rubygems/uninstaller.rb 2011-10-31 10:34:25.563626119 +0100
3@@ -51,15 +51,14 @@
4 @bin_dir = options[:bin_dir]
5 @format_executable = options[:format_executable]
6
7+ if options[:force]
8+ @force_all = true
9+ @force_ignore = true
10+ end
11+
12 # only add user directory if install_dir is not set
13 @user_install = false
14 @user_install = options[:user_install] unless options[:install_dir]
15-
16- if @user_install then
17- Gem.use_paths Gem.user_dir, @gem_home
18- else
19- Gem.use_paths @gem_home
20- end
21 end
22
23 ##
24@@ -69,10 +68,24 @@
25 def uninstall
26 list = Gem::Specification.find_all_by_name(@gem, @version)
27
28+ list, other_repo_specs = list.partition do |spec|
29+ @gem_home == spec.base_dir or
30+ (@user_install and spec.base_dir == Gem.user_dir)
31+ end
32+
33 if list.empty? then
34- raise Gem::InstallError, "gem #{@gem.inspect} is not installed"
35+ raise Gem::InstallError, "gem #{@gem.inspect} is not installed" if
36+ other_repo_specs.empty?
37+
38+ other_repos = other_repo_specs.map { |spec| spec.base_dir }.uniq
39+
40+ message = ["#{@gem} is not installed in GEM_HOME, try:"]
41+ message.concat other_repos.map { |repo|
42+ "\tgem uninstall -i #{repo} #{@gem}"
43+ }
44
45- elsif list.size > 1 and @force_all then
46+ raise Gem::InstallError, message.join("\n")
47+ elsif @force_all then
48 remove_all list
49
50 elsif list.size > 1 then
51@@ -250,12 +263,10 @@
52 msg << "\t#{spec.full_name}"
53
54 spec.dependent_gems.each do |dep_spec, dep, satlist|
55- msg <<
56- ("#{dep_spec.name}-#{dep_spec.version} depends on " +
57- "[#{dep.name} (#{dep.requirement})]")
58+ msg << "#{dep_spec.name}-#{dep_spec.version} depends on #{dep}"
59 end
60
61- msg << 'If you remove this gems, one or more dependencies will not be met.'
62+ msg << 'If you remove this gem, one or more dependencies will not be met.'
63 msg << 'Continue with Uninstall?'
64 return ask_yes_no(msg.join("\n"), true)
65 end
66
67--- ruby-1.9.3-p0/test/rubygems/test_gem_uninstaller.rb.orig 2011-11-03 08:58:31.411272176 +0100
68+++ ruby-1.9.3-p0/test/rubygems/test_gem_uninstaller.rb 2011-11-03 08:58:43.010272351 +0100
69@@ -225,7 +225,7 @@
70
71 uninstaller = Gem::Uninstaller.new('a')
72
73- use_ui Gem::MockGemUi.new("2\n") do
74+ use_ui Gem::MockGemUi.new("2\ny\n") do
75 uninstaller.uninstall
76 end
diff --git a/meta-ruby/recipes-devtools/ruby/ruby/ruby-mkmf.rb-fix-race-conditions-at-install-ext.patch b/meta-ruby/recipes-devtools/ruby/ruby/ruby-mkmf.rb-fix-race-conditions-at-install-ext.patch
new file mode 100644
index 000000000..5ac5d54a3
--- /dev/null
+++ b/meta-ruby/recipes-devtools/ruby/ruby/ruby-mkmf.rb-fix-race-conditions-at-install-ext.patch
@@ -0,0 +1,31 @@
1Subject: [PATCH] mkmf.rb: fix race conditions at install-ext
2
3Upstream-Status: backport
4
5* lib/mkmf.rb (create_makefile): fix race conditions at install-ext.
6 target files need to depend on destination directory timestamp
7 files, not phony trgets.
8
9git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36863 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
10
11Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
12---
13 lib/mkmf.rb | 2 +-
14 1 file changed, 1 insertion(+), 1 deletion(-)
15
16diff --git a/lib/mkmf.rb b/lib/mkmf.rb
17index 556684c..a277354 100644
18--- a/lib/mkmf.rb
19+++ b/lib/mkmf.rb
20@@ -2055,7 +2055,7 @@ static: $(STATIC_LIB)#{$extout ? " install-rb" : ""}
21 for f in files
22 dest = "#{dir}/#{File.basename(f)}"
23 mfile.print("install-rb#{sfx}: #{dest}\n")
24- mfile.print("#{dest}: #{f}\n")
25+ mfile.print("#{dest}: #{f} #{timestamp_file(dir)}\n")
26 mfile.print("\t$(Q) $(#{$extout ? 'COPY' : 'INSTALL_DATA'}) #{f} $(@D#{sep})\n")
27 if defined?($installed_list) and !$extout
28 mfile.print("\t@echo #{dest}>>$(INSTALLED_LIST)\n")
29--
302.0.0
31
diff --git a/meta-ruby/recipes-devtools/ruby/ruby/rubygems-1.8.11-binary-extensions.patch b/meta-ruby/recipes-devtools/ruby/ruby/rubygems-1.8.11-binary-extensions.patch
new file mode 100644
index 000000000..5a3bfb451
--- /dev/null
+++ b/meta-ruby/recipes-devtools/ruby/ruby/rubygems-1.8.11-binary-extensions.patch
@@ -0,0 +1,296 @@
1From 5a37a3489491a33f2e7011043fbbcd9a765e1777 Mon Sep 17 00:00:00 2001
2From: =?UTF-8?q?V=C3=ADt=20Ondruch?= <vondruch@redhat.com>
3Date: Thu, 3 Nov 2011 16:43:05 +0100
4Subject: [PATCH 1/6] Add dedicate extensions folder into $LOAD_PATH.
5
6---
7 lib/rubygems/specification.rb | 37 ++++++++++++++++++++++++++++++-------
8 1 files changed, 30 insertions(+), 7 deletions(-)
9
10diff --git a/lib/rubygems/specification.rb b/lib/rubygems/specification.rb
11index 97db19e..263e7d3 100644
12--- a/lib/rubygems/specification.rb
13+++ b/lib/rubygems/specification.rb
14@@ -843,6 +843,12 @@ class Gem::Specification
15 File.join full_gem_path, path
16 end
17
18+ unless extensions.empty?
19+ paths += require_paths.map do |path|
20+ File.join ext_dir, path
21+ end
22+ end
23+
24 # gem directories must come after -I and ENV['RUBYLIB']
25 insert_index = Gem.load_path_insert_index
26
27@@ -954,16 +960,16 @@ class Gem::Specification
28
29 def contains_requirable_file? file
30 root = full_gem_path
31+ ext = ext_dir
32+
33+ require_paths.any? do |lib|
34+ base = ["#{root}/#{lib}/#{file}"]
35+ base << "#{ext}/#{lib}/#{file}" unless extensions.empty?
36
37- require_paths.each do |lib|
38- base = "#{root}/#{lib}/#{file}"
39- Gem.suffixes.each do |suf|
40- path = "#{base}#{suf}"
41- return true if File.file? path
42+ base.any? do |path|
43+ Gem.suffixes.any? { |suf| File.file? "#{path}#{suf}" }
44 end
45 end
46-
47- return false
48 end
49
50 ##
51@@ -1273,6 +1279,23 @@ class Gem::Specification
52 end
53
54 ##
55+ # Returns the full path to this spec's ext directory.
56+ # eg: /usr/local/lib/ruby/1.8/exts/mygem-1.0
57+
58+ def ext_dir
59+ @gem_dir ||= File.expand_path File.join(exts_dir, full_name)
60+ end
61+
62+ ##
63+ # Returns the full path to the exts directory containing this spec's
64+ # gem directory. eg: /usr/local/lib/ruby/1.8/exts
65+
66+ def exts_dir
67+ # TODO: this logic seems terribly broken, but tests fail if just base_dir
68+ @exts_dir ||= File.join(loaded_from && base_dir || Gem.dir, "exts")
69+ end
70+
71+ ##
72 # Deprecated and ignored, defaults to true.
73 #
74 # Formerly used to indicate this gem was RDoc-capable.
75--
761.7.7.3
77
78
79From 671e4285bf9db948bc5f054d7d3d931cdd7a17f8 Mon Sep 17 00:00:00 2001
80From: =?UTF-8?q?V=C3=ADt=20Ondruch?= <vondruch@redhat.com>
81Date: Wed, 16 Nov 2011 13:26:48 +0100
82Subject: [PATCH 2/6] Use spec's ext dir for extension installation.
83
84---
85 lib/rubygems/installer.rb | 2 +-
86 lib/rubygems/specification.rb | 7 +++----
87 2 files changed, 4 insertions(+), 5 deletions(-)
88
89diff --git a/lib/rubygems/installer.rb b/lib/rubygems/installer.rb
90index 74d803d..0063c7f 100644
91--- a/lib/rubygems/installer.rb
92+++ b/lib/rubygems/installer.rb
93@@ -499,7 +499,7 @@ TEXT
94 def build_extensions
95 return if spec.extensions.empty?
96 say "Building native extensions. This could take a while..."
97- dest_path = File.join gem_dir, spec.require_paths.first
98+ dest_path = spec.ext_dir
99 ran_rake = false # only run rake once
100
101 spec.extensions.each do |extension|
102diff --git a/lib/rubygems/specification.rb b/lib/rubygems/specification.rb
103index 263e7d3..d31b93b 100644
104--- a/lib/rubygems/specification.rb
105+++ b/lib/rubygems/specification.rb
106@@ -1283,16 +1283,15 @@ class Gem::Specification
107 # eg: /usr/local/lib/ruby/1.8/exts/mygem-1.0
108
109 def ext_dir
110- @gem_dir ||= File.expand_path File.join(exts_dir, full_name)
111+ @ext_dir ||= File.join exts_dir, full_name, require_paths.first
112 end
113
114 ##
115 # Returns the full path to the exts directory containing this spec's
116- # gem directory. eg: /usr/local/lib/ruby/1.8/exts
117+ # gem directory. eg: /usr/local/lib/ruby/1.8/gems
118
119 def exts_dir
120- # TODO: this logic seems terribly broken, but tests fail if just base_dir
121- @exts_dir ||= File.join(loaded_from && base_dir || Gem.dir, "exts")
122+ @exts_dir ||= gems_dir
123 end
124
125 ##
126--
1271.7.7.3
128
129
130From 11b4a0cbadd8b1d3320f838881aa60feb6f848e7 Mon Sep 17 00:00:00 2001
131From: =?UTF-8?q?V=C3=ADt=20Ondruch?= <vondruch@redhat.com>
132Date: Wed, 16 Nov 2011 14:52:16 +0100
133Subject: [PATCH 3/6] Simplify the extending of $LOAD_PATH for binary gems.
134
135---
136 lib/rubygems/specification.rb | 11 +++++------
137 1 files changed, 5 insertions(+), 6 deletions(-)
138
139diff --git a/lib/rubygems/specification.rb b/lib/rubygems/specification.rb
140index d31b93b..e65ea2d 100644
141--- a/lib/rubygems/specification.rb
142+++ b/lib/rubygems/specification.rb
143@@ -843,11 +843,7 @@ class Gem::Specification
144 File.join full_gem_path, path
145 end
146
147- unless extensions.empty?
148- paths += require_paths.map do |path|
149- File.join ext_dir, path
150- end
151- end
152+ paths << ext_dir unless extensions.empty? || paths.include?(ext_dir)
153
154 # gem directories must come after -I and ENV['RUBYLIB']
155 insert_index = Gem.load_path_insert_index
156@@ -1291,7 +1287,10 @@ class Gem::Specification
157 # gem directory. eg: /usr/local/lib/ruby/1.8/gems
158
159 def exts_dir
160- @exts_dir ||= gems_dir
161+ @exts_dir ||= begin
162+ dirs = Gem.default_dirs.detect {|location, paths| paths[:gem_dir] == base_dir}
163+ dirs ? File.join(dirs.last[:ext_dir], 'exts') : gems_dir
164+ end
165 end
166
167 ##
168--
1691.7.7.3
170
171
172From 5d46cd2b1ac9517a9cbcfa430261e62bb3a376b8 Mon Sep 17 00:00:00 2001
173From: =?UTF-8?q?V=C3=ADt=20Ondruch?= <vondruch@redhat.com>
174Date: Fri, 9 Dec 2011 16:31:04 +0100
175Subject: [PATCH 4/6] Fix the binary extension search path construction.
176
177---
178 lib/rubygems/installer.rb | 2 +-
179 lib/rubygems/specification.rb | 4 ++--
180 2 files changed, 3 insertions(+), 3 deletions(-)
181
182diff --git a/lib/rubygems/installer.rb b/lib/rubygems/installer.rb
183index 0063c7f..83b8fd5 100644
184--- a/lib/rubygems/installer.rb
185+++ b/lib/rubygems/installer.rb
186@@ -499,7 +499,7 @@ TEXT
187 def build_extensions
188 return if spec.extensions.empty?
189 say "Building native extensions. This could take a while..."
190- dest_path = spec.ext_dir
191+ dest_path = File.join spec.ext_dir, spec.require_paths.first
192 ran_rake = false # only run rake once
193
194 spec.extensions.each do |extension|
195diff --git a/lib/rubygems/specification.rb b/lib/rubygems/specification.rb
196index e65ea2d..8be2ade 100644
197--- a/lib/rubygems/specification.rb
198+++ b/lib/rubygems/specification.rb
199@@ -843,7 +843,7 @@ class Gem::Specification
200 File.join full_gem_path, path
201 end
202
203- paths << ext_dir unless extensions.empty? || paths.include?(ext_dir)
204+ paths << File.join(ext_dir, require_paths.first) unless extensions.empty? || (ext_dir == full_gem_path)
205
206 # gem directories must come after -I and ENV['RUBYLIB']
207 insert_index = Gem.load_path_insert_index
208@@ -1279,7 +1279,7 @@ class Gem::Specification
209 # eg: /usr/local/lib/ruby/1.8/exts/mygem-1.0
210
211 def ext_dir
212- @ext_dir ||= File.join exts_dir, full_name, require_paths.first
213+ @ext_dir ||= File.join exts_dir, full_name
214 end
215
216 ##
217--
2181.7.7.3
219
220
221From 6229583633802b45e5a3e5689ab9077347cd9ef7 Mon Sep 17 00:00:00 2001
222From: =?UTF-8?q?V=C3=ADt=20Ondruch?= <vondruch@redhat.com>
223Date: Tue, 13 Dec 2011 12:14:54 +0100
224Subject: [PATCH 5/6] Remove binary extensions during uninstall.
225
226---
227 lib/rubygems/uninstaller.rb | 1 +
228 1 files changed, 1 insertions(+), 0 deletions(-)
229
230diff --git a/lib/rubygems/uninstaller.rb b/lib/rubygems/uninstaller.rb
231index cc32ea4..94d78e0 100644
232--- a/lib/rubygems/uninstaller.rb
233+++ b/lib/rubygems/uninstaller.rb
234@@ -213,6 +213,7 @@ class Gem::Uninstaller
235 File.writable?(spec.base_dir)
236
237 FileUtils.rm_rf spec.full_gem_path
238+ FileUtils.rm_rf spec.ext_dir
239
240 # TODO: should this be moved to spec?... I vote eww (also exists in docmgr)
241 old_platform_name = [spec.name,
242--
2431.7.7.3
244
245
246From bc40e1b9f60a9a04456e3504ffe6ee600b6da269 Mon Sep 17 00:00:00 2001
247From: =?UTF-8?q?V=C3=ADt=20Ondruch?= <vondruch@redhat.com>
248Date: Tue, 13 Dec 2011 14:27:14 +0100
249Subject: [PATCH 6/6] Avoid dependency on customized operating_system.rb.
250
251---
252 lib/rubygems/defaults.rb | 11 +++++++++++
253 lib/rubygems/specification.rb | 5 +----
254 2 files changed, 12 insertions(+), 4 deletions(-)
255
256diff --git a/lib/rubygems/defaults.rb b/lib/rubygems/defaults.rb
257index 20b4198..6d8711f 100644
258--- a/lib/rubygems/defaults.rb
259+++ b/lib/rubygems/defaults.rb
260@@ -87,6 +87,17 @@ module Gem
261 end
262
263 ##
264+ # Returns binary extensions dir for specified RubyGems base dir or nil
265+ # if such directory cannot be determined.
266+ #
267+ # By default, the binary extensions are located side by side with their
268+ # Ruby counterparts, therefore nil is returned
269+
270+ def self.default_ext_dir_for base_dir
271+ nil
272+ end
273+
274+ ##
275 # The default system-wide source info cache directory
276
277 def self.default_system_source_cache_dir
278diff --git a/lib/rubygems/specification.rb b/lib/rubygems/specification.rb
279index 8be2ade..f54210a 100644
280--- a/lib/rubygems/specification.rb
281+++ b/lib/rubygems/specification.rb
282@@ -1287,10 +1287,7 @@ class Gem::Specification
283 # gem directory. eg: /usr/local/lib/ruby/1.8/gems
284
285 def exts_dir
286- @exts_dir ||= begin
287- dirs = Gem.default_dirs.detect {|location, paths| paths[:gem_dir] == base_dir}
288- dirs ? File.join(dirs.last[:ext_dir], 'exts') : gems_dir
289- end
290+ @exts_dir ||= Gem.default_ext_dir_for(base_dir) || gems_dir
291 end
292
293 ##
294--
2951.7.7.3
296
diff --git a/meta-ruby/recipes-devtools/ruby/ruby_1.9.3-p547.bb b/meta-ruby/recipes-devtools/ruby/ruby_1.9.3-p547.bb
new file mode 100644
index 000000000..834cb7187
--- /dev/null
+++ b/meta-ruby/recipes-devtools/ruby/ruby_1.9.3-p547.bb
@@ -0,0 +1,50 @@
1require ruby.inc
2PR = "${INC_PR}.0"
3
4SRC_URI += "\
5 file://0001-socket-extconf-hardcode-wide-getaddr-info-test-outco.patch \
6 file://ruby-1.9.3-always-use-i386.patch \
7 file://ruby-1.9.3-disable-versioned-paths.patch \
8 file://ruby-1.9.3-rubygems-1.8.11-uninstaller.patch \
9 file://ruby-1.9.3-custom-rubygems-location.patch \
10 file://rubygems-1.8.11-binary-extensions.patch \
11 file://ruby-1.9.3-mkmf-verbose.patch \
12 file://ruby-1.9.3-install-cross.patch \
13 file://remove-the-dependency-on-dir.patch \
14 file://ruby-mkmf.rb-fix-race-conditions-at-install-ext.patch \
15"
16SRC_URI[md5sum] = "7531f9b1b35b16f3eb3d7bea786babfd"
17SRC_URI[sha256sum] = "9ba118e4aba04c430bc4d5efb09b31a0277e101c9fd2ef3b80b9c684d7ae57a1"
18
19# it's unknown to configure script, but then passed to extconf.rb
20# maybe it's not really needed as we're hardcoding the result with
21# 0001-socket-extconf-hardcode-wide-getaddr-info-test-outco.patch
22UNKNOWN_CONFIGURE_WHITELIST += "--enable-wide-getaddrinfo"
23
24PACKAGECONFIG ??= ""
25PACKAGECONFIG[valgrind] = "--with-valgrind=yes, --with-valgrind=no, valgrind"
26
27EXTRA_OECONF = "\
28 --enable-wide-getaddrinfo \
29 --disable-versioned-paths \
30 --disable-rpath \
31 --enable-shared \
32 --enable-load-relative \
33"
34
35EXTRA_OEMAKE = " \
36 LIBRUBYARG='-lruby-static' \
37"
38
39do_install() {
40 oe_runmake 'DESTDIR=${D}' install
41}
42
43FILES_${PN} += "${datadir}/rubygems \
44 ${datadir}/ri"
45
46FILES_${PN}-dbg += "${libdir}/ruby/*/.debug \
47 ${libdir}/ruby/*/*/.debug \
48 ${libdir}/ruby/*/*/*/.debug"
49
50BBCLASSEXTEND = "native"