Permalink
Browse files

win32 cross compile

  • Loading branch information...
1 parent 932a649 commit 82911f19fa510e5d3277c1c4bbabca6af27a372c Aurelian Oancea committed Nov 3, 2011
Showing with 37 additions and 41 deletions.
  1. +22 −24 Rakefile
  2. +1 −1 VERSION
  3. +3 −2 libstemmer_c/Makefile.windows
  4. +11 −14 ruby-stemmer.gemspec
View
@@ -1,28 +1,28 @@
require 'rubygems'
require 'rake'
-begin
- require 'jeweler'
- JEWLER = Jeweler::Tasks.new do |gem|
- gem.name = "ruby-stemmer"
- gem.version = File.read(File.expand_path(File.join(File.dirname(__FILE__),"VERSION"))).strip!
- gem.summary = %Q{Expose libstemmer_c to Ruby.}
- gem.description = %Q{Expose the bundled libstemmer_c library to Ruby.}
- gem.email = "oancea@gmail.com"
- gem.homepage = "http://github.com/aurelian/ruby-stemmer"
- gem.authors = ["Aurelian Oancea", "Yury Korolev"]
- gem.extensions = ["ext/lingua/extconf.rb"]
- gem.rubyforge_project = "ruby-stemmer"
- gem.files = FileList['lib/**/*.rb', 'README.rdoc', 'MIT-LICENSE', 'VERSION', 'Rakefile', 'libstemmer_c/**/*', 'ext/**/*', 'test/**/*']
- %w(ext/lingua/*.so ext/lingua/*.bundle ext/lingua/Makefile ext/lingua/mkmf.log ext/lingua/*.o libstemmer_c/**/*.o libstemmer_c/stemwords).each do | f |
- gem.files.exclude f
- end
+gem 'rake-compiler', '~>0.7'
+require 'rake/extensiontask'
+
+require 'jeweler'
+$jeweler = Jeweler::Tasks.new do |gem|
+ gem.name = "ruby-stemmer"
+ gem.version = File.read(File.expand_path(File.join(File.dirname(__FILE__),"VERSION"))).strip!
+ gem.summary = %Q{Expose libstemmer_c to Ruby.}
+ gem.description = %Q{Expose the bundled libstemmer_c library to Ruby.}
+ gem.email = "oancea@gmail.com"
+ gem.homepage = "http://github.com/aurelian/ruby-stemmer"
+ gem.authors = ["Aurelian Oancea", "Yury Korolev"]
+ gem.extensions = ["ext/lingua/extconf.rb"]
+ gem.rubyforge_project = "ruby-stemmer"
+ gem.files = FileList['lib/**/*.rb', 'README.rdoc', 'MIT-LICENSE', 'VERSION', 'Rakefile', 'libstemmer_c/**/*', 'ext/**/*', 'test/**/*']
+ %w(ext/lingua/*.so ext/lingua/*.bundle ext/lingua/Makefile ext/lingua/mkmf.log ext/lingua/*.o libstemmer_c/**/*.o libstemmer_c/stemwords).each do | f |
+ gem.files.exclude f
end
- Jeweler::GemcutterTasks.new
-rescue LoadError
- puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
end
+Jeweler::GemcutterTasks.new
+
require 'rake/testtask'
Rake::TestTask.new(:test) do |test|
test.libs << 'lib' << 'test'
@@ -47,19 +47,17 @@ task :test => :check_dependencies
task :default => :test
-gem 'rake-compiler', '>= 0.4.1'
-require "rake/extensiontask"
-
CLOBBER.include("libstemmer_c/**/*.o")
-Rake::ExtensionTask.new(JEWLER.gemspec.name, JEWLER.gemspec) do |ext|
+Rake::ExtensionTask.new('ruby-stemmer', $jeweler.jeweler.gemspec) do |ext|
ext.lib_dir = File.join(*['lib', 'lingua', ENV['FAT_DIR']].compact)
ext.ext_dir = File.join 'ext', 'lingua'
ext.cross_compile = true
+ ext.cross_platform = ['i686-mswin32']
@luislavena

luislavena Nov 6, 2011

Something I noticed with this is that only x86-mswin32 gem was released.

Would you mind change it to:

  ext.cross_platform = ['i386-mswin32-60', 'i386-mingw32']

That way you can generate gems for RubyInstaller (which is MinGW platform).

Thank you!

@aurelian

aurelian Nov 6, 2011

Owner

Done.

BTW what's the idea with -60?

@luislavena

luislavena via email Nov 6, 2011

ext.name = 'stemmer_native'
end
-require 'rake/rdoctask'
+require 'rdoc/task'
Rake::RDocTask.new do |rdoc|
version = File.exist?('VERSION') ? File.read('VERSION') : ""
rdoc.rdoc_dir = 'rdoc'
View
@@ -1 +1 @@
-0.9.1
+0.9.2
@@ -1,7 +1,8 @@
include mkinc.mak
-AR=/usr/local/i386-mingw32-4.3.0/bin/i386-mingw32-ar
-CC=/usr/local/i386-mingw32-4.3.0/bin/i386-mingw32-gcc
+AR=i686-w64-mingw32-ar
+CC=i686-w64-mingw32-gcc
+LD=i686-w64-mingw32-ld
CFLAGS=-Iinclude
View
@@ -4,17 +4,18 @@
# -*- encoding: utf-8 -*-
Gem::Specification.new do |s|
- s.name = %q{ruby-stemmer}
- s.version = "0.9.1"
+ s.name = "ruby-stemmer"
+ s.version = "0.9.2"
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["Aurelian Oancea", "Yury Korolev"]
- s.date = %q{2011-03-13}
- s.description = %q{Expose the bundled libstemmer_c library to Ruby.}
- s.email = %q{oancea@gmail.com}
+ s.date = "2011-11-03"
+ s.description = "Expose the bundled libstemmer_c library to Ruby."
+ s.email = "oancea@gmail.com"
s.extensions = ["ext/lingua/extconf.rb"]
s.extra_rdoc_files = [
- "README.rdoc"
+ "README.rdoc",
+ "TODO"
]
s.files = [
"MIT-LICENSE",
@@ -111,15 +112,11 @@ Gem::Specification.new do |s|
"test/helper.rb",
"test/lingua/test_stemmer.rb"
]
- s.homepage = %q{http://github.com/aurelian/ruby-stemmer}
+ s.homepage = "http://github.com/aurelian/ruby-stemmer"
s.require_paths = ["lib"]
- s.rubyforge_project = %q{ruby-stemmer}
- s.rubygems_version = %q{1.6.2}
- s.summary = %q{Expose libstemmer_c to Ruby.}
- s.test_files = [
- "test/helper.rb",
- "test/lingua/test_stemmer.rb"
- ]
+ s.rubyforge_project = "ruby-stemmer"
+ s.rubygems_version = "1.8.11"
+ s.summary = "Expose libstemmer_c to Ruby."
if s.respond_to? :specification_version then
s.specification_version = 3

4 comments on commit 82911f1

Thought about using MiniPortile to compile libstemmer_c statically?

https://github.com/luislavena/mini_portile

Projects like sqlite3-ruby and TinyTDS are using it to build the static dependency before compiling the extension (either for native or cross compilation).

Cheers!

Owner

aurelian replied Nov 4, 2011

Owner

aurelian replied Nov 6, 2011

Will check them out, thanks!

Please sign in to comment.