aboutsummaryrefslogtreecommitdiffhomepage
path: root/third_party/rake-compiler-dock/build
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/rake-compiler-dock/build')
-rw-r--r--third_party/rake-compiler-dock/build/patches/rake-compiler-0.9.5/without-exts.diff14
-rw-r--r--third_party/rake-compiler-dock/build/patches/ruby-1.8.7-p374/nop.patch2
-rw-r--r--third_party/rake-compiler-dock/build/patches/ruby-1.9.3/no_sendfile.patch13
-rw-r--r--third_party/rake-compiler-dock/build/patches/ruby-1.9.3/nop.patch2
-rw-r--r--third_party/rake-compiler-dock/build/patches/ruby-2.3.0/no_sendfile.patch12
-rwxr-xr-xthird_party/rake-compiler-dock/build/runas12
-rw-r--r--third_party/rake-compiler-dock/build/sigfw.c43
-rwxr-xr-xthird_party/rake-compiler-dock/build/strip_wrapper30
-rw-r--r--third_party/rake-compiler-dock/build/sudoers1
9 files changed, 129 insertions, 0 deletions
diff --git a/third_party/rake-compiler-dock/build/patches/rake-compiler-0.9.5/without-exts.diff b/third_party/rake-compiler-dock/build/patches/rake-compiler-0.9.5/without-exts.diff
new file mode 100644
index 0000000000..07739d33ec
--- /dev/null
+++ b/third_party/rake-compiler-dock/build/patches/rake-compiler-0.9.5/without-exts.diff
@@ -0,0 +1,14 @@
+diff --git a/tasks/bin/cross-ruby.rake b/tasks/bin/cross-ruby.rake
+index 6acc816..6aa2a49 100644
+--- a/tasks/bin/cross-ruby.rake
++++ b/tasks/bin/cross-ruby.rake
+@@ -135,8 +135,7 @@ file "#{USER_HOME}/builds/#{MINGW_HOST}/#{RUBY_CC_VERSION}/Makefile" => ["#{USER
+ "--build=#{RUBY_BUILD}",
+ '--enable-shared',
+ '--disable-install-doc',
+- '--without-tk',
+- '--without-tcl'
++ '--with-ext='
+ ]
+
+ # Force Winsock2 for Ruby 1.8, 1.9 defaults to it
diff --git a/third_party/rake-compiler-dock/build/patches/ruby-1.8.7-p374/nop.patch b/third_party/rake-compiler-dock/build/patches/ruby-1.8.7-p374/nop.patch
new file mode 100644
index 0000000000..fac8525da6
--- /dev/null
+++ b/third_party/rake-compiler-dock/build/patches/ruby-1.8.7-p374/nop.patch
@@ -0,0 +1,2 @@
+diff --git a/configure b/configure
+index 55157af..6630eba 100755
diff --git a/third_party/rake-compiler-dock/build/patches/ruby-1.9.3/no_sendfile.patch b/third_party/rake-compiler-dock/build/patches/ruby-1.9.3/no_sendfile.patch
new file mode 100644
index 0000000000..d8f339e814
--- /dev/null
+++ b/third_party/rake-compiler-dock/build/patches/ruby-1.9.3/no_sendfile.patch
@@ -0,0 +1,13 @@
+diff --git a/configure b/configure
+index 898730c..cfe6253 100755
+--- a/configure
++++ b/configure
+@@ -14695,7 +14695,7 @@ for ac_func in fmod killpg wait4 waitpid fork spawnv syscall __syscall chroot ge
+ setsid telldir seekdir fchmod cosh sinh tanh log2 round\
+ setuid setgid daemon select_large_fdset setenv unsetenv\
+ mktime timegm gmtime_r clock_gettime gettimeofday poll ppoll\
+- pread sendfile shutdown sigaltstack dl_iterate_phdr
++ pread shutdown sigaltstack dl_iterate_phdr
+ do :
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
diff --git a/third_party/rake-compiler-dock/build/patches/ruby-1.9.3/nop.patch b/third_party/rake-compiler-dock/build/patches/ruby-1.9.3/nop.patch
new file mode 100644
index 0000000000..fac8525da6
--- /dev/null
+++ b/third_party/rake-compiler-dock/build/patches/ruby-1.9.3/nop.patch
@@ -0,0 +1,2 @@
+diff --git a/configure b/configure
+index 55157af..6630eba 100755
diff --git a/third_party/rake-compiler-dock/build/patches/ruby-2.3.0/no_sendfile.patch b/third_party/rake-compiler-dock/build/patches/ruby-2.3.0/no_sendfile.patch
new file mode 100644
index 0000000000..915fc7b790
--- /dev/null
+++ b/third_party/rake-compiler-dock/build/patches/ruby-2.3.0/no_sendfile.patch
@@ -0,0 +1,12 @@
+diff --git a/configure b/configure
+index ebe3d8c..a336b73 100755
+--- a/configure
++++ b/configure
+@@ -18943,7 +18943,6 @@ do :
+ ac_fn_c_check_func "$LINENO" "sendfile" "ac_cv_func_sendfile"
+ if test "x$ac_cv_func_sendfile" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+-#define HAVE_SENDFILE 1
+ _ACEOF
+
+ fi
diff --git a/third_party/rake-compiler-dock/build/runas b/third_party/rake-compiler-dock/build/runas
new file mode 100755
index 0000000000..b29ce31fcc
--- /dev/null
+++ b/third_party/rake-compiler-dock/build/runas
@@ -0,0 +1,12 @@
+#!/bin/bash
+
+groupadd -g "$GID" "$GROUP"
+mkdir -p /tmp/home
+useradd -g "$GID" -u "$UID" -G rvm,sudo -p "" -b /tmp/home -m "$USER"
+
+HOME=$(bash <<< "echo ~$USER")
+ln -s /usr/local/rake-compiler "$HOME"/.rake-compiler
+
+sudo -u "$USER" --set-home \
+ BASH_ENV=/etc/rubybashrc \
+ -- "$@"
diff --git a/third_party/rake-compiler-dock/build/sigfw.c b/third_party/rake-compiler-dock/build/sigfw.c
new file mode 100644
index 0000000000..291d76cec8
--- /dev/null
+++ b/third_party/rake-compiler-dock/build/sigfw.c
@@ -0,0 +1,43 @@
+/*
+ * This program handles SIGINT and forwards it to another process.
+ * It is intended to be run as PID 1.
+ *
+ * Docker starts processes with "docker run" as PID 1.
+ * On Linux, the default signal handler for PID 1 ignores any signals.
+ * Therefore Ctrl-C aka SIGINT is ignored per default.
+ */
+
+#include <signal.h>
+#include <sys/types.h>
+#include <sys/wait.h>
+
+int pid = 0;
+
+void
+handle_sigint (int signum)
+{
+ if(pid)
+ kill(pid, SIGINT);
+}
+
+int main(int argc, char *argv[]){
+ struct sigaction new_action;
+ int status = -1;
+
+ /* Set up the structure to specify the new action. */
+ new_action.sa_handler = handle_sigint;
+ sigemptyset (&new_action.sa_mask);
+ new_action.sa_flags = 0;
+
+ sigaction (SIGINT, &new_action, (void*)0);
+
+ pid = fork();
+ if(pid){
+ wait(&status);
+ return WEXITSTATUS(status);
+ }else{
+ status = execvp(argv[1], &argv[1]);
+ perror("exec");
+ return status;
+ }
+}
diff --git a/third_party/rake-compiler-dock/build/strip_wrapper b/third_party/rake-compiler-dock/build/strip_wrapper
new file mode 100755
index 0000000000..7f8a1346a1
--- /dev/null
+++ b/third_party/rake-compiler-dock/build/strip_wrapper
@@ -0,0 +1,30 @@
+#!/usr/bin/env ruby
+
+# Strip file on local folder instead of a Virtualbox shared folder
+# to work around this bug: https://www.virtualbox.org/ticket/8463
+
+require 'tempfile'
+require 'fileutils'
+
+strip = "#{File.basename($0)}.bin"
+
+files = ARGV.reject{|f| f=~/^-/ }.map do |arg|
+ tmp = Tempfile.new 'strip'
+ tmp.close
+ FileUtils.cp arg, tmp.path
+ [tmp, arg]
+end
+
+options = ARGV.select{|f| f=~/^-/ } + files.map{|t,o| t.path }
+
+unless system( strip, *options )
+ exit 127
+end
+code = $?.exitstatus
+
+files.each do |tmp, orig|
+ FileUtils.rm orig
+ FileUtils.cp tmp.path, orig
+end
+
+exit code
diff --git a/third_party/rake-compiler-dock/build/sudoers b/third_party/rake-compiler-dock/build/sudoers
new file mode 100644
index 0000000000..f9f9b97c95
--- /dev/null
+++ b/third_party/rake-compiler-dock/build/sudoers
@@ -0,0 +1 @@
+Defaults env_keep += "http_proxy https_proxy ftp_proxy RCD_HOST_RUBY_PLATFORM RCD_HOST_RUBY_VERSION RCD_IMAGE RUBY_CC_VERSION"