Signed-off-by: KANATSU Minoru <icc.pot.tyew...@gmail.com>
---
 ruby/Makefile                              | 23 ++++++++-------
 ruby/disable-fstat.patch                   | 16 -----------
 ruby/no-ipv6.patch                         | 45 ------------------------------
 ruby/no-use-sleepy-thread-timer-ruby.patch | 12 --------
 4 files changed, 11 insertions(+), 85 deletions(-)
 delete mode 100644 ruby/disable-fstat.patch
 delete mode 100644 ruby/no-ipv6.patch
 delete mode 100644 ruby/no-use-sleepy-thread-timer-ruby.patch

diff --git a/ruby/Makefile b/ruby/Makefile
index 5439367..5c937ef 100644
--- a/ruby/Makefile
+++ b/ruby/Makefile
@@ -3,7 +3,9 @@ module: usr.manifest
 
 CFLAGS=-fPIC -Wall -shared
 
-RUBY_VER=2.2.4
+RUBY_VER_MAJOR=2.5
+RUBY_VER_MINOR=1
+RUBY_VER=${RUBY_VER_MAJOR}.${RUBY_VER_MINOR}
 
 RUBY_LDFLAGS=-lm -lcrypt -ldl -lpthread -lruby
 LIBS=-Lupstream/ruby
@@ -20,9 +22,6 @@ version_check:
 upstream/ruby: version_check
        mkdir -p upstream
        cd upstream && git clone --depth 1 -b v$(subst .,_,${RUBY_VER}) 
https://github.com/ruby/ruby.git
-       cd upstream/ruby && patch -p1 < 
../../no-use-sleepy-thread-timer-ruby.patch
-       cd upstream/ruby && patch -p1 < ../../no-ipv6.patch
-       cd upstream/ruby && patch -p1 < ../../disable-fstat.patch
        cd upstream/ruby && autoconf
        cd upstream/ruby && ./configure --libdir=/usr/lib --enable-pic 
--enable-shared --disable-install-doc --disable-install-rdoc --disable-ipv6
 
@@ -56,7 +55,7 @@ usr.manifest: ruby.so upstream/bundler upstream/cert.pem
        cp -a ./upstream/bundler/lib/* ./upstream/ruby/lib/
        echo '/ruby.so: $${MODULE_DIR}/ruby.so' > usr.manifest
        echo '/**: $${MODULE_DIR}/upstream/ruby/bin/**' >> usr.manifest
-       echo '/libruby.so.2.2: $${MODULE_DIR}/upstream/ruby/libruby.so' >> 
usr.manifest
+       echo '/libruby.so.${RUBY_VER_MAJOR}: 
$${MODULE_DIR}/upstream/ruby/libruby.so' >> usr.manifest
        echo '/usr/share/ruby/**: $${MODULE_DIR}/upstream/ruby/lib/**' >> 
usr.manifest
        echo '/usr/lib64/ruby/rbconfig.rb: 
$${MODULE_DIR}/upstream/ruby/rbconfig.rb' >> usr.manifest
        echo '/usr/lib64/ruby/**: 
$${MODULE_DIR}/upstream/ruby/.ext/x86_64-linux/**' >> usr.manifest
@@ -68,15 +67,15 @@ usr.manifest: ruby.so upstream/bundler upstream/cert.pem
        : > bootfs.manifest
 
 ROOTFS: module
-       mkdir -p ./ROOTFS/usr/lib/ruby/2.2.0/x86_64-linux
-       cp -a ./upstream/ruby/.ext/common/* ./ROOTFS/usr/lib/ruby/2.2.0
-       cp -a ./upstream/bundler/lib/* ./ROOTFS/usr/lib/ruby/2.2.0
+       mkdir -p ./ROOTFS/usr/lib/ruby/${RUBY_VER_MAJOR}.0/x86_64-linux
+       cp -a ./upstream/ruby/.ext/common/* 
./ROOTFS/usr/lib/ruby/${RUBY_VER_MAJOR}.0
+       cp -a ./upstream/bundler/lib/* ./ROOTFS/usr/lib/ruby/${RUBY_VER_MAJOR}.0
        cp ruby.so ./ROOTFS/
        cp -a ./upstream/ruby/bin/* ./ROOTFS/
-       cp ./upstream/ruby/libruby.so ./ROOTFS/libruby.so.2.2
-       cp -a ./upstream/ruby/lib/* ./ROOTFS/usr/lib/ruby/2.2.0
-       cp ./upstream/ruby/rbconfig.rb 
./ROOTFS/usr/lib/ruby/2.2.0/x86_64-linux/rbconfig.rb
-       cp -a ./upstream/ruby/.ext/x86_64-linux/* 
./ROOTFS/usr/lib/ruby/2.2.0/x86_64-linux/
+       cp ./upstream/ruby/libruby.so ./ROOTFS/libruby.so.${RUBY_VER_MAJOR}
+       cp -a ./upstream/ruby/lib/* ./ROOTFS/usr/lib/ruby/${RUBY_VER_MAJOR}.0
+       cp ./upstream/ruby/rbconfig.rb 
./ROOTFS/usr/lib/ruby/${RUBY_VER_MAJOR}.0/x86_64-linux/rbconfig.rb
+       cp -a ./upstream/ruby/.ext/x86_64-linux/* 
./ROOTFS/usr/lib/ruby/${RUBY_VER_MAJOR}.0/x86_64-linux/
        mkdir -p ./ROOTFS/usr/local/ssl
        cp ./upstream/cert.pem ./ROOTFS/usr/local/ssl/cert.pem
        find upstream/ruby/.ext/x86_64-linux/ -name '*.so' -exec ldd {} \;|awk 
'{print "cp",$$3,"./ROOTFS/"}'|grep "/lib"|grep -v "ld-linux"|grep -v 
"libc.so"|grep -v "libpthread.so"|grep -v "libdl.so"|grep -v "libm.so"|grep -v 
"libruby.so"|sort|uniq > tmp.sh
diff --git a/ruby/disable-fstat.patch b/ruby/disable-fstat.patch
deleted file mode 100644
index cebd7d3..0000000
--- a/ruby/disable-fstat.patch
+++ /dev/null
@@ -1,16 +0,0 @@
-diff --git a/io.c b/io.c
-index 9522990..3610b39 100644
---- a/io.c
-+++ b/io.c
-@@ -185,9 +185,11 @@ rb_update_max_fd(int fd)
-     struct stat buf;
-     rb_atomic_t afd = (rb_atomic_t)fd;
-
-+#if 0
-     if (fstat(fd, &buf) != 0 && errno == EBADF) {
-         rb_bug("rb_update_max_fd: invalid fd (%d) given.", fd);
-     }
-+#endif
-
-     while (max_file_descriptor < afd) {
-       ATOMIC_CAS(max_file_descriptor, max_file_descriptor, afd);
diff --git a/ruby/no-ipv6.patch b/ruby/no-ipv6.patch
deleted file mode 100644
index 1f6835a..0000000
--- a/ruby/no-ipv6.patch
+++ /dev/null
@@ -1,45 +0,0 @@
-diff --git a/ext/socket/getaddrinfo.c b/ext/socket/getaddrinfo.c
-index a17d12b..0279577 100644
---- a/ext/socket/getaddrinfo.c
-+++ b/ext/socket/getaddrinfo.c
-@@ -49,8 +49,10 @@
- # include <net/socket.h>
- #else
- # include <sys/socket.h>
-+#undef AF_INET6
- #endif
- #include <netinet/in.h>
-+#undef IPPROTO_IPV6
- #if defined(HAVE_ARPA_INET_H)
- #include <arpa/inet.h>
- #endif
-diff --git a/ext/socket/getnameinfo.c b/ext/socket/getnameinfo.c
-index 4da9680..a574f5a 100644
---- a/ext/socket/getnameinfo.c
-+++ b/ext/socket/getnameinfo.c
-@@ -45,8 +45,10 @@
- # include <net/socket.h>
- #else
- # include <sys/socket.h>
-+#undef AF_INET6
- #endif
- #include <netinet/in.h>
-+#undef IPPROTO_IPV6
- #if defined(HAVE_ARPA_INET_H)
- #include <arpa/inet.h>
- #endif
-diff --git a/ext/socket/rubysocket.h b/ext/socket/rubysocket.h
-index a4893d9..7325f64 100644
---- a/ext/socket/rubysocket.h
-+++ b/ext/socket/rubysocket.h
-@@ -31,8 +31,10 @@
- #    include <net/socket.h>
- #  else
- #    include <sys/socket.h>
-+#undef AF_INET6
- #  endif
- #  include <netinet/in.h>
-+#undef IPPROTO_IPV6
- #  ifdef HAVE_NETINET_IN_SYSTM_H
- #    include <netinet/in_systm.h>
- #  endif
diff --git a/ruby/no-use-sleepy-thread-timer-ruby.patch 
b/ruby/no-use-sleepy-thread-timer-ruby.patch
deleted file mode 100644
index 8b9952b..0000000
--- a/ruby/no-use-sleepy-thread-timer-ruby.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff -Nur ruby.orig/thread_pthread.c ruby/thread_pthread.c
---- ruby.orig/thread_pthread.c 2014-06-20 07:44:27.131259578 +0900
-+++ ruby/thread_pthread.c      2014-06-20 07:44:43.612250114 +0900
-@@ -59,7 +59,7 @@
- 
- #if defined(HAVE_POLL) && defined(HAVE_FCNTL) && defined(F_GETFL) && 
defined(F_SETFL) && defined(O_NONBLOCK) && !defined(__native_client__)
- /* The timer thread sleeps while only one Ruby thread is running. */
--# define USE_SLEEPY_TIMER_THREAD 1
-+# define USE_SLEEPY_TIMER_THREAD 0
- #else
- # define USE_SLEEPY_TIMER_THREAD 0
- #endif
-- 
2.14.5

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/osv-dev/20190528135951.1459-1-icc.pot.tyew272%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to