Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

executable file 80 lines (71 sloc) 2.124 kB
#! /usr/bin/env bash
#
# script to build gems for all relevant platforms:
# - MRI et al (standard gem)
# - windows (x86-mingw32 and x86-msin32-60)
# - jruby
#
# prerequisite is the mingw32 packages.
# on ubuntu, `sudo apt-get install mingw32`
# for others, read up at https://github.com/luislavena/rake-compiler
#
# on ubuntus 11 and later, you may have issues with building
# rake-compiler's rubies against openssl v2. Just comment the lines
# out from ossl_ssl.c and you'll be fine.
#
# you may have issues with Pathname conversion to String in bundler. Add this to the offending bundler file:
#
# class Pathname
# def to_str
# to_s
# end
# end
#
# you may also have to remove some of the symbol checks in extconf.rb ... crazy.
#
HOST=
# Load RVM into a shell session *as a function*
if [[ -s "$HOME/.rvm/scripts/rvm" ]] ; then
source "$HOME/.rvm/scripts/rvm"
elif [[ -s "/usr/local/rvm/scripts/rvm" ]] ; then
source "/usr/local/rvm/scripts/rvm"
else
echo "ERROR: An RVM installation was not found.\n"
fi
function rvm_use {
current_ruby=$1
rvm use "${1}@nokogiri" --create
}
set -o errexit
# initialize
rvm_use 1.8.7
bundle install --quiet --local || bundle install
rm -rf tmp pkg
bundle exec rake clean
# holding pen
rm -rf gems
mkdir -p gems
# windows
rvm_use 1.8.7
if [[ ! -a /home/mike/.rake-compiler/ruby/ruby-1.8.7-p330/lib/ruby/1.8.7/x86_64-linux/rbconfig.rb ]] ; then
bundle exec rake-compiler cross-ruby VERSION=1.8.7-p330
fi
if [[ ! -a /home/mike/.rake-compiler/ruby/ruby-1.9.2-p136/lib/ruby/1.9.1/x86_64-linux/rbconfig.rb ]] ; then
bundle exec rake-compiler cross-ruby VERSION=1.9.2-p136
fi
bundle exec rake cross
bundle exec rake gem:windows
cp -v pkg/nokogiri*x86-{mingw32,mswin32}*.gem gems
# MRI
rvm_use 1.8.7
bundle exec rake gem
cp -v pkg/nokogiri*.gem gems # should only be one at this point in the script
# jruby
rvm_use jruby-1.6.5
bundle install --quiet --local || bundle install
bundle exec rake clean clobber
rvm_use 1.8.7
bundle exec rake generate
rvm_use jruby-1.6.5
bundle exec rake gem
cp -v pkg/nokogiri*java.gem gems
Jump to Line
Something went wrong with that request. Please try again.