extra/ruby to 2.6.0-5.1

This commit is contained in:
Kevin Mihelich 2019-01-15 04:37:20 +00:00
parent 7f72f5e460
commit 378319fd5f
4 changed files with 130 additions and 5 deletions

View file

@ -0,0 +1,77 @@
From 6a05adeb927f02400f071962846bb3a83619bcbf Mon Sep 17 00:00:00 2001
From: Kevin Mihelich <kevin@archlinuxarm.org>
Date: Mon, 14 Jan 2019 21:33:21 -0700
Subject: [PATCH 1/3] Revert "Signature of rb_uint2big and rb_int2big"
This reverts commit d77e8a7da596fc23acd76c785548f6314114f97a.
---
bignum.c | 10 +++++-----
include/ruby/ruby.h | 4 ++--
2 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/bignum.c b/bignum.c
index ee3b49fd04..2f9e8cd323 100644
--- a/bignum.c
+++ b/bignum.c
@@ -3154,7 +3154,7 @@ rb_big_norm(VALUE x)
}
VALUE
-rb_uint2big(uintptr_t n)
+rb_uint2big(VALUE n)
{
long i;
VALUE big = bignew(bdigit_roomof(SIZEOF_VALUE), 1);
@@ -3176,7 +3176,7 @@ rb_uint2big(uintptr_t n)
}
VALUE
-rb_int2big(intptr_t n)
+rb_int2big(SIGNED_VALUE n)
{
long neg = 0;
VALUE u;
@@ -3197,14 +3197,14 @@ rb_int2big(intptr_t n)
}
VALUE
-rb_uint2inum(uintptr_t n)
+rb_uint2inum(VALUE n)
{
if (POSFIXABLE(n)) return LONG2FIX(n);
return rb_uint2big(n);
}
VALUE
-rb_int2inum(intptr_t n)
+rb_int2inum(SIGNED_VALUE n)
{
if (FIXABLE(n)) return LONG2FIX(n);
return rb_int2big(n);
@@ -5963,7 +5963,7 @@ bigdivrem(VALUE x, VALUE y, volatile VALUE *divp, volatile VALUE *modp)
zds = BDIGITS(z);
dd = bigdivrem_single(zds, xds, xn, dd);
if (modp) {
- *modp = rb_uint2big((uintptr_t)dd);
+ *modp = rb_uint2big((VALUE)dd);
BIGNUM_SET_SIGN(*modp, BIGNUM_SIGN(x));
}
if (divp) *divp = z;
diff --git a/include/ruby/ruby.h b/include/ruby/ruby.h
index d983114e0a..697ea7f45d 100644
--- a/include/ruby/ruby.h
+++ b/include/ruby/ruby.h
@@ -772,8 +772,8 @@ rb_num2ll_inline(VALUE x)
double rb_num2dbl(VALUE);
#define NUM2DBL(x) rb_num2dbl((VALUE)(x))
-VALUE rb_uint2big(uintptr_t);
-VALUE rb_int2big(intptr_t);
+VALUE rb_uint2big(VALUE);
+VALUE rb_int2big(SIGNED_VALUE);
VALUE rb_newobj(void);
VALUE rb_newobj_of(VALUE, VALUE);
--
2.20.1

View file

@ -0,0 +1,30 @@
From 51c93162de459b14ebf07445c87aaf8ba3795b07 Mon Sep 17 00:00:00 2001
From: Kevin Mihelich <kevin@archlinuxarm.org>
Date: Mon, 14 Jan 2019 21:33:29 -0700
Subject: [PATCH 2/3] Revert "Signature of rb_uint2inum and rb_int2inum"
This reverts commit b2033b8b8418b0c1ceed54bdc170c03dd45d1cf8.
---
include/ruby/ruby.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/ruby/ruby.h b/include/ruby/ruby.h
index 697ea7f45d..c7c873e1c8 100644
--- a/include/ruby/ruby.h
+++ b/include/ruby/ruby.h
@@ -263,10 +263,10 @@ typedef char ruby_check_sizeof_voidp[SIZEOF_VOIDP == sizeof(void*) ? 1 : -1];
#define RB_LONG2FIX(i) RB_INT2FIX(i)
#define LONG2FIX(i) RB_INT2FIX(i)
#define rb_fix_new(v) RB_INT2FIX(v)
-VALUE rb_int2inum(intptr_t);
+VALUE rb_int2inum(SIGNED_VALUE);
#define rb_int_new(v) rb_int2inum(v)
-VALUE rb_uint2inum(uintptr_t);
+VALUE rb_uint2inum(VALUE);
#define rb_uint_new(v) rb_uint2inum(v)
--
2.20.1

View file

@ -1,3 +1,12 @@
From 8da8ccfc11050c25aa262db3e84a36bc74899de9 Mon Sep 17 00:00:00 2001
From: Kevin Mihelich <kevin@archlinuxarm.org>
Date: Mon, 14 Jan 2019 21:34:02 -0700
Subject: [PATCH 3/3] Use only unsigned long for rb_serial_t
---
internal.h | 10 ----------
1 file changed, 10 deletions(-)
diff --git a/internal.h b/internal.h
index 433ab6635d..a4f7e9bde3 100644
--- a/internal.h
@ -22,3 +31,6 @@ index 433ab6635d..a4f7e9bde3 100644
struct rb_classext_struct {
struct st_table *iv_index_tbl;
--
2.20.1

View file

@ -4,27 +4,33 @@
# Contributor: Jeramy Rutley <jrutley@gmail.com>
# ALARM: Kevin Mihelich <kevin@archlinuxarm.org>
# - patch to fix running ruby on v5 (#705)
# - patches to fix running ruby on 32-bit ARM
pkgname=(ruby ruby-docs)
pkgver=2.6.0
pkgrel=5
pkgrel=5.1
arch=(x86_64)
url='http://www.ruby-lang.org/en/'
license=(BSD custom)
makedepends=(gdbm openssl libffi doxygen graphviz libyaml ttf-dejavu tk)
options=(!emptydirs)
source=(https://cache.ruby-lang.org/pub/ruby/${pkgver:0:3}/ruby-${pkgver}.tar.xz
0002-Use-only-unsigned-long-for-rb_serial_t.patch)
0001-Revert-Signature-of-rb_uint2big-and-rb_int2big.patch
0002-Revert-Signature-of-rb_uint2inum-and-rb_int2inum.patch
0003-Use-only-unsigned-long-for-rb_serial_t.patch)
sha512sums=('c56eaf85ef7b79deb34ee4590b143c07f4fc83eb79775290761aee5a7c63374659613538a41f25706ed6e19e49d5c67a1014c24d17f29948294c7abd0b0fcea8'
'2b388e2f92149f331190e5ffb54ab2d1c585cb958406034b2350d41a895947864d3ca0fc7936cf54d9730faad0dbf0cac89ab7f0fe8e3fdda58704c7a7660cbe')
'939bd57abc38aad6f5efa747f5e59737697ab89dfe1b58060ca83c88a217b0c6a15607eef7c8279ab85c7aabe8eb83e6cf6fb67988aa771117c6b80322c5b52e'
'4a1ad988ece8fd0b5f129523087c4fc7264bc8e56869fe8549bc006c8ae05552d743a67c3693e88eaf33d3e515b10817e9c8a5e386e1a369763a94fc84563739'
'8a98c909667bbeb47146d17397d7a27e82a90bb439c83b3c3c40687600a04040fefd567dcc0929d82dd1f6ef66fcfc84dcfe9b7a24eca3fb3b027328400358e4')
prepare() {
cd ruby-${pkgver}
# remove bundled gems, we are going to ship them as separate packages
rm -rf gems/
patch -Np1 -i ../0001-Revert-Signature-of-rb_uint2big-and-rb_int2big.patch
patch -Np1 -i ../0002-Revert-Signature-of-rb_uint2inum-and-rb_int2inum.patch
# fixes https://bugs.ruby-lang.org/issues/9507
[[ $CARCH == 'arm' ]] && patch -Np1 -i ../0002-Use-only-unsigned-long-for-rb_serial_t.patch || true
[[ $CARCH == 'arm' ]] && patch -Np1 -i ../0003-Use-only-unsigned-long-for-rb_serial_t.patch || true
}
build() {