Nicolas Noble | 524d7ed | 2016-02-05 16:35:48 -0800 | [diff] [blame] | 1 | #!/bin/bash |
Jan Tattermusch | 7897ae9 | 2017-06-07 22:57:36 +0200 | [diff] [blame] | 2 | # Copyright 2015 gRPC authors. |
Nicolas Noble | 524d7ed | 2016-02-05 16:35:48 -0800 | [diff] [blame] | 3 | # |
Jan Tattermusch | 7897ae9 | 2017-06-07 22:57:36 +0200 | [diff] [blame] | 4 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | # you may not use this file except in compliance with the License. |
| 6 | # You may obtain a copy of the License at |
Nicolas Noble | 524d7ed | 2016-02-05 16:35:48 -0800 | [diff] [blame] | 7 | # |
Jan Tattermusch | 7897ae9 | 2017-06-07 22:57:36 +0200 | [diff] [blame] | 8 | # http://www.apache.org/licenses/LICENSE-2.0 |
Nicolas Noble | 524d7ed | 2016-02-05 16:35:48 -0800 | [diff] [blame] | 9 | # |
Jan Tattermusch | 7897ae9 | 2017-06-07 22:57:36 +0200 | [diff] [blame] | 10 | # Unless required by applicable law or agreed to in writing, software |
| 11 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | # See the License for the specific language governing permissions and |
| 14 | # limitations under the License. |
Nicolas Noble | 524d7ed | 2016-02-05 16:35:48 -0800 | [diff] [blame] | 15 | |
| 16 | set -ex |
| 17 | |
Nicolas "Pixel" Noble | ff2e76e | 2016-02-06 03:36:18 +0100 | [diff] [blame] | 18 | rm -rf ~/.rake-compiler |
| 19 | |
Nicolas Noble | 07854f7 | 2016-02-05 17:51:48 -0800 | [diff] [blame] | 20 | CROSS_RUBY=`mktemp tmpfile.XXXXXXXX` |
Nicolas Noble | 524d7ed | 2016-02-05 16:35:48 -0800 | [diff] [blame] | 21 | |
Alexander Polcyn | d490a9e | 2017-02-08 19:31:45 -0800 | [diff] [blame] | 22 | curl https://raw.githubusercontent.com/rake-compiler/rake-compiler/v1.0.3/tasks/bin/cross-ruby.rake > $CROSS_RUBY |
Nicolas Noble | 524d7ed | 2016-02-05 16:35:48 -0800 | [diff] [blame] | 23 | |
| 24 | patch $CROSS_RUBY << EOF |
| 25 | --- cross-ruby.rake 2016-02-05 16:26:53.000000000 -0800 |
| 26 | +++ cross-ruby.rake.patched 2016-02-05 16:27:33.000000000 -0800 |
| 27 | @@ -133,7 +133,8 @@ |
| 28 | "--host=#{MINGW_HOST}", |
| 29 | "--target=#{MINGW_TARGET}", |
| 30 | "--build=#{RUBY_BUILD}", |
| 31 | - '--enable-shared', |
| 32 | + '--enable-static', |
| 33 | + '--disable-shared', |
| 34 | '--disable-install-doc', |
| 35 | '--without-tk', |
| 36 | '--without-tcl' |
| 37 | EOF |
| 38 | |
| 39 | MAKE="make -j8" |
| 40 | |
Alexander Polcyn | d490a9e | 2017-02-08 19:31:45 -0800 | [diff] [blame] | 41 | for v in 2.4.0 2.3.0 2.2.2 2.1.5 2.0.0-p645 ; do |
| 42 | ccache -c |
Nicolas Noble | 524d7ed | 2016-02-05 16:35:48 -0800 | [diff] [blame] | 43 | rake -f $CROSS_RUBY cross-ruby VERSION=$v HOST=x86_64-darwin11 |
| 44 | done |
| 45 | |
Nicolas "Pixel" Noble | 700cae3 | 2016-02-06 01:52:38 +0100 | [diff] [blame] | 46 | sed 's/x86_64-darwin-11/universal-darwin/' ~/.rake-compiler/config.yml > $CROSS_RUBY |
Nicolas "Pixel" Noble | 9d6de14 | 2016-02-06 03:31:16 +0100 | [diff] [blame] | 47 | mv $CROSS_RUBY ~/.rake-compiler/config.yml |