rake-compiler 1.1.6 → 1.1.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: caf70af8b4cadce86d509ce209540e29eb74ad29c1774c2941671b285d805b2b
4
- data.tar.gz: 0fedb5d1269d3e6b4cdfa22b4e587f2a39465adf1f43d536a20e55b32fca045a
3
+ metadata.gz: 02cad822f10b4321127ce0c91ecb9ce1b7465897be75cb63864598f67a0862f9
4
+ data.tar.gz: e892ced800adc8b779b7a248f726590d2a9967c6efb95817778af4b51f650d4a
5
5
  SHA512:
6
- metadata.gz: b8311e1465dcb310b9cf4623785358572ed510ce81ebd3bcea463ee1fb9fa0c912b642db4467adb5c4ecef462a934562c3551bb7b81e296ce5872374095e760b
7
- data.tar.gz: 69bbd41d23b832b735d97ecb709dbb5a28c8a7ffeafcfb6b0615fce44c1ad1cb4702742bc1971baaaefde78dcd47408ba311b24c0456ef64ae53fe7c7542fd6e
6
+ metadata.gz: b773ca5038495c9301561f7f093dd292a90c8987d71964234359e742e159e3dcceba66762a12c161a79b60c0d8eb55b2fc1d65dfb186a64b8905ea75148090f5
7
+ data.tar.gz: 281a93c3f8e00a01ede2150bff92f8898406fef693192d1a83710eb7e40c07e53229f91aeee8c661489a4901e81c702e8d55f667858f59ddeb47f8f93da75ab3
data/History.md CHANGED
@@ -1,3 +1,9 @@
1
+ ### 1.1.7 / 2022-01-04
2
+
3
+ * Fixes:
4
+ * Fix binary paths for staging and clobber.
5
+ [#197](https://github.com/rake-compiler/rake-compiler/issues/197) [Patch by konsolebox]
6
+
1
7
  ### 1.1.6 / 2021-12-12
2
8
 
3
9
  * Fixes:
@@ -82,9 +82,12 @@ module Rake
82
82
  private
83
83
  # copy other gem files to staging directory
84
84
  def define_staging_file_tasks(files, lib_path, stage_path, platf, ruby_ver)
85
+ # lib_binary_path
86
+ lib_binary_path = "#{lib_path}/#{File.basename(binary(platf))}"
87
+
85
88
  files.each do |gem_file|
86
89
  # ignore directories and the binary extension
87
- next if File.directory?(gem_file) || gem_file == "#{lib_path}/#{binary(platf)}"
90
+ next if File.directory?(gem_file) || gem_file == lib_binary_path
88
91
  stage_file = "#{stage_path}/#{gem_file}"
89
92
 
90
93
  # copy each file from base to stage directory
@@ -105,10 +108,14 @@ module Rake
105
108
  platf = for_platform || platform
106
109
 
107
110
  binary_path = binary(platf)
111
+ binary_base_name = File.basename(binary_path)
108
112
 
109
113
  # lib_path
110
114
  lib_path = lib_dir
111
115
 
116
+ # lib_binary_path
117
+ lib_binary_path = "#{lib_path}/#{binary_base_name}"
118
+
112
119
  # tmp_path
113
120
  tmp_path = "#{@tmp_dir}/#{platf}/#{@name}/#{ruby_ver}"
114
121
  stage_path = "#{@tmp_dir}/#{platf}/stage"
@@ -116,13 +123,13 @@ module Rake
116
123
  siteconf_path = "#{tmp_path}/.rake-compiler-siteconf.rb"
117
124
  tmp_binary_path = "#{tmp_path}/#{binary_path}"
118
125
  tmp_binary_dir_path = File.dirname(tmp_binary_path)
119
- stage_binary_path = "#{stage_path}/#{lib_path}/#{binary_path}"
126
+ stage_binary_path = "#{stage_path}/#{lib_binary_path}"
120
127
  stage_binary_dir_path = File.dirname(stage_binary_path)
121
128
 
122
129
  # cleanup and clobbering
123
130
  CLEAN.include(tmp_path)
124
131
  CLEAN.include(stage_path)
125
- CLOBBER.include("#{lib_path}/#{binary(platf)}")
132
+ CLOBBER.include(lib_binary_path)
126
133
  CLOBBER.include("#{@tmp_dir}")
127
134
 
128
135
  # directories we need
@@ -172,8 +179,8 @@ Java extension should be preferred.
172
179
 
173
180
  chdir tmp_path do
174
181
  sh make
175
- if binary_path != File.basename(binary_path)
176
- cp File.basename(binary_path), binary_path
182
+ if binary_path != binary_base_name
183
+ cp binary_base_name, binary_path
177
184
  end
178
185
  end
179
186
  end
@@ -234,7 +241,7 @@ Java extension should be preferred.
234
241
  # platform matches the indicated one.
235
242
  if platf == RUBY_PLATFORM then
236
243
  # ensure file is always copied
237
- file "#{lib_path}/#{File.basename(binary_path)}" => ["copy:#{name}:#{platf}:#{ruby_ver}"]
244
+ file lib_binary_path => ["copy:#{name}:#{platf}:#{ruby_ver}"]
238
245
 
239
246
  task "compile:#{@name}" => ["compile:#{@name}:#{platf}"]
240
247
  task "compile" => ["compile:#{platf}"]
@@ -250,6 +257,9 @@ Java extension should be preferred.
250
257
  # lib_path
251
258
  lib_path = lib_dir
252
259
 
260
+ # lib_binary_path
261
+ lib_binary_path = "#{lib_path}/#{File.basename(binary(platf))}"
262
+
253
263
  # Update compiled platform/version combinations
254
264
  @ruby_versions_per_platform[platf] << ruby_ver
255
265
 
@@ -329,13 +339,13 @@ Java extension should be preferred.
329
339
  end
330
340
 
331
341
  # add binaries to the dependency chain
332
- task "native:#{@gem_spec.name}:#{platf}" => ["#{stage_path}/#{lib_path}/#{binary(platf)}"]
342
+ task "native:#{@gem_spec.name}:#{platf}" => ["#{stage_path}/#{lib_binary_path}"]
333
343
 
334
344
  # ensure the extension get copied
335
- unless Rake::Task.task_defined?("#{lib_path}/#{binary(platf)}") then
336
- file "#{lib_path}/#{binary(platf)}" => ["copy:#{@name}:#{platf}:#{ruby_ver}"]
345
+ unless Rake::Task.task_defined?(lib_binary_path) then
346
+ file lib_binary_path => ["copy:#{@name}:#{platf}:#{ruby_ver}"]
337
347
  end
338
- file "#{stage_path}/#{lib_dir}/#{binary(platf)}" => ["copy:#{@name}:#{platf}:#{ruby_ver}"]
348
+ file "#{stage_path}/#{lib_binary_path}" => ["copy:#{@name}:#{platf}:#{ruby_ver}"]
339
349
 
340
350
  # Allow segmented packaging by platform (open door for 'cross compile')
341
351
  task "native:#{platf}" => ["native:#{@gem_spec.name}:#{platf}"]
@@ -394,6 +404,9 @@ Java extension should be preferred.
394
404
  # lib_path
395
405
  lib_path = lib_dir
396
406
 
407
+ # lib_binary_path
408
+ lib_binary_path = "#{lib_path}/#{File.basename(binary(for_platform))}"
409
+
397
410
  unless rbconfig_file = config_file["rbconfig-#{for_platform}-#{ruby_ver}"] then
398
411
  warn "no configuration section for specified version of Ruby (rbconfig-#{for_platform}-#{ruby_ver})"
399
412
  return
@@ -460,12 +473,12 @@ Java extension should be preferred.
460
473
 
461
474
  # clear lib/binary dependencies and trigger cross platform ones
462
475
  # check if lib/binary is defined (damn bundle versus so versus dll)
463
- if Rake::Task.task_defined?("#{lib_path}/#{binary(for_platform)}") then
464
- Rake::Task["#{lib_path}/#{binary(for_platform)}"].prerequisites.clear
476
+ if Rake::Task.task_defined?(lib_binary_path) then
477
+ Rake::Task[lib_binary_path].prerequisites.clear
465
478
  end
466
479
 
467
480
  # FIXME: targeting multiple platforms copies the file twice
468
- file "#{lib_path}/#{File.basename(binary(for_platform))}" => ["copy:#{@name}:#{for_platform}:#{ruby_ver}"]
481
+ file lib_binary_path => ["copy:#{@name}:#{for_platform}:#{ruby_ver}"]
469
482
 
470
483
  # if everything for native task is in place
471
484
  if @gem_spec && @gem_spec.platform == 'ruby' then
@@ -53,15 +53,20 @@ module Rake
53
53
  # platform usage
54
54
  platf = for_platform || platform
55
55
 
56
+ binary_path = binary(platf)
57
+
56
58
  # lib_path
57
59
  lib_path = lib_dir
58
60
 
61
+ # lib_binary_path
62
+ lib_binary_path = "#{lib_path}/#{File.basename(binary_path)}"
63
+
59
64
  # tmp_path
60
65
  tmp_path = "#{@tmp_dir}/#{platf}/#{@name}"
61
66
 
62
67
  # cleanup and clobbering
63
68
  CLEAN.include(tmp_path)
64
- CLOBBER.include("#{lib_path}/#{binary(platf)}")
69
+ CLOBBER.include(lib_binary_path)
65
70
  CLOBBER.include("#{@tmp_dir}")
66
71
 
67
72
  # directories we need
@@ -70,11 +75,11 @@ module Rake
70
75
 
71
76
  # copy binary from temporary location to final lib
72
77
  # tmp/extension_name/extension_name.{so,bundle} => lib/
73
- task "copy:#{@name}:#{platf}" => [lib_path, "#{tmp_path}/#{binary(platf)}"] do
74
- install "#{tmp_path}/#{binary(platf)}", "#{lib_path}/#{binary(platf)}"
78
+ task "copy:#{@name}:#{platf}" => [lib_path, "#{tmp_path}/#{binary_path}"] do
79
+ install "#{tmp_path}/#{binary_path}", lib_binary_path
75
80
  end
76
81
 
77
- file "#{tmp_path}/#{binary(platf)}" => "#{tmp_path}/.build" do
82
+ file "#{tmp_path}/#{binary_path}" => "#{tmp_path}/.build" do
78
83
 
79
84
  class_files = FileList["#{tmp_path}/**/*.class"].
80
85
  gsub("#{tmp_path}/", '')
@@ -86,7 +91,7 @@ module Rake
86
91
  ["-C #{tmp_path}", path]
87
92
  }.flatten
88
93
 
89
- sh "jar cf #{tmp_path}/#{binary(platf)} #{args.join(' ')}"
94
+ sh "jar cf #{tmp_path}/#{binary_path} #{args.join(' ')}"
90
95
  end
91
96
 
92
97
  file "#{tmp_path}/.build" => [tmp_path] + source_files do
@@ -137,7 +142,7 @@ execute the Rake compilation task using the JRuby interpreter.
137
142
  # platform matches the indicated one.
138
143
  if platf == RUBY_PLATFORM then
139
144
  # ensure file is always copied
140
- file "#{lib_path}/#{binary(platf)}" => ["copy:#{name}:#{platf}"]
145
+ file lib_binary_path => ["copy:#{name}:#{platf}"]
141
146
 
142
147
  task "compile:#{@name}" => ["compile:#{@name}:#{platf}"]
143
148
  task "compile" => ["compile:#{platf}"]
@@ -184,12 +189,15 @@ execute the Rake compilation task using the JRuby interpreter.
184
189
  end
185
190
  end
186
191
 
192
+ # lib_binary_path
193
+ lib_binary_path = "#{lib_path}/#{File.basename(binary(platform))}"
194
+
187
195
  # add binaries to the dependency chain
188
- task "java:#{@gem_spec.name}" => ["#{lib_path}/#{binary(platform)}"]
196
+ task "java:#{@gem_spec.name}" => [lib_binary_path]
189
197
 
190
198
  # ensure the extension get copied
191
- unless Rake::Task.task_defined?("#{lib_path}/#{binary(platform)}") then
192
- file "#{lib_path}/#{binary(platform)}" => ["copy:#{name}:#{platform}"]
199
+ unless Rake::Task.task_defined?(lib_binary_path) then
200
+ file lib_binary_path => ["copy:#{name}:#{platform}"]
193
201
  end
194
202
 
195
203
  task 'java' => ["java:#{@gem_spec.name}"]
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: 1.1.6
4
+ version: 1.1.7
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: 2021-12-11 00:00:00.000000000 Z
12
+ date: 2022-01-03 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake
@@ -145,7 +145,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
145
145
  - !ruby/object:Gem::Version
146
146
  version: 1.8.23
147
147
  requirements: []
148
- rubygems_version: 3.3.0.dev
148
+ rubygems_version: 3.4.0.dev
149
149
  signing_key:
150
150
  specification_version: 4
151
151
  summary: Rake-based Ruby Extension (C, Java) task generator.