autobuild 1.12.3 → 1.13.0.pre1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/autobuild.gemspec +2 -2
- data/lib/autobuild/config.rb +51 -51
- data/lib/autobuild/environment.rb +77 -25
- data/lib/autobuild/exceptions.rb +22 -1
- data/lib/autobuild/import/archive.rb +31 -31
- data/lib/autobuild/import/cvs.rb +13 -13
- data/lib/autobuild/import/darcs.rb +21 -21
- data/lib/autobuild/import/git.rb +55 -43
- data/lib/autobuild/import/hg.rb +1 -1
- data/lib/autobuild/import/svn.rb +8 -8
- data/lib/autobuild/importer.rb +4 -2
- data/lib/autobuild/mail_reporter.rb +9 -9
- data/lib/autobuild/package.rb +120 -119
- data/lib/autobuild/packages/autotools.rb +88 -86
- data/lib/autobuild/packages/cmake.rb +1 -1
- data/lib/autobuild/packages/dummy.rb +1 -1
- data/lib/autobuild/packages/genom.rb +43 -43
- data/lib/autobuild/packages/import.rb +6 -6
- data/lib/autobuild/packages/orogen.rb +7 -7
- data/lib/autobuild/packages/pkgconfig.rb +16 -16
- data/lib/autobuild/pkgconfig.rb +20 -20
- data/lib/autobuild/reporting.rb +0 -22
- data/lib/autobuild/subcommand.rb +6 -6
- data/lib/autobuild/timestamps.rb +5 -5
- data/lib/autobuild/tools.rb +7 -7
- data/lib/autobuild/version.rb +1 -1
- metadata +8 -20
@@ -2,25 +2,25 @@
|
|
2
2
|
|
3
3
|
module Autobuild
|
4
4
|
class InstalledPkgConfig < Package
|
5
|
-
|
6
|
-
|
5
|
+
attr_reader :pkgconfig
|
6
|
+
attr_reader :prefix
|
7
7
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
8
|
+
def initialize(name)
|
9
|
+
@pkgconfig = PkgConfig.new(name)
|
10
|
+
@prefix = @pkgconfig.prefix
|
11
|
+
super
|
12
|
+
end
|
13
13
|
|
14
|
-
|
15
|
-
|
16
|
-
|
14
|
+
def installstamp
|
15
|
+
std_stamp = super
|
16
|
+
return std_stamp if File.file?(std_stamp)
|
17
17
|
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
18
|
+
pcfile = File.join(pkgconfig.prefix, "lib", "pkgconfig", "#{name}.pc")
|
19
|
+
if !File.file?(pcfile)
|
20
|
+
raise "cannot find the .pc file for #{name}, tried #{pcfile}"
|
21
|
+
end
|
22
|
+
pcfile
|
23
|
+
end
|
24
24
|
end
|
25
25
|
def self.installed_pkgconfig(name, &block)
|
26
26
|
InstalledPkgConfig.new(name, &block)
|
data/lib/autobuild/pkgconfig.rb
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
# Access to information from pkg-config(1)
|
2
2
|
class PkgConfig
|
3
3
|
class NotFound < RuntimeError
|
4
|
-
|
5
|
-
|
6
|
-
|
4
|
+
attr_reader :name
|
5
|
+
def initialize(name); @name = name end
|
6
|
+
def to_s; "#{name} is not available to pkg-config" end
|
7
7
|
end
|
8
8
|
|
9
9
|
# The module name
|
@@ -14,30 +14,30 @@ def to_s; "#{name} is not available to pkg-config" end
|
|
14
14
|
# Create a PkgConfig object for the package +name+
|
15
15
|
# Raises PkgConfig::NotFound if the module does not exist
|
16
16
|
def initialize(name)
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
17
|
+
if !system("pkg-config --exists #{name}")
|
18
|
+
raise NotFound.new(name)
|
19
|
+
end
|
20
|
+
|
21
|
+
@name = name
|
22
|
+
@version = `pkg-config --modversion #{name}`.chomp.strip
|
23
|
+
@actions = Hash.new
|
24
|
+
@variables = Hash.new
|
25
25
|
end
|
26
26
|
|
27
27
|
ACTIONS = %w{cflags cflags-only-I cflags-only-other
|
28
|
-
|
28
|
+
libs libs-only-L libs-only-l libs-only-other static}
|
29
29
|
ACTIONS.each do |action|
|
30
|
-
|
31
|
-
|
32
|
-
|
30
|
+
define_method(action.gsub(/-/, '_')) do
|
31
|
+
@actions[action] ||= `pkg-config --#{action} #{name}`.chomp.strip
|
32
|
+
end
|
33
33
|
end
|
34
34
|
|
35
35
|
def method_missing(varname, *args, &proc)
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
36
|
+
if args.empty?
|
37
|
+
@variables[varname] ||= `pkg-config --variable=#{varname} #{name}`.chomp.strip
|
38
|
+
else
|
39
|
+
super(varname, *args, &proc)
|
40
|
+
end
|
41
41
|
end
|
42
42
|
end
|
43
43
|
|
data/lib/autobuild/reporting.rb
CHANGED
@@ -250,28 +250,6 @@ def self.display_progress
|
|
250
250
|
end
|
251
251
|
end
|
252
252
|
|
253
|
-
# The exception type that is used to report multiple errors that occured
|
254
|
-
# when ignore_errors is set
|
255
|
-
class CompositeException < Autobuild::Exception
|
256
|
-
# The array of exception objects representing all the errors that
|
257
|
-
# occured during the build
|
258
|
-
attr_reader :original_errors
|
259
|
-
|
260
|
-
def initialize(original_errors)
|
261
|
-
@original_errors = original_errors
|
262
|
-
end
|
263
|
-
|
264
|
-
def mail?; true end
|
265
|
-
|
266
|
-
def to_s
|
267
|
-
result = ["#{original_errors.size} errors occured"]
|
268
|
-
original_errors.each_with_index do |e, i|
|
269
|
-
result << "(#{i}) #{e.to_s}"
|
270
|
-
end
|
271
|
-
result.join("\n")
|
272
|
-
end
|
273
|
-
end
|
274
|
-
|
275
253
|
## The reporting module provides the framework # to run commands in
|
276
254
|
# autobuild and report errors # to the user
|
277
255
|
#
|
data/lib/autobuild/subcommand.rb
CHANGED
@@ -81,7 +81,7 @@ def self.autodetect_processor_count
|
|
81
81
|
if @processor_count
|
82
82
|
return @processor_count
|
83
83
|
end
|
84
|
-
|
84
|
+
|
85
85
|
if File.file?('/proc/cpuinfo')
|
86
86
|
cpuinfo = File.readlines('/proc/cpuinfo')
|
87
87
|
physical_ids, core_count, processor_ids = [], [], []
|
@@ -252,9 +252,9 @@ def self.run(target, phase, *command)
|
|
252
252
|
FileUtils.mkdir_p File.dirname(logname)
|
253
253
|
end
|
254
254
|
|
255
|
-
|
256
|
-
|
257
|
-
|
255
|
+
if Autobuild.verbose
|
256
|
+
Autobuild.message "#{target_name}: running #{command.join(" ")}\n (output goes to #{logname})"
|
257
|
+
end
|
258
258
|
|
259
259
|
open_flag = if Autobuild.keep_oldlogs then 'a'
|
260
260
|
elsif Autobuild.registered_logfile?(logname) then 'a'
|
@@ -281,7 +281,7 @@ def self.run(target, phase, *command)
|
|
281
281
|
logfile.puts
|
282
282
|
logfile.puts "#{Time.now}: running"
|
283
283
|
logfile.puts " #{command.join(" ")}"
|
284
|
-
|
284
|
+
logfile.puts "with environment:"
|
285
285
|
env.keys.sort.each do |key|
|
286
286
|
if value = env[key]
|
287
287
|
logfile.puts " '#{key}'='#{value}'"
|
@@ -290,7 +290,7 @@ def self.run(target, phase, *command)
|
|
290
290
|
logfile.puts
|
291
291
|
logfile.puts "#{Time.now}: running"
|
292
292
|
logfile.puts " #{command.join(" ")}"
|
293
|
-
|
293
|
+
logfile.flush
|
294
294
|
logfile.sync = true
|
295
295
|
|
296
296
|
if !input_streams.empty?
|
data/lib/autobuild/timestamps.rb
CHANGED
@@ -58,11 +58,11 @@ class SourceTreeTask < Rake::Task
|
|
58
58
|
attr_reader :newest_file
|
59
59
|
attr_reader :newest_time
|
60
60
|
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
61
|
+
def initialize(*args, &block)
|
62
|
+
@exclude = Autobuild.ignored_files.dup
|
63
|
+
super
|
64
|
+
end
|
65
|
+
|
66
66
|
def timestamp
|
67
67
|
if @newest_time
|
68
68
|
return @newest_time
|
data/lib/autobuild/tools.rb
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
module Autobuild
|
2
2
|
class << self
|
3
|
-
|
3
|
+
# Configure the programs used by different packages
|
4
4
|
attr_reader :programs
|
5
|
-
|
5
|
+
# A cache of entries in programs to their resolved full path
|
6
6
|
#
|
7
7
|
# @return [{String=>[String,String,String]}] the triplet (full path,
|
8
8
|
# tool name, value of ENV['PATH']). The last two values are used to
|
@@ -12,11 +12,11 @@ class << self
|
|
12
12
|
attr_reader :programs_in_path
|
13
13
|
|
14
14
|
# Get a given program, using its name as default value. For
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
15
|
+
# instance
|
16
|
+
# tool('automake')
|
17
|
+
# will return 'automake' unless the autobuild script defined
|
18
|
+
# another automake program in Autobuild.programs by doing
|
19
|
+
# Autobuild.programs['automake'] = 'automake1.9'
|
20
20
|
def tool(name)
|
21
21
|
programs[name.to_sym] || programs[name.to_s] || name.to_s
|
22
22
|
end
|
data/lib/autobuild/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: autobuild
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.13.0.pre1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sylvain Joyeux
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-03-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -19,10 +19,7 @@ dependencies:
|
|
19
19
|
version: '12.0'
|
20
20
|
- - ">="
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version: 12.
|
23
|
-
- - "<"
|
24
|
-
- !ruby/object:Gem::Version
|
25
|
-
version: 12.1.0
|
22
|
+
version: 12.3.0
|
26
23
|
type: :runtime
|
27
24
|
prerelease: false
|
28
25
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -32,10 +29,7 @@ dependencies:
|
|
32
29
|
version: '12.0'
|
33
30
|
- - ">="
|
34
31
|
- !ruby/object:Gem::Version
|
35
|
-
version: 12.
|
36
|
-
- - "<"
|
37
|
-
- !ruby/object:Gem::Version
|
38
|
-
version: 12.1.0
|
32
|
+
version: 12.3.0
|
39
33
|
- !ruby/object:Gem::Dependency
|
40
34
|
name: utilrb
|
41
35
|
requirement: !ruby/object:Gem::Requirement
|
@@ -62,20 +56,14 @@ dependencies:
|
|
62
56
|
requirements:
|
63
57
|
- - "~>"
|
64
58
|
- !ruby/object:Gem::Version
|
65
|
-
version: 0.
|
66
|
-
- - ">="
|
67
|
-
- !ruby/object:Gem::Version
|
68
|
-
version: 0.12.0
|
59
|
+
version: 0.15.0
|
69
60
|
type: :runtime
|
70
61
|
prerelease: false
|
71
62
|
version_requirements: !ruby/object:Gem::Requirement
|
72
63
|
requirements:
|
73
64
|
- - "~>"
|
74
65
|
- !ruby/object:Gem::Version
|
75
|
-
version: 0.
|
76
|
-
- - ">="
|
77
|
-
- !ruby/object:Gem::Version
|
78
|
-
version: 0.12.0
|
66
|
+
version: 0.15.0
|
79
67
|
- !ruby/object:Gem::Dependency
|
80
68
|
name: pastel
|
81
69
|
requirement: !ruby/object:Gem::Requirement
|
@@ -237,9 +225,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
237
225
|
version: 1.9.3
|
238
226
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
239
227
|
requirements:
|
240
|
-
- - "
|
228
|
+
- - ">"
|
241
229
|
- !ruby/object:Gem::Version
|
242
|
-
version:
|
230
|
+
version: 1.3.1
|
243
231
|
requirements: []
|
244
232
|
rubyforge_project:
|
245
233
|
rubygems_version: 2.5.1
|