Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: rake-compiler/rake-compiler
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.9.1
Choose a base ref
...
head repository: rake-compiler/rake-compiler
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v0.9.2
Choose a head ref
  • 8 commits
  • 4 files changed
  • 5 contributors

Commits on Aug 12, 2013

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    9536c4f View commit details

Commits on Aug 23, 2013

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    4da5bfc View commit details

Commits on Aug 25, 2013

  1. Merge pull request #81 from tjschuck/master

    Update README with information about rake-compiler-dev-box
    luislavena committed Aug 25, 2013
    Copy the full SHA
    ea4f7d0 View commit details
  2. Merge pull request #80 from knu/fix-1.8-mkmf

    Patch Ruby 1.8.7's mkmf.rb so it works with newer Ruby.
    luislavena committed Aug 25, 2013
    Copy the full SHA
    b42c4e8 View commit details

Commits on Oct 23, 2013

  1. Pre-load resolver library before faking, in order to avoid error

    "cannot load such file -- win32/resolv" when it is required later on.
    
    This solves issue tjschuck/rake-compiler-dev-box#5
    larskanis committed Oct 23, 2013
    Copy the full SHA
    c83393c View commit details

Commits on Nov 14, 2013

  1. Merge pull request #83 from larskanis/load-resolv-before-fake

    Pre-load resolver library before faking.
    luislavena committed Nov 14, 2013
    Copy the full SHA
    415e335 View commit details
  2. Copy the full SHA
    662e486 View commit details
  3. Prepare for release

    luislavena committed Nov 14, 2013
    Copy the full SHA
    c504672 View commit details
Showing with 38 additions and 7 deletions.
  1. +6 −0 History.txt
  2. +15 −6 README.rdoc
  3. +16 −0 lib/rake/extensiontask.rb
  4. +1 −1 tasks/gem.rake
6 changes: 6 additions & 0 deletions History.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
=== 0.9.2 / 2013-11-14

* Bugfixes:
* Pre-load resolver to avoid Bundler blow up during cross-compilation
Pull #83 [larskanis]

=== 0.9.1 / 2013-08-03

* Bugfixes:
21 changes: 15 additions & 6 deletions README.rdoc
Original file line number Diff line number Diff line change
@@ -225,7 +225,16 @@ How can this be you say? Simple, rake-compiler's cross compilation features
take advantage of GCC's host/target capabilities to build 'target' binaries on
different 'host' OS's.

=== How I do this from Linux or OSX?
=== How do I do this from Linux or OSX?

==== The Easy Way

Use rake-compiler-dev-box, a virtual machine provisioned with all the necessary
build tools. With one command, you can cross-compile and package your gem into
native, Java, and Windows fat binaries (with 1.8, 1.9, and 2.0 support). See
https://github.com/tjschuck/rake-compiler-dev-box for more information.

==== The Manual Way

In addition to having the development tool chain installed (GCC), you also need to
install your platform's <tt>mingw32</tt> cross compilation package.
@@ -256,7 +265,7 @@ Download and extract. After that, make sure the bin directory is added to the PA

You can add this to your <tt>.profile</tt> to avoid the repitition.

=== I've got my tool-chain installed, now what?
==== I've got my tool-chain installed, now what?

First, you need to build Ruby for Windows on your Linux or OSX system.

@@ -292,7 +301,7 @@ The host will vary depending on provider (mingw32 versus mingw-w64 projects).
Please consult the documentation and website of the MinGW package provider before
reporting any issues.

=== OK, let's cross compile some gems!
==== OK, let's cross compile some gems!

Now, you only need specify a few additional options in your extension definition:

@@ -314,7 +323,7 @@ platform for Ruby.
To target gems for MRI Ruby's current official distribution, please force the
platform to the one (i386-mswin32-60) previously shown.

=== Warning, magician about to do some tricks, don't blink!
==== Warning, magician about to do some tricks, don't blink!

Cross compiling is still very simple:

@@ -326,7 +335,7 @@ And now, building gems for your Windows users is just 5 more letters:

And you're done, yeah.

=== But wait, there's more
==== But wait, there's more

You can specify which version of Ruby to build the extension against:

@@ -372,7 +381,7 @@ This approach catch the cases of provided fat binaries or gems compiled by the
end user installing the gem. It has also been implemented successfully in
several projects.

=== What are you talking about? (Give me examples)
== What are you talking about? (Give me examples)

I know all the above sounds like a complete foreign language (it does even for me!).
So, what if I show you some examples?
16 changes: 16 additions & 0 deletions lib/rake/extensiontask.rb
Original file line number Diff line number Diff line change
@@ -380,6 +380,17 @@ def define_cross_platform_tasks_with_version(for_platform, ruby_ver)
# copy mkmf from cross-ruby location
file "#{tmp_path}/mkmf.rb" => [mkmf_file] do |t|
cp t.prerequisites.first, t.name
if ruby_ver < "1.9" && "1.9" <= RUBY_VERSION
File.open(t.name, 'r+t') do |f|
content = f.read
content.sub!(/^( break )\*(defaults)$/, '\\1\\2.first')
content.sub!(/^( return )\*(defaults)$/, '\\1\\2.first')
content.sub!(/^( mfile\.)print( configuration\(srcprefix\))$/, '\\1puts\\2')
f.rewind
f.write content
f.truncate(f.tell)
end
end
end

# genearte fake.rb for different ruby versions
@@ -471,6 +482,11 @@ def natives_cross_platform

def fake_rb(platform, version)
<<-FAKE_RB
# Pre-load resolver library before faking, in order to avoid error
# "cannot load such file -- win32/resolv" when it is required later on.
# See also: https://github.com/tjschuck/rake-compiler-dev-box/issues/5
require 'resolv'
class Object
remove_const :RUBY_PLATFORM
remove_const :RUBY_VERSION
2 changes: 1 addition & 1 deletion tasks/gem.rake
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@ require 'rubygems/package_task'
GEM_SPEC = Gem::Specification.new do |s|
# basic information
s.name = "rake-compiler"
s.version = "0.9.1"
s.version = "0.9.2"
s.platform = Gem::Platform::RUBY

# description and details