Browse Source

Ruby 2.5.0 (#2143)

* ruby: patching two cross compile bugs in ruby 2.5.0

* ruby 2.5.1
android-5
Carl Hörberg 7 years ago
committed by Fredrik Fornwall
parent
commit
e171d66b8a
  1. 6
      packages/ruby/build.sh
  2. 21
      packages/ruby/configure.ac.patch
  3. 25
      packages/ruby/configure.in.patch
  4. 21
      packages/ruby/configure.patch
  5. 6
      packages/ruby/fix-paths.patch
  6. 13
      packages/ruby/lib-fileutils.rb.patch
  7. 17
      packages/ruby/process.c.patch
  8. 11
      packages/ruby/template-configure-ext.mk.tmpl.patch
  9. 23
      packages/ruby/tool-rbinstall.rb.patch

6
packages/ruby/build.sh

@ -1,8 +1,8 @@
TERMUX_PKG_HOMEPAGE=https://www.ruby-lang.org/
TERMUX_PKG_DESCRIPTION="Dynamic programming language with a focus on simplicity and productivity"
_MAJOR_VERSION=2.4
TERMUX_PKG_VERSION=${_MAJOR_VERSION}.3
TERMUX_PKG_SHA256=23677d40bf3b7621ba64593c978df40b1e026d8653c74a0599f0ead78ed92b51
_MAJOR_VERSION=2.5
TERMUX_PKG_VERSION=${_MAJOR_VERSION}.1
TERMUX_PKG_SHA256=886ac5eed41e3b5fc699be837b0087a6a5a3d10f464087560d2d21b3e71b754d
TERMUX_PKG_SRCURL=https://cache.ruby-lang.org/pub/ruby/${_MAJOR_VERSION}/ruby-${TERMUX_PKG_VERSION}.tar.xz
# libbffi is used by the fiddle extension module:
TERMUX_PKG_DEPENDS="libandroid-support, libffi, libgmp, readline, openssl, libutil, libyaml"

21
packages/ruby/configure.ac.patch

@ -0,0 +1,21 @@
--- /home/vagrant/ruby-2.5.0/configure.ac 2017-12-15 09:43:40.000000000 +0000
+++ src/configure.ac 2018-02-14 19:07:11.272257521 +0000
@@ -742,7 +742,7 @@
rb_cv_warnflags="$warnflags"
AS_IF([test "$GCC:${warnflags+set}:no" = yes::no], [
AS_IF([test $gcc_major -ge 4], [
- extra_warning=-Werror=extra-tokens
+ extra_warning=
], [
extra_warning=
])
@@ -765,9 +765,7 @@
-Werror=pointer-arith \
-Werror=write-strings \
-Werror=declaration-after-statement \
- -Werror=shorten-64-to-32 \
-Werror=implicit-function-declaration \
- -Werror=division-by-zero \
-Werror=deprecated-declarations \
-Werror=misleading-indentation \
-Wno-packed-bitfield-compat \

25
packages/ruby/configure.in.patch

@ -1,25 +0,0 @@
Fix issues when compiling with clang (where cpp is provided by gcc
in the standalone toolchain).
diff -u -r ../ruby-2.3.1/configure.in ./configure.in
--- ../ruby-2.3.1/configure.in 2016-04-24 13:44:40.000000000 -0400
+++ ./configure.in 2016-05-18 01:10:09.523385169 -0400
@@ -799,7 +799,7 @@
rb_cv_warnflags="$warnflags"
if test "$GCC:${warnflags+set}:no" = yes::no; then
if test $gcc_major -ge 4; then
- extra_warning=-Werror=extra-tokens
+ extra_warning=
else
extra_warning=
fi
@@ -813,9 +813,7 @@
-Werror=pointer-arith \
-Werror=write-strings \
-Werror=declaration-after-statement \
- -Werror=shorten-64-to-32 \
-Werror=implicit-function-declaration \
- -Werror=division-by-zero \
-Werror=deprecated-declarations \
-Wno-packed-bitfield-compat \
$extra_warning \

21
packages/ruby/configure.patch

@ -0,0 +1,21 @@
--- /home/vagrant/ruby-2.5.0/configure 2017-12-25 07:00:28.000000000 +0000
+++ src/configure 2018-02-14 19:06:28.742701948 +0000
@@ -7434,7 +7434,7 @@
if test $gcc_major -ge 4; then :
- extra_warning=-Werror=extra-tokens
+ extra_warning=
else
@@ -7464,9 +7464,7 @@
-Werror=pointer-arith \
-Werror=write-strings \
-Werror=declaration-after-statement \
- -Werror=shorten-64-to-32 \
-Werror=implicit-function-declaration \
- -Werror=division-by-zero \
-Werror=deprecated-declarations \
-Werror=misleading-indentation \
-Wno-packed-bitfield-compat \

6
packages/ruby/fix-paths.patch

@ -1,14 +1,14 @@
diff -uNr ruby-2.4.2/addr2line.c ruby-2.4.2.mod/addr2line.c
--- ruby-2.4.2/addr2line.c 2016-10-18 18:09:08.000000000 +0300
+++ ruby-2.4.2.mod/addr2line.c 2017-09-15 12:00:56.242805138 +0300
@@ -440,7 +440,7 @@
@@ -451,7 +451,7 @@
/* Ideally we should check 4 paths to follow gnu_debuglink,
but we handle only one case for now as this format is used
by some linux distributions. See GDB's info for detail. */
- static const char global_debug_dir[] = "/usr/lib/debug";
+ static const char global_debug_dir[] = "@TERMUX_PREFIX@/lib/debug";
char *p, *subdir;
obj_info_t *o1 = *objp, *o2;
const size_t global_debug_dir_len = sizeof(global_debug_dir) - 1;
char *p;
diff -uNr ruby-2.4.2/dln_find.c ruby-2.4.2.mod/dln_find.c
--- ruby-2.4.2/dln_find.c 2016-06-02 19:52:15.000000000 +0300

13
packages/ruby/lib-fileutils.rb.patch

@ -0,0 +1,13 @@
--- /home/vagrant/ruby-2.5.0/lib/fileutils.rb 2017-12-22 08:00:10.000000000 +0000
+++ ./lib/fileutils.rb 2018-02-17 23:19:55.344655246 +0000
@@ -744,8 +744,8 @@
#
def compare_stream(a, b)
bsize = fu_stream_blksize(a, b)
- sa = String.new(capacity: bsize)
- sb = String.new(capacity: bsize)
+ sa = String.new
+ sb = String.new
begin
a.read(bsize, sa)
b.read(bsize, sb)

17
packages/ruby/process.c.patch

@ -1,7 +1,6 @@
diff -u -r ../ruby-2.3.0/process.c ./process.c
--- ../ruby-2.3.0/process.c 2015-12-23 03:57:48.000000000 -0500
+++ ./process.c 2015-12-25 15:40:56.370279634 -0500
@@ -1227,9 +1227,9 @@
--- /home/vagrant/ruby-2.5.0/process.c 2017-12-14 10:24:38.000000000 +0000
+++ src/process.c 2018-02-14 18:48:50.591627727 +0000
@@ -1240,9 +1240,9 @@
*argv = (char *)prog;
*--argv = (char *)"sh";
if (envp)
@ -13,7 +12,7 @@ diff -u -r ../ruby-2.3.0/process.c ./process.c
}
#else
@@ -1301,9 +1301,9 @@
@@ -1310,9 +1310,9 @@
}
#else
if (envp_str)
@ -22,10 +21,10 @@ diff -u -r ../ruby-2.3.0/process.c ./process.c
else
- execl("/bin/sh", "sh", "-c", str, (char *)NULL); /* async-signal-safe (since SUSv4) */
+ execl("@TERMUX_PREFIX@/bin/sh", "sh", "-c", str, (char *)NULL); /* async-signal-safe (since SUSv4) */
#endif
return -1;
#endif /* _WIN32 */
@@ -1406,7 +1406,7 @@
return errno;
}
@@ -1415,7 +1415,7 @@
if (status == -1 && errno == ENOEXEC) {
*argv = (char *)prog;
*--argv = (char *)"sh";
@ -34,7 +33,7 @@ diff -u -r ../ruby-2.3.0/process.c ./process.c
after_exec();
if (status == -1) errno = ENOEXEC;
}
@@ -1444,7 +1444,7 @@
@@ -1453,7 +1453,7 @@
char *shell = dln_find_exe_r("sh", 0, fbuf, sizeof(fbuf));
before_exec();

11
packages/ruby/template-configure-ext.mk.tmpl.patch

@ -0,0 +1,11 @@
--- /home/vagrant/ruby-2.5.0/template/configure-ext.mk.tmpl 2017-04-23 16:19:22.000000000 +0000
+++ ./template/configure-ext.mk.tmpl 2018-02-17 23:31:02.304445580 +0000
@@ -24,7 +24,7 @@
MINIRUBY = <%=miniruby%>
SCRIPT_ARGS = <%=script_args%>
EXTMK_ARGS = $(SCRIPT_ARGS) --gnumake=$(gnumake) --extflags="$(EXTLDFLAGS)" \
- --make-flags='MINIRUBY=$(MINIRUBY)'
+ --make-flags="MINIRUBY='$(MINIRUBY)'"
all: exts gems
exts:

23
packages/ruby/tool-rbinstall.rb.patch

@ -1,21 +1,20 @@
diff -u -r ../ruby-2.3.0/tool/rbinstall.rb ./tool/rbinstall.rb
--- ../ruby-2.3.0/tool/rbinstall.rb 2015-11-16 01:33:17.000000000 -0500
+++ ./tool/rbinstall.rb 2015-12-25 15:43:04.756646343 -0500
@@ -696,7 +696,7 @@
# :startdoc:
--- /home/vagrant/ruby-2.5.0/tool/rbinstall.rb 2017-10-30 05:45:20.000000000 +0000
+++ src/tool/rbinstall.rb 2018-02-14 18:53:42.498522407 +0000
@@ -731,7 +731,7 @@
end
install?(:ext, :comm, :gem) do
def install_default_gem(dir, srcdir)
- gem_dir = Gem.default_dir
+ gem_dir = "@TERMUX_PREFIX@/lib/ruby/gems/2.4.0"
+ gem_dir = "@TERMUX_PREFIX@/lib/ruby/gems/2.5.0"
directories = Gem.ensure_gem_subdirectories(gem_dir, :mode => $dir_mode)
prepare "default gems", gem_dir, directories
prepare "default gems from #{dir}", gem_dir, directories
@@ -732,7 +732,7 @@
@@ -765,7 +765,7 @@
end
install?(:ext, :comm, :gem) do
install?(:ext, :comm, :gem, :'bundled-gems') do
- gem_dir = Gem.default_dir
+ gem_dir = "@TERMUX_PREFIX@/lib/ruby/gems/2.4.0"
+ gem_dir = "@TERMUX_PREFIX@/lib/ruby/gems/2.5.0"
directories = Gem.ensure_gem_subdirectories(gem_dir, :mode => $dir_mode)
prepare "bundle gems", gem_dir, directories
prepare "bundled gems", gem_dir, directories
install_dir = with_destdir(gem_dir)

Loading…
Cancel
Save