1
0
Fork 0
mirror of https://github.com/ruby-opencv/ruby-opencv synced 2023-03-27 23:22:12 -04:00

fat gem support

This commit is contained in:
ser1zw 2013-05-02 07:37:23 +09:00
parent bdca94a0fb
commit 56e8411789
2 changed files with 25 additions and 2 deletions

View file

@ -16,7 +16,20 @@ hoespec = Hoe.spec 'ruby-opencv' do |s|
s.readme_file = 'README.md'
s.history_file = 'History.txt'
s.spec_extras = { :extensions => ['ext/opencv/extconf.rb'] }
s.spec_extras = {}
if RUBY_PLATFORM =~ /mingw|mswin/
s.spec_extras[:platform] = Gem::Platform::CURRENT
s.spec_extras[:files] = proc { |files|
Dir.glob("lib/[0-9].[0-9]").each { |dir|
so_file = File.join(dir, 'opencv.so')
files << so_file if File.exists? so_file
}
}
else
s.spec_extras[:extensions] = ['ext/opencv/extconf.rb']
end
s.test_globs = ['test/test_*.rb']
s.urls = ['https://github.com/ruby-opencv/ruby-opencv/']

View file

@ -1,3 +1,13 @@
require (File.dirname(__FILE__) + '/opencv/version')
require 'opencv.so'
if RUBY_PLATFORM =~ /mingw|mswin/
major, minor, subminor = RUBY_VERSION.split('.')
version_dir = (major.to_i >= 2) ? '2.0' : '1.9'
begin
require "#{version_dir}/opencv.so"
rescue LoadError
require 'opencv.so'
end
else
require 'opencv.so'
end