Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100755 94 lines (84 sloc) 2.406 kb
840e802 @flavorjones Script `build_all` to build gems for all our supported platforms.
flavorjones authored
1 #! /usr/bin/env bash
2 #
3 # script to build gems for all relevant platforms:
4 # - MRI et al (standard gem)
9c66e2c @flavorjones whitespace and comments
flavorjones authored
5 # - windows (x86-mingw32 and x86-mswin32-60)
840e802 @flavorjones Script `build_all` to build gems for all our supported platforms.
flavorjones authored
6 # - jruby
7 #
7fd9941 @flavorjones moar comments about how to build releases.
flavorjones authored
8 # here's what I recommend for building all the gems:
840e802 @flavorjones Script `build_all` to build gems for all our supported platforms.
flavorjones authored
9 #
7fd9941 @flavorjones moar comments about how to build releases.
flavorjones authored
10 # 1. set up a vagrant VM guest running ubuntu lucid 32-bit.
11 # 2. install rvm, and install 1.8.7, 1.9.3 and jruby.
12 # 3. `sudo apt-get install mingw32`
583ce39 @flavorjones comment on openssl v2 problems with rake-compiler on ubuntu 11 or later
flavorjones authored
13 #
7fd9941 @flavorjones moar comments about how to build releases.
flavorjones authored
14 # as you build, you may run into these problems:
1c22b1b @flavorjones more comments on how to build all gems
flavorjones authored
15 #
7fd9941 @flavorjones moar comments about how to build releases.
flavorjones authored
16 # - on ubuntus 11 and later, you may have issues with building
17 # rake-compiler's rubies against openssl v2. Just comment the lines
18 # out from ossl_ssl.c and you'll be fine.
1c22b1b @flavorjones more comments on how to build all gems
flavorjones authored
19 #
7fd9941 @flavorjones moar comments about how to build releases.
flavorjones authored
20 # - you may have issues with Pathname conversion to String in
21 # bundler. Add this to the offending bundler file:
22 #
23 # class Pathname
24 # def to_str
25 # to_s
26 # end
27 # end
28 #
29 # - you may also have to hack rubygems.rb to eliminate a reference to
30 # RUBY_ENGINE
1c22b1b @flavorjones more comments on how to build all gems
flavorjones authored
31 #
840e802 @flavorjones Script `build_all` to build gems for all our supported platforms.
flavorjones authored
32
2767756 @flavorjones make sure to unset HOST when doing the rake-compiler dance
flavorjones authored
33 HOST=
34
840e802 @flavorjones Script `build_all` to build gems for all our supported platforms.
flavorjones authored
35 # Load RVM into a shell session *as a function*
36 if [[ -s "$HOME/.rvm/scripts/rvm" ]] ; then
37 source "$HOME/.rvm/scripts/rvm"
38 elif [[ -s "/usr/local/rvm/scripts/rvm" ]] ; then
39 source "/usr/local/rvm/scripts/rvm"
40 else
41 echo "ERROR: An RVM installation was not found.\n"
42 fi
43
44 function rvm_use {
45 current_ruby=$1
46 rvm use "${1}@nokogiri" --create
47 }
48
49 set -o errexit
50
51 # initialize
9e4fc42 @flavorjones Changing gem build process to use 1.8.7. Ugh.
flavorjones authored
52 rvm_use 1.8.7
95d2fe3 @flavorjones build_all should bundle install
flavorjones authored
53 bundle install --quiet --local || bundle install
840e802 @flavorjones Script `build_all` to build gems for all our supported platforms.
flavorjones authored
54 rm -rf tmp pkg
5976ce5 @flavorjones Make cross-compilation a bit faster.
flavorjones authored
55 bundle exec rake clean
840e802 @flavorjones Script `build_all` to build gems for all our supported platforms.
flavorjones authored
56
57 # holding pen
58 rm -rf gems
59 mkdir -p gems
60
61 # windows
ed8dad8 @flavorjones let's make sure we're on a 32-bit system
flavorjones authored
62 platform=$(uname -i)
63 if [[ $platform =~ "64" ]] ; then
64 echo ""
65 echo "ERROR: You need to build the windows gem on a 32-bit machine!"
66 echo ""
67 exit 1
68 fi
840e802 @flavorjones Script `build_all` to build gems for all our supported platforms.
flavorjones authored
69 rvm_use 1.8.7
277dbcc @flavorjones username fail.
flavorjones authored
70 if [[ ! -a ${HOME}/.rake-compiler/ruby/ruby-1.8.7-p330/lib/ruby/1.8.7/x86_64-linux/rbconfig.rb ]] ; then
5976ce5 @flavorjones Make cross-compilation a bit faster.
flavorjones authored
71 bundle exec rake-compiler cross-ruby VERSION=1.8.7-p330
72 fi
277dbcc @flavorjones username fail.
flavorjones authored
73 if [[ ! -a ${HOME}/.rake-compiler/ruby/ruby-1.9.2-p136/lib/ruby/1.9.1/x86_64-linux/rbconfig.rb ]] ; then
5976ce5 @flavorjones Make cross-compilation a bit faster.
flavorjones authored
74 bundle exec rake-compiler cross-ruby VERSION=1.9.2-p136
75 fi
840e802 @flavorjones Script `build_all` to build gems for all our supported platforms.
flavorjones authored
76 bundle exec rake cross
2c9c744 @flavorjones build changes and comments
flavorjones authored
77 bundle exec rake gem:windows
840e802 @flavorjones Script `build_all` to build gems for all our supported platforms.
flavorjones authored
78 cp -v pkg/nokogiri*x86-{mingw32,mswin32}*.gem gems
79
5976ce5 @flavorjones Make cross-compilation a bit faster.
flavorjones authored
80 # MRI
81 rvm_use 1.8.7
82 bundle exec rake gem
83 cp -v pkg/nokogiri*.gem gems # should only be one at this point in the script
84
840e802 @flavorjones Script `build_all` to build gems for all our supported platforms.
flavorjones authored
85 # jruby
e3a7b15 @flavorjones build_all shouldn't care about the particular jruby version.
flavorjones authored
86 rvm_use jruby
dc9aeb7 @flavorjones build_all should bundle install for jruby.
flavorjones authored
87 bundle install --quiet --local || bundle install
840e802 @flavorjones Script `build_all` to build gems for all our supported platforms.
flavorjones authored
88 bundle exec rake clean clobber
89 rvm_use 1.8.7
90 bundle exec rake generate
e3a7b15 @flavorjones build_all shouldn't care about the particular jruby version.
flavorjones authored
91 rvm_use jruby
840e802 @flavorjones Script `build_all` to build gems for all our supported platforms.
flavorjones authored
92 bundle exec rake gem
e3a7b15 @flavorjones build_all shouldn't care about the particular jruby version.
flavorjones authored
93 cp -v pkg/nokogiri*java.gem gems
Something went wrong with that request. Please try again.