autobuild 1.17.0 → 1.21.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (46) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +107 -0
  3. data/.travis.yml +3 -2
  4. data/Gemfile +2 -1
  5. data/Rakefile +1 -4
  6. data/autobuild.gemspec +18 -13
  7. data/bin/autobuild +4 -3
  8. data/lib/autobuild.rb +4 -5
  9. data/lib/autobuild/build_logfile.rb +6 -4
  10. data/lib/autobuild/config.rb +104 -41
  11. data/lib/autobuild/configurable.rb +32 -18
  12. data/lib/autobuild/environment.rb +126 -120
  13. data/lib/autobuild/exceptions.rb +48 -31
  14. data/lib/autobuild/import/archive.rb +134 -82
  15. data/lib/autobuild/import/cvs.rb +28 -24
  16. data/lib/autobuild/import/darcs.rb +13 -16
  17. data/lib/autobuild/import/git-lfs.rb +37 -30
  18. data/lib/autobuild/import/git.rb +246 -182
  19. data/lib/autobuild/import/hg.rb +23 -18
  20. data/lib/autobuild/import/svn.rb +48 -29
  21. data/lib/autobuild/importer.rb +534 -499
  22. data/lib/autobuild/mail_reporter.rb +77 -77
  23. data/lib/autobuild/package.rb +200 -122
  24. data/lib/autobuild/packages/autotools.rb +47 -42
  25. data/lib/autobuild/packages/cmake.rb +77 -65
  26. data/lib/autobuild/packages/dummy.rb +9 -8
  27. data/lib/autobuild/packages/genom.rb +1 -1
  28. data/lib/autobuild/packages/gnumake.rb +74 -31
  29. data/lib/autobuild/packages/import.rb +2 -6
  30. data/lib/autobuild/packages/orogen.rb +32 -31
  31. data/lib/autobuild/packages/pkgconfig.rb +2 -2
  32. data/lib/autobuild/packages/python.rb +12 -8
  33. data/lib/autobuild/packages/ruby.rb +22 -17
  34. data/lib/autobuild/parallel.rb +50 -46
  35. data/lib/autobuild/pkgconfig.rb +25 -13
  36. data/lib/autobuild/progress_display.rb +149 -64
  37. data/lib/autobuild/rake_task_extension.rb +12 -7
  38. data/lib/autobuild/reporting.rb +51 -26
  39. data/lib/autobuild/subcommand.rb +72 -65
  40. data/lib/autobuild/test.rb +9 -7
  41. data/lib/autobuild/test_utility.rb +12 -10
  42. data/lib/autobuild/timestamps.rb +28 -23
  43. data/lib/autobuild/tools.rb +17 -16
  44. data/lib/autobuild/utility.rb +67 -23
  45. data/lib/autobuild/version.rb +1 -1
  46. metadata +53 -37
@@ -10,18 +10,17 @@ module Autobuild
10
10
  def self.autotools(opts, &proc)
11
11
  Autotools.new(opts, &proc)
12
12
  end
13
-
14
- if Autobuild.macos?
15
- Autobuild.programs['libtoolize'] = "glibtoolize"
16
- end
17
13
 
18
- #
14
+ Autobuild.programs['libtoolize'] = "glibtoolize" if Autobuild.macos?
15
+
16
+ #
19
17
  # ==== Handles autotools-based packages
20
18
  #
21
19
  # == Used programs (see <tt>Autobuild.programs</tt>)
22
- # Autotools will use the 'aclocal', 'autoheader', 'autoconf', 'automake' and 'bear'
23
- # programs defined on Autobuild.programs. autoheader and bear are disabled by default,
24
- # aclocal, autoconf and automake use are autodetected.
20
+ # Autotools will use the 'aclocal', 'autoheader', 'autoconf', 'automake'
21
+ # and 'bear' programs defined on Autobuild.programs. autoheader and bear
22
+ # are disabled by default, aclocal, autoconf and automake use are
23
+ # autodetected.
25
24
  #
26
25
  # To override this default behaviour on a per-package basis, use Autotools#use
27
26
  #
@@ -47,10 +46,13 @@ def self.enable_bear_globally=(flag)
47
46
 
48
47
  def using_bear?
49
48
  return Autotools.enable_bear_globally? if using[:bear].nil?
49
+
50
50
  using[:bear]
51
51
  end
52
52
 
53
- def configurestamp; "#{builddir}/config.status" end
53
+ def configurestamp
54
+ "#{builddir}/config.status"
55
+ end
54
56
 
55
57
  def initialize(options)
56
58
  @using = Hash.new
@@ -66,11 +68,14 @@ def initialize(options)
66
68
 
67
69
  def common_utility_handling(utility, target)
68
70
  utility.task do
69
- progress_start "generating documentation for %s", :done_message => 'generated documentation for %s' do
71
+ progress_start "generating documentation for %s",
72
+ done_message: 'generated documentation for %s' do
70
73
  if internal_doxygen_mode?
71
74
  run_doxygen
72
75
  else
73
- run(utility.name, Autobuild.tool(:make), "-j#{parallel_build_level}", target, :working_directory => builddir)
76
+ run(utility.name,
77
+ Autobuild.tool(:make), "-j#{parallel_build_level}",
78
+ target, working_directory: builddir)
74
79
  end
75
80
  yield if block_given?
76
81
  end
@@ -117,10 +122,9 @@ def use(*programs)
117
122
  programs
118
123
  end
119
124
 
120
- if !programs.kind_of?(Hash)
121
- programs = Array[*programs].inject({}) do |progs, spec|
125
+ unless programs.kind_of?(Hash)
126
+ programs = Array[*programs].each_with_object({}) do |spec, progs|
122
127
  progs[spec.first] = spec.last
123
- progs
124
128
  end
125
129
  end
126
130
  programs.each do |name, opt|
@@ -140,9 +144,7 @@ def prepare_for_forced_build
140
144
 
141
145
  if using[:automake]
142
146
  Find.find(srcdir) do |path|
143
- if File.basename(path) == "Makefile.in"
144
- FileUtils.rm_f path
145
- end
147
+ FileUtils.rm_f(path) if File.basename(path) == "Makefile.in"
146
148
  end
147
149
  end
148
150
 
@@ -161,7 +163,6 @@ def import(options = Hash.new)
161
163
  is_checking_out = !File.directory?(srcdir)
162
164
 
163
165
  super
164
-
165
166
  ensure
166
167
  if is_checking_out && File.directory?(srcdir)
167
168
  FileUtils.touch File.join(srcdir, ".fresh_checkout")
@@ -190,7 +191,9 @@ def prepare
190
191
  if output && (match = /with options "(.*)"/.match(output))
191
192
  options = Shellwords.shellwords(match[1])
192
193
  else
193
- raise UnexpectedConfigStatusOutput, "invalid output of config.status --version, expected a line with `with options \"OPTIONS\"`"
194
+ raise UnexpectedConfigStatusOutput, "invalid output of "\
195
+ "config.status --version, expected a line with "\
196
+ "`with options \"OPTIONS\"`"
194
197
  end
195
198
 
196
199
  # Add the --prefix option to the configureflags array
@@ -205,8 +208,8 @@ def prepare
205
208
  else
206
209
  # This is an envvar entry. Ignore it if it is not
207
210
  # explicitely given in configureflags
208
- varname, value = o.split("=").first
209
- if current_flag = testflags.find { |fl| fl =~ /^#{varname}=/ }
211
+ varname, = o.split("=").first
212
+ if (current_flag = testflags.find { |fl| fl =~ /^#{varname}=/ })
210
213
  current_flag != o
211
214
  else false
212
215
  end
@@ -215,7 +218,8 @@ def prepare
215
218
  new_opt = testflags.find { |o| !options.include?(o) }
216
219
  if old_opt || new_opt
217
220
  if Autobuild.verbose
218
- Autobuild.message "forcing reconfiguration of #{name} (#{old_opt} != #{new_opt})"
221
+ Autobuild.message "forcing reconfiguration of #{name} "\
222
+ "(#{old_opt} != #{new_opt})"
219
223
  end
220
224
  FileUtils.rm_f configurestamp # to force reconfiguration
221
225
  end
@@ -240,16 +244,15 @@ def tool_program(tool)
240
244
  # In general, you should not need that.
241
245
  attr_accessor :force_config_status
242
246
 
243
- private
244
- def autodetect_needed_stages
247
+ private def autodetect_needed_stages
245
248
  # Autodetect autoconf/aclocal/automake
246
249
  #
247
250
  # Let the user disable the use of autoconf explicitely by using 'false'.
248
251
  # 'nil' means autodetection
249
252
  if using[:autoconf].nil?
250
- if File.file?(File.join(srcdir, 'configure.in')) || File.file?(File.join(srcdir, 'configure.ac'))
251
- using[:autoconf] = true
252
- end
253
+ has_configure_in = %w[configure.in configure.ac].
254
+ any? { |p| File.file?(File.join(srcdir, p)) }
255
+ using[:autoconf] = true if has_configure_in
253
256
  end
254
257
  using[:aclocal] = using[:autoconf] if using[:aclocal].nil?
255
258
  if using[:automake].nil?
@@ -261,7 +264,8 @@ def autodetect_needed_stages
261
264
  end
262
265
 
263
266
  if using[:autogen].nil?
264
- using[:autogen] = %w{autogen autogen.sh}.find { |f| File.exist?(File.join(srcdir, f)) }
267
+ using[:autogen] = %w[autogen autogen.sh]
268
+ .find { |f| File.exist?(File.join(srcdir, f)) }
265
269
  end
266
270
  end
267
271
 
@@ -270,21 +274,23 @@ def create_regen_target(confsource = nil)
270
274
  conffile = "#{srcdir}/configure"
271
275
  if confsource
272
276
  file conffile => confsource
273
- elsif confext = %w{.ac .in}.find { |ext| File.exist?("#{conffile}#{ext}") }
277
+ elsif (confext = %w[.ac .in].find { |ext| File.exist?("#{conffile}#{ext}") })
274
278
  file conffile => "#{conffile}#{confext}"
275
279
  elsif using[:autoconf]
276
- raise PackageException.new(self, 'prepare'), "neither configure.ac nor configure.in present in #{srcdir}"
280
+ raise PackageException.new(self, 'prepare'),
281
+ "neither configure.ac nor configure.in present in #{srcdir}"
277
282
  end
278
283
 
279
284
  file conffile do
280
285
  isolate_errors do
281
- progress_start "generating autotools for %s", :done_message => 'generated autotools for %s' do
286
+ progress_start "generating autotools for %s",
287
+ done_message: 'generated autotools for %s' do
282
288
  regen
283
289
  end
284
290
  end
285
291
  end
286
292
 
287
- return conffile
293
+ conffile
288
294
  end
289
295
 
290
296
  def regen
@@ -296,8 +302,9 @@ def regen
296
302
  run 'configure', File.expand_path(using[:autogen], srcdir),
297
303
  working_directory: srcdir
298
304
  else
299
- [ :aclocal, :autoconf, :autoheader, :automake ].each do |tool|
305
+ %i[aclocal autoconf autoheader automake].each do |tool|
300
306
  next unless using[tool]
307
+
301
308
  run 'configure', tool_program(tool), *send("#{tool}_flags"),
302
309
  working_directory: srcdir
303
310
  end
@@ -307,14 +314,13 @@ def regen
307
314
  # Configure the builddir directory before starting make
308
315
  def configure
309
316
  super do
310
- command = [ "#{srcdir}/configure"]
311
- if force_config_status
312
- command << "--no-create"
313
- end
317
+ command = ["#{srcdir}/configure"]
318
+ command << "--no-create" if force_config_status
314
319
  command << "--prefix=#{prefix}"
315
320
  command += configureflags.flatten
316
321
 
317
- progress_start "configuring autotools for %s", done_message: 'configured autotools for %s' do
322
+ progress_start "configuring autotools for %s",
323
+ done_message: 'configured autotools for %s' do
318
324
  run('configure', *command, working_directory: builddir)
319
325
  end
320
326
  end
@@ -323,10 +329,9 @@ def configure
323
329
  # Do the build in builddir
324
330
  def build
325
331
  in_dir(builddir) do
326
- progress_start "building %s [progress not available]", :done_message => 'built %s' do
327
- if force_config_status
328
- run('build', './config.status')
329
- end
332
+ progress_start "building %s [progress not available]",
333
+ done_message: 'built %s' do
334
+ run('build', './config.status') if force_config_status
330
335
 
331
336
  build_options = []
332
337
  if using_bear?
@@ -9,10 +9,18 @@ def self.cmake(options, &block)
9
9
  # Handler class to build CMake-based packages
10
10
  class CMake < Configurable
11
11
  class << self
12
- def builddir; @builddir || Configurable.builddir end
12
+ def builddir
13
+ @builddir || Configurable.builddir
14
+ end
15
+
13
16
  def builddir=(new)
14
- raise ConfigException, "absolute builddirs are not supported" if (Pathname.new(new).absolute?)
15
- raise ConfigException, "builddir must be non-nil and non-empty" if (new.nil? || new.empty?)
17
+ if Pathname.new(new).absolute?
18
+ raise ConfigException, "absolute builddirs are not supported"
19
+ end
20
+ if new.nil? || new.empty?
21
+ raise ConfigException, "builddir must be non-nil and non-empty"
22
+ end
23
+
16
24
  @builddir = new
17
25
  end
18
26
 
@@ -67,7 +75,7 @@ def all_defines
67
75
  # If true, always run cmake before make during the build
68
76
  attr_accessor :always_reconfigure
69
77
  # If true, we always remove the CMake cache before reconfiguring.
70
- #
78
+ #
71
79
  # See #full_reconfigures? for more details
72
80
  attr_writer :full_reconfigures
73
81
  # Sets a generator explicitely for this component. See #generator and
@@ -77,9 +85,7 @@ def all_defines
77
85
  # Makefiles. If not set for this package explicitely, it is using the
78
86
  # global value CMake.generator.
79
87
  def generator
80
- if @generator then @generator
81
- else CMake.generator
82
- end
88
+ @generator || CMake.generator
83
89
  end
84
90
 
85
91
  # If true, we always remove the CMake cache before reconfiguring. This
@@ -96,13 +102,19 @@ def full_reconfigures?
96
102
  end
97
103
  end
98
104
 
99
- def cmake_cache; File.join(builddir, "CMakeCache.txt") end
100
- def configurestamp; cmake_cache end
105
+ def cmake_cache
106
+ File.join(builddir, "CMakeCache.txt")
107
+ end
108
+
109
+ def configurestamp
110
+ cmake_cache
111
+ end
101
112
 
102
113
  def initialize(options)
103
114
  @defines = Hash.new
104
115
  super
105
- @delete_obsolete_files_in_prefix = self.class.delete_obsolete_files_in_prefix?
116
+ @delete_obsolete_files_in_prefix = self.class.
117
+ delete_obsolete_files_in_prefix?
106
118
  end
107
119
 
108
120
  # (see CMake.delete_obsolete_files_in_prefix?)
@@ -111,9 +123,7 @@ def delete_obsolete_files_in_prefix?
111
123
  end
112
124
 
113
125
  # (see CMake.delete_obsolete_files_in_prefix=)
114
- def delete_obsolete_files_in_prefix=(flag)
115
- @delete_obsolete_files_in_prefix = flag
116
- end
126
+ attr_writer :delete_obsolete_files_in_prefix
117
127
 
118
128
  @@defines = Hash.new
119
129
 
@@ -132,7 +142,6 @@ def self.define(name, value)
132
142
  end
133
143
  end
134
144
 
135
-
136
145
  def define(name, value)
137
146
  @defines[name] =
138
147
  if value.respond_to?(:to_str)
@@ -145,12 +154,12 @@ def define(name, value)
145
154
  end
146
155
 
147
156
  DOXYGEN_ACCEPTED_VARIABLES = {
148
- '@CMAKE_SOURCE_DIR@' => lambda { |pkg| pkg.srcdir },
149
- '@PROJECT_SOURCE_DIR@' => lambda { |pkg| pkg.srcdir },
150
- '@CMAKE_BINARY_DIR@' => lambda { |pkg| pkg.builddir },
151
- '@PROJECT_BINARY_DIR@' => lambda { |pkg| pkg.builddir },
152
- '@PROJECT_NAME@' => lambda { |pkg| pkg.name }
153
- }
157
+ '@CMAKE_SOURCE_DIR@' => ->(pkg) { pkg.srcdir },
158
+ '@PROJECT_SOURCE_DIR@' => ->(pkg) { pkg.srcdir },
159
+ '@CMAKE_BINARY_DIR@' => ->(pkg) { pkg.builddir },
160
+ '@PROJECT_BINARY_DIR@' => ->(pkg) { pkg.builddir },
161
+ '@PROJECT_NAME@' => ->(pkg) { pkg.name }
162
+ }.freeze
154
163
 
155
164
  class << self
156
165
  # Flag controlling whether autobuild should run doxygen itself or
@@ -197,7 +206,7 @@ def always_use_doc_target?
197
206
  # for a global control of that feature
198
207
  def always_use_doc_target?
199
208
  if @always_use_doc_target.nil?
200
- return CMake.always_use_doc_target?
209
+ CMake.always_use_doc_target?
201
210
  else
202
211
  @always_use_doc_target
203
212
  end
@@ -215,17 +224,14 @@ def always_use_doc_target?
215
224
  # This method returns true if the package can use the internal doxygen
216
225
  # mode and false otherwise
217
226
  def internal_doxygen_mode?
218
- if always_use_doc_target?
219
- return false
220
- end
227
+ return false if always_use_doc_target?
221
228
 
222
229
  doxyfile_in = File.join(srcdir, "Doxyfile.in")
223
- if !File.file?(doxyfile_in)
224
- return false
225
- end
230
+ return false unless File.file?(doxyfile_in)
231
+
226
232
  File.readlines(doxyfile_in).each do |line|
227
233
  matches = line.scan(/@[^@]+@/)
228
- if matches.any? { |str| !DOXYGEN_ACCEPTED_VARIABLES.has_key?(str) }
234
+ if matches.any? { |str| !DOXYGEN_ACCEPTED_VARIABLES.key?(str) }
229
235
  return false
230
236
  end
231
237
  end
@@ -245,11 +251,14 @@ def internal_doxygen_mode?
245
251
  # support cannot be used on this package
246
252
  def run_doxygen
247
253
  doxyfile_in = File.join(srcdir, "Doxyfile.in")
248
- if !File.file?(doxyfile_in)
249
- raise RuntimeError, "no Doxyfile.in in this package, cannot use the internal doxygen support"
254
+ unless File.file?(doxyfile_in)
255
+ raise "no Doxyfile.in in this package, "\
256
+ "cannot use the internal doxygen support"
250
257
  end
251
258
  doxyfile_data = File.readlines(doxyfile_in).map do |line|
252
- line.gsub(/@[^@]+@/) { |match| DOXYGEN_ACCEPTED_VARIABLES[match].call(self) }
259
+ line.gsub(/@[^@]+@/) do |match|
260
+ DOXYGEN_ACCEPTED_VARIABLES[match].call(self)
261
+ end
253
262
  end
254
263
  doxyfile = File.join(builddir, "Doxyfile")
255
264
  File.open(doxyfile, 'w') do |io|
@@ -296,7 +305,7 @@ def with_tests(target = 'test', &block)
296
305
  'YES' => 'ON',
297
306
  'OFF' => 'OFF',
298
307
  'NO' => 'OFF'
299
- }
308
+ }.freeze
300
309
  def equivalent_option_value?(old, new)
301
310
  if old == new
302
311
  true
@@ -331,7 +340,7 @@ def prefix_path
331
340
  raw = (dependencies.map { |pkg_name| Autobuild::Package[pkg_name].prefix } +
332
341
  CMake.prefix_path)
333
342
  raw.each do |path|
334
- if !seen.include?(path)
343
+ unless seen.include?(path)
335
344
  seen << path
336
345
  result << path
337
346
  end
@@ -348,17 +357,20 @@ def update_environment
348
357
 
349
358
  def defines_changed?(all_defines, cache_data)
350
359
  all_defines.any? do |name, value|
351
- if match = /^#{name}:\w+=(.*)$/.match(cache_data)
360
+ if (match = /^#{name}:\w+=(.*)$/.match(cache_data))
352
361
  old_value = match[1]
353
362
  end
354
363
 
355
364
  value = value.to_s
356
365
  if !old_value || !equivalent_option_value?(old_value, value)
357
366
  if Autobuild.debug
358
- message "%s: option '#{name}' changed value: '#{old_value}' => '#{value}'"
367
+ message "%s: option '#{name}' changed value: "\
368
+ "'#{old_value}' => '#{value}'"
359
369
  end
370
+
360
371
  if old_value
361
- message "%s: changed value of #{name} from #{old_value} to #{value}"
372
+ message "%s: changed value of #{name} "\
373
+ "from #{old_value} to #{value}"
362
374
  else
363
375
  message "%s: setting value of #{name} to #{value}"
364
376
  end
@@ -373,8 +385,8 @@ def prepare
373
385
  # but no Makefile.
374
386
  #
375
387
  # Delete the CMakeCache to force reconfiguration
376
- if !File.exist?( File.join(builddir, 'Makefile') )
377
- FileUtils.rm_f cmake_cache
388
+ unless File.exist?(File.join(builddir, 'Makefile'))
389
+ FileUtils.rm_f(cmake_cache)
378
390
  end
379
391
 
380
392
  doc_utility.source_ref_dir = builddir
@@ -396,29 +408,27 @@ def prepare
396
408
  def configure
397
409
  super do
398
410
  in_dir(builddir) do
399
- if !File.file?(File.join(srcdir, 'CMakeLists.txt'))
400
- raise ConfigException.new(self, 'configure'), "#{srcdir} contains no CMakeLists.txt file"
411
+ unless File.file?(File.join(srcdir, 'CMakeLists.txt'))
412
+ raise ConfigException.new(self, 'configure'),
413
+ "#{srcdir} contains no CMakeLists.txt file"
401
414
  end
402
415
 
403
- command = [ "cmake" ]
416
+ command = ["cmake"]
404
417
 
405
418
  if Autobuild.windows?
406
- command << '-G'
419
+ command << '-G'
407
420
  command << "MSYS Makefiles"
408
421
  end
409
422
 
410
423
  all_defines.each do |name, value|
411
424
  command << "-D#{name}=#{value}"
412
425
  end
413
- if generator
414
- command << Array(generator).map { |g| "-G#{g}" }
415
- end
426
+ command << Array(generator).map { |g| "-G#{g}" } if generator
416
427
  command << srcdir
417
-
418
- progress_start "configuring CMake for %s", :done_message => "configured CMake for %s" do
419
- if full_reconfigures?
420
- FileUtils.rm_f cmake_cache
421
- end
428
+
429
+ progress_start "configuring CMake for %s",
430
+ done_message: "configured CMake for %s" do
431
+ FileUtils.rm_f cmake_cache if full_reconfigures?
422
432
  run('configure', *command)
423
433
  end
424
434
  end
@@ -432,9 +442,7 @@ def show_make_messages?
432
442
  end
433
443
  end
434
444
 
435
- def show_make_messages=(value)
436
- @show_make_messages = value
437
- end
445
+ attr_writer :show_make_messages
438
446
 
439
447
  def self.show_make_messages?
440
448
  @show_make_messages
@@ -446,7 +454,7 @@ def self.show_make_messages=(value)
446
454
 
447
455
  # Do the build in builddir
448
456
  def build
449
- current_message = String.new
457
+ current_message = +""
450
458
  in_dir(builddir) do
451
459
  progress_start "building %s" do
452
460
  if always_reconfigure || !File.file?('Makefile')
@@ -459,9 +467,7 @@ def build
459
467
  if line =~ /\[\s*(\d+)%\]/
460
468
  progress "building %s (#{Integer($1)}%)"
461
469
  elsif line !~ /^(?:Generating|Linking|Scanning|Building|Built)/
462
- if line =~ /warning/
463
- warning_count += 1
464
- end
470
+ warning_count += 1 if line =~ /warning/
465
471
  if show_make_messages?
466
472
  current_message += line + "\n"
467
473
  needs_display = true
@@ -478,7 +484,8 @@ def build
478
484
  message "%s: #{l}", :magenta
479
485
  end
480
486
  if warning_count > 0
481
- progress_done "built %s #{Autoproj.color("(#{warning_count} warnings)", :bold)}"
487
+ msg_warning = Autoproj.color("(#{warning_count} warnings)", :bold)
488
+ progress_done "built %s #{msg_warning}"
482
489
  else
483
490
  progress_done "built %s"
484
491
  end
@@ -498,13 +505,12 @@ def build
498
505
  # in the prefix but not in CMake's install manifest will be removed.
499
506
  def install
500
507
  in_dir(builddir) do
501
- progress_start "installing %s", :done_message => 'installed %s' do
502
- run('install', Autobuild.tool(:make), "-j#{parallel_build_level}", 'install')
508
+ progress_start "installing %s", done_message: 'installed %s' do
509
+ run('install', Autobuild.tool(:make),
510
+ "-j#{parallel_build_level}", 'install')
503
511
  end
504
512
 
505
- if delete_obsolete_files_in_prefix?
506
- delete_obsolete_files
507
- end
513
+ delete_obsolete_files if delete_obsolete_files_in_prefix?
508
514
  end
509
515
  super
510
516
  end
@@ -520,7 +526,8 @@ def install
520
526
  def delete_obsolete_files
521
527
  # The expand_path is required to sanitize the paths, which can
522
528
  # contain e.g. double //
523
- manifest_contents = File.readlines(File.join(builddir, 'install_manifest.txt')).
529
+ cmake_install_manifest = File.join(builddir, 'install_manifest.txt')
530
+ manifest_contents = File.readlines(cmake_install_manifest).
524
531
  map { |p| File.expand_path(p.chomp) }.to_set
525
532
  logdir = self.logdir
526
533
  counter = 0
@@ -535,6 +542,11 @@ def delete_obsolete_files
535
542
  message "%s: removed #{counter} obsolete files from prefix (cmake)"
536
543
  end
537
544
  end
545
+
546
+ def self_fingerprint
547
+ return unless (base = super)
548
+ all_defines = self.class.defines.merge(self.defines).sort_by(&:first)
549
+ Digest::SHA1.hexdigest(base + all_defines.join(""))
550
+ end
538
551
  end
539
552
  end
540
-