autobuild 1.4.0 → 1.4.1
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +1 -1
- data/lib/autobuild.rb +1 -1
- data/lib/autobuild/environment.rb +1 -1
- data/lib/autobuild/package.rb +2 -2
- data/lib/autobuild/packages/orogen.rb +43 -19
- metadata +1 -1
data/Rakefile
CHANGED
data/lib/autobuild.rb
CHANGED
data/lib/autobuild/package.rb
CHANGED
@@ -255,7 +255,7 @@ module Autobuild
|
|
255
255
|
# and installed.
|
256
256
|
def depends_on(*packages)
|
257
257
|
packages.each do |p|
|
258
|
-
p = p.
|
258
|
+
p = p.to_str
|
259
259
|
next if p == name
|
260
260
|
unless Package[p]
|
261
261
|
raise ConfigException.new(name), "package #{p} not defined"
|
@@ -271,7 +271,7 @@ module Autobuild
|
|
271
271
|
# listed in +packages+ are aliases for this package.
|
272
272
|
def provides(*packages)
|
273
273
|
packages.each do |p|
|
274
|
-
p = p.
|
274
|
+
p = p.to_str
|
275
275
|
next if p == name
|
276
276
|
@@provides[p] = self
|
277
277
|
task p => name
|
@@ -49,23 +49,16 @@ module Autobuild
|
|
49
49
|
end
|
50
50
|
end
|
51
51
|
|
52
|
-
def self.orocos_target
|
53
|
-
user_target = ENV['OROCOS_TARGET']
|
54
|
-
if @orocos_target
|
55
|
-
@orocos_target.dup
|
56
|
-
elsif user_target && !user_target.empty?
|
57
|
-
user_target
|
58
|
-
else
|
59
|
-
'gnulinux'
|
60
|
-
end
|
61
|
-
end
|
62
|
-
|
63
52
|
attr_reader :project_name, :dependencies, :provides
|
64
|
-
def self.load(file)
|
65
|
-
FakeOrogenEnvironment.new.load(file)
|
53
|
+
def self.load(pkg, file)
|
54
|
+
FakeOrogenEnvironment.new(pkg).load(file)
|
66
55
|
end
|
67
56
|
|
68
|
-
|
57
|
+
# The Autobuild::Orogen instance we are working for
|
58
|
+
attr_reader :pkg
|
59
|
+
|
60
|
+
def initialize(pkg)
|
61
|
+
@pkg = pkg
|
69
62
|
@dependencies = Array.new
|
70
63
|
@provides = Array.new
|
71
64
|
end
|
@@ -84,12 +77,12 @@ module Autobuild
|
|
84
77
|
nil
|
85
78
|
end
|
86
79
|
def using_toolkit(*names)
|
87
|
-
names = names.map { |n| "#{n}-toolkit-#{
|
80
|
+
names = names.map { |n| "#{n}-toolkit-#{pkg.orocos_target}" }
|
88
81
|
@dependencies.concat(names)
|
89
82
|
nil
|
90
83
|
end
|
91
84
|
def using_task_library(*names)
|
92
|
-
names = names.map { |n| "#{n}-tasks-#{
|
85
|
+
names = names.map { |n| "#{n}-tasks-#{pkg.orocos_target}" }
|
93
86
|
@dependencies.concat(names)
|
94
87
|
nil
|
95
88
|
end
|
@@ -136,6 +129,27 @@ module Autobuild
|
|
136
129
|
attr_accessor :corba
|
137
130
|
end
|
138
131
|
|
132
|
+
@orocos_target = nil
|
133
|
+
def self.orocos_target
|
134
|
+
user_target = ENV['OROCOS_TARGET']
|
135
|
+
if @orocos_target
|
136
|
+
@orocos_target.dup
|
137
|
+
elsif user_target && !user_target.empty?
|
138
|
+
user_target
|
139
|
+
else
|
140
|
+
'gnulinux'
|
141
|
+
end
|
142
|
+
end
|
143
|
+
|
144
|
+
attr_writer :orocos_target
|
145
|
+
def orocos_target
|
146
|
+
if @orocos_target.nil?
|
147
|
+
Orogen.orocos_target
|
148
|
+
else
|
149
|
+
@orocos_target
|
150
|
+
end
|
151
|
+
end
|
152
|
+
|
139
153
|
attr_reader :orogen_spec
|
140
154
|
|
141
155
|
attr_writer :corba
|
@@ -148,6 +162,7 @@ module Autobuild
|
|
148
162
|
@corba = Orogen.corba
|
149
163
|
super
|
150
164
|
|
165
|
+
@orocos_target = nil
|
151
166
|
@orogen_file ||= "#{File.basename(name)}.orogen"
|
152
167
|
end
|
153
168
|
|
@@ -162,9 +177,9 @@ module Autobuild
|
|
162
177
|
def import
|
163
178
|
super
|
164
179
|
|
165
|
-
@orogen_spec = FakeOrogenEnvironment.load(File.join(srcdir, orogen_file))
|
166
|
-
provides "pkgconfig/#{orogen_spec.project_name}-toolkit-#{
|
167
|
-
provides "pkgconfig/#{orogen_spec.project_name}-tasks-#{
|
180
|
+
@orogen_spec = FakeOrogenEnvironment.load(self, File.join(srcdir, orogen_file))
|
181
|
+
provides "pkgconfig/#{orogen_spec.project_name}-toolkit-#{orocos_target}"
|
182
|
+
provides "pkgconfig/#{orogen_spec.project_name}-tasks-#{orocos_target}"
|
168
183
|
orogen_spec.provides.each do |name|
|
169
184
|
provides name
|
170
185
|
end
|
@@ -173,6 +188,15 @@ module Autobuild
|
|
173
188
|
def prepare
|
174
189
|
super
|
175
190
|
|
191
|
+
# Check if someone provides the pkgconfig/orocos-rtt-TARGET package,
|
192
|
+
# and if so add it into our dependency list
|
193
|
+
if rtt = Autobuild::Package["pkgconfig/orocos-rtt-#{orocos_target}"]
|
194
|
+
if Autobuild.verbose
|
195
|
+
STDERR.puts "orogen: found #{rtt.name} which provides the RTT"
|
196
|
+
end
|
197
|
+
depends_on rtt.name
|
198
|
+
end
|
199
|
+
|
176
200
|
# If required, load the component's specification and add
|
177
201
|
# dependencies based on the orogen specification.
|
178
202
|
orogen_spec.dependencies.each do |pkg_name|
|