Permalink
Browse files

Ensure binaries extensions get copied during gem generation.

  • Loading branch information...
1 parent 248638a commit b1b1ddaf6a8ffe4b32ffc0802ff10c66b550872d @luislavena luislavena committed Nov 29, 2008
Showing with 9 additions and 0 deletions.
  1. +9 −0 lib/rake/extensiontask.rb
@@ -161,7 +161,16 @@ def define_native_tasks(for_platform = nil)
spec.extensions.clear
# add the binaries that this task depends on
+ # ensure the files get properly copied to lib_dir
ext_files = t.prerequisites.map { |ext| "#{@lib_dir}/#{File.basename(ext)}" }
+ ext_files.each do |ext|
+ unless Rake::Task.task_defined?("#{@lib_dir}/#{File.basename(ext)}") then
+ # strip out path and .so/.bundle
+ file "#{@lib_dir}/#{File.basename(ext)}" => ["copy:#{File.basename(ext).ext('')}:#{platf}"]
+ end
+ end
+
+ # include the files in the gem specification
spec.files += ext_files
# Generate a package for this gem

0 comments on commit b1b1dda

Please sign in to comment.