Nicolas Noble | 524d7ed | 2016-02-05 16:35:48 -0800 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | # Copyright 2015-2016, Google Inc. |
| 3 | # All rights reserved. |
| 4 | # |
| 5 | # Redistribution and use in source and binary forms, with or without |
| 6 | # modification, are permitted provided that the following conditions are |
| 7 | # met: |
| 8 | # |
| 9 | # * Redistributions of source code must retain the above copyright |
| 10 | # notice, this list of conditions and the following disclaimer. |
| 11 | # * Redistributions in binary form must reproduce the above |
| 12 | # copyright notice, this list of conditions and the following disclaimer |
| 13 | # in the documentation and/or other materials provided with the |
| 14 | # distribution. |
| 15 | # * Neither the name of Google Inc. nor the names of its |
| 16 | # contributors may be used to endorse or promote products derived from |
| 17 | # this software without specific prior written permission. |
| 18 | # |
| 19 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
| 20 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
| 21 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
| 22 | # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
| 23 | # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
| 24 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
| 25 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 26 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 27 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 28 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 29 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 30 | |
| 31 | set -ex |
| 32 | |
Nicolas "Pixel" Noble | ff2e76e | 2016-02-06 03:36:18 +0100 | [diff] [blame] | 33 | rm -rf ~/.rake-compiler |
| 34 | |
Nicolas Noble | 07854f7 | 2016-02-05 17:51:48 -0800 | [diff] [blame] | 35 | CROSS_RUBY=`mktemp tmpfile.XXXXXXXX` |
Nicolas Noble | 524d7ed | 2016-02-05 16:35:48 -0800 | [diff] [blame] | 36 | |
| 37 | curl https://raw.githubusercontent.com/rake-compiler/rake-compiler/v0.9.5/tasks/bin/cross-ruby.rake > $CROSS_RUBY |
| 38 | |
| 39 | patch $CROSS_RUBY << EOF |
| 40 | --- cross-ruby.rake 2016-02-05 16:26:53.000000000 -0800 |
| 41 | +++ cross-ruby.rake.patched 2016-02-05 16:27:33.000000000 -0800 |
| 42 | @@ -133,7 +133,8 @@ |
| 43 | "--host=#{MINGW_HOST}", |
| 44 | "--target=#{MINGW_TARGET}", |
| 45 | "--build=#{RUBY_BUILD}", |
| 46 | - '--enable-shared', |
| 47 | + '--enable-static', |
| 48 | + '--disable-shared', |
| 49 | '--disable-install-doc', |
| 50 | '--without-tk', |
| 51 | '--without-tcl' |
| 52 | EOF |
| 53 | |
| 54 | MAKE="make -j8" |
| 55 | |
Nicolas "Pixel" Noble | da46a70 | 2016-02-06 01:52:02 +0100 | [diff] [blame] | 56 | for v in 2.3.0 2.2.2 2.1.5 2.0.0-p645 ; do |
Nicolas Noble | 524d7ed | 2016-02-05 16:35:48 -0800 | [diff] [blame] | 57 | rake -f $CROSS_RUBY cross-ruby VERSION=$v HOST=x86_64-darwin11 |
| 58 | done |
| 59 | |
Nicolas "Pixel" Noble | 700cae3 | 2016-02-06 01:52:38 +0100 | [diff] [blame] | 60 | 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] | 61 | mv $CROSS_RUBY ~/.rake-compiler/config.yml |