rake-compiler 0.9.9 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 42d579996813d84b29302613b898fd3412125229
4
- data.tar.gz: b785572b1100a1b4a1f5c07f7bc0312917751879
3
+ metadata.gz: 018f14ea44299daeddfc4e1a296a1d0649963f62
4
+ data.tar.gz: ec35dd39bf310b9c4db9e277fbf0eb972bd9a9a3
5
5
  SHA512:
6
- metadata.gz: 2d56ae8f38d037dcaca636c427a9a2f7dc399917b9b0780667dd832a9f6c81877a5bfb7bdc1921492df926bedf91af66d65b91c9773674e0bbc605c31a365e4f
7
- data.tar.gz: 84ca89985be0eb6082bf28ecce3e47254e6abd48100e357e07b7749c318a2770c22397aa272430123817c1bafa7f21051d040643963839a3821401f4cd62a18b
6
+ metadata.gz: 8710ea08c274844b9fefa282730cb3630f434efc155029df4827b6823388c3206831deeaa0ca75780ca21e7d69b0026dbf214bb14fd3c91a5d73d05be3b380ce
7
+ data.tar.gz: dcbace5ef6ca38907e41205af0461b868f263adccb0b374f2785e029c800f9dfb3467d91d81a9414cd6ebecda66f338a462d639de8be036eca011b767cadcb6e
@@ -1,3 +1,8 @@
1
+ === 1.0.0 / 2016-06-21
2
+
3
+ * Enhancements:
4
+ * Really support extension in sub directory.
5
+
1
6
  === 0.9.9 / 2016-05-10
2
7
 
3
8
  * Bugfixes:
@@ -68,7 +68,7 @@ module Rake
68
68
  else
69
69
  RbConfig::CONFIG['DLEXT']
70
70
  end
71
- "#{File.basename(@name)}.#{ext}"
71
+ "#{@name}.#{ext}"
72
72
  end
73
73
 
74
74
  def source_files
@@ -110,16 +110,23 @@ Rerun `rake` under MRI Ruby 1.8.x/1.9.x to cross/native compile.
110
110
  # platform usage
111
111
  platf = for_platform || platform
112
112
 
113
+ binary_path = binary(platf)
114
+
113
115
  # lib_path
114
116
  lib_path = lib_dir
115
- if @name.include?('/')
116
- lib_path += "/#{File.dirname(@name)}"
117
- end
117
+
118
+ lib_binary_path = "#{lib_path}/#{binary_path}"
119
+ lib_binary_dir_path = File.dirname(lib_binary_path)
118
120
 
119
121
  # tmp_path
120
122
  tmp_path = "#{@tmp_dir}/#{platf}/#{@name}/#{ruby_ver}"
121
123
  stage_path = "#{@tmp_dir}/#{platf}/stage"
122
124
 
125
+ tmp_binary_path = "#{tmp_path}/#{binary_path}"
126
+ tmp_binary_dir_path = File.dirname(tmp_binary_path)
127
+ stage_binary_path = "#{stage_path}/#{lib_path}/#{binary_path}"
128
+ stage_binary_dir_path = File.dirname(stage_binary_path)
129
+
123
130
  # cleanup and clobbering
124
131
  CLEAN.include(tmp_path)
125
132
  CLEAN.include(stage_path)
@@ -128,17 +135,17 @@ Rerun `rake` under MRI Ruby 1.8.x/1.9.x to cross/native compile.
128
135
 
129
136
  # directories we need
130
137
  directory tmp_path
131
- directory "#{stage_path}/#{lib_path}"
132
- directory lib_dir
138
+ directory lib_binary_dir_path
139
+ directory stage_binary_dir_path
133
140
 
134
141
  # copy binary from temporary location to final lib
135
142
  # tmp/extension_name/extension_name.{so,bundle} => lib/
136
- task "copy:#{@name}:#{platf}:#{ruby_ver}" => [lib_path, "#{tmp_path}/#{binary(platf)}"] do
137
- install "#{tmp_path}/#{binary(platf)}", "#{lib_path}/#{binary(platf)}"
143
+ task "copy:#{@name}:#{platf}:#{ruby_ver}" => [lib_binary_dir_path, "#{tmp_path}/#{binary_path}"] do
144
+ install "#{tmp_path}/#{binary_path}", "#{lib_path}/#{binary_path}"
138
145
  end
139
146
  # copy binary from temporary location to staging directory
140
- task "copy:#{@name}:#{platf}:#{ruby_ver}" => ["#{stage_path}/#{lib_path}", "#{tmp_path}/#{binary(platf)}"] do
141
- cp "#{tmp_path}/#{binary(platf)}", "#{stage_path}/#{lib_path}/#{binary(platf)}"
147
+ task "copy:#{@name}:#{platf}:#{ruby_ver}" => [stage_binary_dir_path, "#{tmp_path}/#{binary_path}"] do
148
+ cp "#{tmp_path}/#{binary_path}", stage_binary_path
142
149
  end
143
150
 
144
151
  # copy other gem files to staging directory
@@ -146,7 +153,7 @@ Rerun `rake` under MRI Ruby 1.8.x/1.9.x to cross/native compile.
146
153
 
147
154
  # binary in temporary folder depends on makefile and source files
148
155
  # tmp/extension_name/extension_name.{so,bundle}
149
- file "#{tmp_path}/#{binary(platf)}" => ["#{tmp_path}/Makefile"] + source_files do
156
+ file "#{tmp_path}/#{binary_path}" => [tmp_binary_dir_path, "#{tmp_path}/Makefile"] + source_files do
150
157
  jruby_compile_msg = <<-EOF
151
158
  Compiling a native C extension on JRuby. This is discouraged and a
152
159
  Java extension should be preferred.
@@ -155,6 +162,9 @@ Java extension should be preferred.
155
162
 
156
163
  chdir tmp_path do
157
164
  sh make
165
+ if binary_path != File.basename(binary_path)
166
+ cp File.basename(binary_path), binary_path
167
+ end
158
168
  end
159
169
  end
160
170
 
@@ -214,7 +224,7 @@ Java extension should be preferred.
214
224
  # platform matches the indicated one.
215
225
  if platf == RUBY_PLATFORM then
216
226
  # ensure file is always copied
217
- file "#{lib_path}/#{binary(platf)}" => ["copy:#{name}:#{platf}:#{ruby_ver}"]
227
+ file "#{lib_path}/#{binary_path}" => ["copy:#{name}:#{platf}:#{ruby_ver}"]
218
228
 
219
229
  task "compile:#{@name}" => ["compile:#{@name}:#{platf}"]
220
230
  task "compile" => ["compile:#{platf}"]
@@ -297,7 +307,7 @@ Java extension should be preferred.
297
307
  end
298
308
 
299
309
  # add binaries to the dependency chain
300
- task "native:#{@gem_spec.name}:#{platf}" => ["#{stage_path}/#{lib_dir}/#{binary(platf)}"]
310
+ task "native:#{@gem_spec.name}:#{platf}" => ["#{stage_path}/#{lib_path}/#{binary(platf)}"]
301
311
 
302
312
  # ensure the extension get copied
303
313
  unless Rake::Task.task_defined?("#{lib_path}/#{binary(platf)}") then
@@ -314,21 +314,21 @@ describe Rake::ExtensionTask do
314
314
  end
315
315
  end
316
316
 
317
- context 'tmp/{platform}/prefix1/prefix2/extension_one/{ruby_ver}/extension_one.{so,bundle}' do
317
+ context 'tmp/{platform}/prefix1/prefix2/extension_one/{ruby_ver}/prefix1/prefix2/extension_one.{so,bundle}' do
318
318
  it 'should define as task' do
319
- Rake::Task.task_defined?("tmp/#{@platform}/prefix1/prefix2/extension_one/#{@ruby_ver}/#{@ext_bin}").should be_true
319
+ Rake::Task.task_defined?("tmp/#{@platform}/prefix1/prefix2/extension_one/#{@ruby_ver}/prefix1/prefix2/#{@ext_bin}").should be_true
320
320
  end
321
321
 
322
322
  it "should depend on 'tmp/{platform}/prefix1/prefix2/extension_one/{ruby_ver}/Makefile'" do
323
- Rake::Task["tmp/#{@platform}/prefix1/prefix2/extension_one/#{@ruby_ver}/#{@ext_bin}"].prerequisites.should include("tmp/#{@platform}/prefix1/prefix2/extension_one/#{@ruby_ver}/Makefile")
323
+ Rake::Task["tmp/#{@platform}/prefix1/prefix2/extension_one/#{@ruby_ver}/prefix1/prefix2/#{@ext_bin}"].prerequisites.should include("tmp/#{@platform}/prefix1/prefix2/extension_one/#{@ruby_ver}/Makefile")
324
324
  end
325
325
 
326
326
  it "should depend on 'ext/extension_one/source.c'" do
327
- Rake::Task["tmp/#{@platform}/prefix1/prefix2/extension_one/#{@ruby_ver}/#{@ext_bin}"].prerequisites.should include("ext/prefix1/prefix2/extension_one/source.c")
327
+ Rake::Task["tmp/#{@platform}/prefix1/prefix2/extension_one/#{@ruby_ver}/prefix1/prefix2/#{@ext_bin}"].prerequisites.should include("ext/prefix1/prefix2/extension_one/source.c")
328
328
  end
329
329
 
330
330
  it "should not depend on 'ext/extension_one/source.h'" do
331
- Rake::Task["tmp/#{@platform}/prefix1/prefix2/extension_one/#{@ruby_ver}/#{@ext_bin}"].prerequisites.should_not include("ext/prefix1/prefix2/extension_one/source.h")
331
+ Rake::Task["tmp/#{@platform}/prefix1/prefix2/extension_one/#{@ruby_ver}/prefix1/prefix2/#{@ext_bin}"].prerequisites.should_not include("ext/prefix1/prefix2/extension_one/source.h")
332
332
  end
333
333
  end
334
334
  end
@@ -3,7 +3,7 @@ require 'rubygems/package_task'
3
3
  GEM_SPEC = Gem::Specification.new do |s|
4
4
  # basic information
5
5
  s.name = "rake-compiler"
6
- s.version = "0.9.9"
6
+ s.version = "1.0.0"
7
7
  s.platform = Gem::Platform::RUBY
8
8
 
9
9
  # description and details
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rake-compiler
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.9
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kouhei Sutou
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-05-10 00:00:00.000000000 Z
12
+ date: 2016-06-20 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake