autobuild 1.4.9 → 1.5.0

Sign up to get free protection for your applications and to get access to all the features.
data/Changes.txt CHANGED
@@ -1,3 +1,17 @@
1
+ == Version 1.5.0
2
+ * now Ruby1.9 compatibility fixes, can be run with ruby1.9.1 on Debian
3
+ * properly runs if the ruby interpreter is not called 'ruby', as ruby1.9.1
4
+ on Debian
5
+ * fix some issues with the usage of #depends_on *before* Package#srcdir #logdir
6
+ and #prefix were set. It fixes an autoproj bug in case the autobuild files use
7
+ #depends_on
8
+ * the archive importer now properly handles interruptions
9
+ * the archive importer now properly autodetects file names if the URLs contains '?'
10
+ * fixed the importer package type
11
+ * fixed some rare issues with internal dependency definitions. This bug was
12
+ usually manifesting itself with rake exceptions whose message were "do not
13
+ know how to build <package name>-stamp"
14
+
1
15
  == Version 1.4.9
2
16
  * quickfix an issue related to a discrepancy between the definition of the
3
17
  installstamp and the definition of the log dir.
data/lib/autobuild.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  module Autobuild
2
- VERSION = "1.4.9" unless defined? Autobuild::VERSION
2
+ VERSION = "1.5.0" unless defined? Autobuild::VERSION
3
3
  end
4
4
 
5
5
  require 'autobuild/config'
@@ -143,33 +143,33 @@ module Autobuild
143
143
  def commandline(args)
144
144
  parser = OptionParser.new do |opts|
145
145
  opts.separator "Path specification"
146
- opts.on("--srcdir PATH", "sources are installed in PATH") do |@srcdir| end
147
- opts.on("--prefix PATH", "built packages are installed in PATH") do |@prefix| end
148
- opts.on("--logdir PATH", "logs are saved in PATH (default: <prefix>/autobuild)") do |@logdir| end
146
+ opts.on("--srcdir PATH", "sources are installed in PATH") do |v| Autobuild.srcdir=v end
147
+ opts.on("--prefix PATH", "built packages are installed in PATH") do |v| Autobuild.prefix = v end
148
+ opts.on("--logdir PATH", "logs are saved in PATH (default: <prefix>/autobuild)") do |v| Autobuild.logdir = v end
149
149
 
150
150
  opts.separator ""
151
151
  opts.separator "General behaviour"
152
- opts.on('--nice NICE', Integer, 'nice the subprocesses to the given value') do |@nice| end
152
+ opts.on('--nice NICE', Integer, 'nice the subprocesses to the given value') do |v| Autobuild.nice = v end
153
153
  opts.on("-h", "--help", "Show this message") do
154
154
  puts opts
155
155
  exit
156
156
  end
157
157
  if defined? Daemons
158
- opts.on("--[no-]daemon", "go into daemon mode") do |@daemonize| end
158
+ opts.on("--[no-]daemon", "go into daemon mode") do |v| Autobuild.daemonize = v end
159
159
  end
160
- opts.on("--no-update", "update already checked-out sources") do |@do_update| end
161
- opts.on("--no-build", "only prepare packages, do not build them") do |@do_build| end
162
- opts.on("--forced-build", "force the trigger of all the build commands") do |@do_forced_build| end
163
- opts.on("--rebuild", "clean and rebuild") do |@do_forced_build| end
164
- opts.on("--only-doc", "only generate documentation") do |@only_doc| end
165
- opts.on("--no-doc", "don't generate documentation") do |@do_doc| end
166
- opts.on("--doc-errors", "treat documentation failure as error") do |@doc_errors| end
160
+ opts.on("--no-update", "update already checked-out sources") do |v| Autobuild.do_update = v end
161
+ opts.on("--no-build", "only prepare packages, do not build them") do |v| Autobuild.do_build = v end
162
+ opts.on("--forced-build", "force the trigger of all the build commands") do |v| Autobuild.do_forced_build = v end
163
+ opts.on("--rebuild", "clean and rebuild") do |v| Autobuild.do_forced_build = v end
164
+ opts.on("--only-doc", "only generate documentation") do |v| Autobuild.only_doc = v end
165
+ opts.on("--no-doc", "don't generate documentation") do |v| Autobuild.do_doc = v end
166
+ opts.on("--doc-errors", "treat documentation failure as error") do |v| Autobuild.doc_errors = v end
167
167
 
168
168
  opts.separator ""
169
169
  opts.separator "Program output"
170
- opts.on("--[no-]verbose", "display output of commands on stdout") do |@verbose| end
171
- opts.on("--[no-]debug", "debug information (for debugging purposes)") do |@debug| end
172
- opts.on("--keep-oldlogs", "old logs will be kept, new program output being appended") do |@keep_oldlogs| end
170
+ opts.on("--[no-]verbose", "display output of commands on stdout") do |v| Autobuild.verbose = v end
171
+ opts.on("--[no-]debug", "debug information (for debugging purposes)") do |v| Autobuild.debug = v end
172
+ opts.on("--keep-oldlogs", "old logs will be kept, new program output being appended") do |v| Autobuild.keep_oldlogs = v end
173
173
 
174
174
  opts.separator ""
175
175
  opts.separator "Mail reports"
@@ -37,7 +37,7 @@ module Autobuild
37
37
  @builddir = new
38
38
  end
39
39
  # Returns the absolute builddir
40
- def builddir; File.expand_path(@builddir || Configurable.builddir, srcdir) end
40
+ def builddir; File.expand_path(@builddir || self.class.builddir, srcdir) end
41
41
 
42
42
  # Build stamp
43
43
  # This returns the name of the file which marks when the package has been
@@ -56,17 +56,12 @@ module Autobuild
56
56
  end
57
57
 
58
58
  def prepare_for_rebuild
59
+ prepare_for_forced_build
59
60
  if File.exists?(builddir) && builddir != srcdir
60
61
  FileUtils.rm_rf builddir
61
62
  end
62
63
  end
63
64
 
64
- def depends_on(*packages)
65
- super
66
- stamps = packages.collect { |p| Package[p.to_s].installstamp }
67
- file configurestamp => stamps
68
- end
69
-
70
65
  def ensure_dependencies_installed
71
66
  dependencies.each do |pkg|
72
67
  Rake::Task[Package[pkg].installstamp].invoke
@@ -74,33 +69,39 @@ module Autobuild
74
69
  end
75
70
 
76
71
  def prepare
72
+ Autobuild.source_tree srcdir do |pkg|
73
+ pkg.exclude << Regexp.new("^#{Regexp.quote(builddir)}")
74
+ pkg.exclude << Regexp.new("^#{doc_dir}") if doc_dir
75
+ end
76
+
77
77
  super
78
78
 
79
- file configurestamp do
79
+ stamps = dependencies.map { |pkg| Autobuild::Package[pkg].installstamp }
80
+ file configurestamp => stamps do
80
81
  ensure_dependencies_installed
81
82
  configure
82
83
  end
83
84
  task "#{name}-prepare" => configurestamp
84
85
 
85
- Autobuild.source_tree srcdir do |pkg|
86
- pkg.exclude << Regexp.new("^#{Regexp.quote(builddir)}")
87
- pkg.exclude << Regexp.new("^#{doc_dir}") if doc_dir
88
- end
89
-
90
- file buildstamp => [ srcdir, configurestamp ] do
86
+ file buildstamp => [ srcdir, configurestamp ] do
91
87
  ensure_dependencies_installed
92
88
  build
93
89
  end
94
90
  task "#{name}-build" => buildstamp
95
91
 
96
- file installstamp => buildstamp do
97
- install
98
- Autobuild.update_environment(prefix)
99
- end
92
+ file installstamp => buildstamp
93
+ Autobuild.update_environment(prefix)
100
94
  end
101
95
 
102
96
  # Configure the builddir directory before starting make
103
97
  def configure
98
+ if File.exists?(builddir) && !File.directory?(builddir)
99
+ raise ConfigException, "#{builddir} already exists but is not a directory"
100
+ end
101
+ FileUtils.mkdir_p builddir if !File.directory?(builddir)
102
+
103
+ yield
104
+
104
105
  Autobuild.touch_stamp(configurestamp)
105
106
  end
106
107
 
@@ -108,9 +109,9 @@ module Autobuild
108
109
  def build
109
110
  end
110
111
 
111
- # Install the result in prefix
112
112
  def install
113
- Autobuild.touch_stamp(installstamp)
113
+ super
114
+ Autobuild.update_environment(prefix)
114
115
  end
115
116
  end
116
117
  end
@@ -83,9 +83,11 @@ module Autobuild
83
83
  end
84
84
 
85
85
  require 'rbconfig'
86
- ruby_arch = File.basename(Config::CONFIG['archdir'])
87
- env_add_path("RUBYLIB", "#{newprefix}/lib/ruby/1.8")
88
- env_add_path("RUBYLIB", "#{newprefix}/lib/ruby/1.8/#{ruby_arch}")
86
+ ruby_arch = File.basename(Config::CONFIG['archdir'])
87
+ candidates = %w{rubylibdir archdir sitelibdir sitearchdir vendorlibdir vendorarchdir}.
88
+ map { |key| Config::CONFIG[key] }.
89
+ map { |path| path.gsub(/.*lib\/(\w*ruby\/)/, '\\1') }.
90
+ each { |subdir| env_add_path("RUBYLIB", "#{newprefix}/lib/#{subdir}") }
89
91
  end
90
92
  end
91
93
 
@@ -27,7 +27,7 @@ module Autobuild
27
27
  case filename
28
28
  when /\.zip$/; Zip
29
29
  when /\.tar$/; Plain
30
- when /\.tar\.gz|\.tgz$/; Gzip
30
+ when /\.tar\.gz$|\.tgz$/; Gzip
31
31
  when /\.bz2$/; Bzip
32
32
  else
33
33
  raise "unknown file type '#{filename}'"
@@ -67,7 +67,13 @@ module Autobuild
67
67
 
68
68
  if do_update
69
69
  FileUtils.mkdir_p(cachedir)
70
- Subprocess.run(package, :import, Autobuild.tool('wget'), '-q', '-P', cachedir, @url)
70
+ begin
71
+ Subprocess.run(package, :import, Autobuild.tool('wget'), '-q', '-P', cachedir, @url, '-O', "#{cachefile}.partial")
72
+ rescue Exception
73
+ FileUtils.rm_f "#{cachefile}.partial"
74
+ raise
75
+ end
76
+ FileUtils.mv "#{cachefile}.partial", cachefile
71
77
  true
72
78
  end
73
79
  end
@@ -106,11 +112,12 @@ module Autobuild
106
112
  @url = URI.parse(url)
107
113
  raise ConfigException, "invalid URL #{@url}" unless VALID_URI_SCHEMES.include?(@url.scheme)
108
114
 
109
- @mode = options[:mode] || ArchiveImporter.filename_to_mode(options[:filename] || url)
115
+ filename = options[:filename] || File.basename(url).gsub(/\?.*/, '')
116
+ @mode = options[:mode] || ArchiveImporter.filename_to_mode(filename)
110
117
  if @url.scheme == 'file'
111
118
  @cachefile = @url.path
112
119
  else
113
- @cachefile = File.join(cachedir, @options[:filename] || File.basename(url).gsub(/\?.*/, ''))
120
+ @cachefile = File.join(cachedir, filename)
114
121
  end
115
122
  end
116
123
 
@@ -4,7 +4,8 @@ require 'autobuild/exceptions'
4
4
  # This class is the base class for objects that are used to get the source from
5
5
  # various RCS into the package source directory. A list of patches to apply
6
6
  # after the import can be given in the +:patches+ option.
7
- class Autobuild::Importer
7
+ module Autobuild
8
+ class Importer
8
9
  # Instances of the Importer::Status class represent the status of a current
9
10
  # checkout w.r.t. the remote repository.
10
11
  class Status
@@ -44,7 +45,13 @@ class Autobuild::Importer
44
45
  def initialize(options); @options = options end
45
46
 
46
47
  def patches
47
- @options[:patches] ||= []
48
+ if @options[:patches].respond_to?(:to_ary)
49
+ @options[:patches]
50
+ elsif !@options[:patches]
51
+ []
52
+ else
53
+ [@options[:patches]]
54
+ end
48
55
  end
49
56
 
50
57
  # Performs the import of +package+
@@ -126,4 +133,5 @@ class Autobuild::Importer
126
133
  end
127
134
  end
128
135
  end
136
+ end
129
137
 
@@ -125,7 +125,7 @@ module Autobuild
125
125
  end
126
126
  task :default => name
127
127
 
128
- # The dependencies will be declared in the prepare phase, so save
128
+ # The dependencies will be declared in the import phase, so save
129
129
  # them there for now
130
130
  @spec_dependencies = depends
131
131
  end
@@ -147,22 +147,25 @@ module Autobuild
147
147
  # Call the importer if there is one. Autodetection of "provides" should
148
148
  # be done there as well. See the documentation of Autobuild::Package for
149
149
  # more information.
150
- def import; @importer.import(self) if @importer end
150
+ def import
151
+ @importer.import(self) if @importer
152
+
153
+ # Add the dependencies declared in spec
154
+ depends_on *@spec_dependencies if @spec_dependencies
155
+ end
156
+
151
157
  # Create all the dependencies required to reconfigure and/or rebuild the
152
158
  # package when required. The package's build target is called
153
159
  # "package_name-build".
154
160
  def prepare
155
161
  super if defined? super
156
162
 
157
- task "#{name}-build" => installstamp
158
- # Declare the installation stampfile
159
- file installstamp do
160
- Dir.chdir(srcdir) do
161
- Autobuild.apply_post_install(name, @post_install)
162
- end
163
+ stamps = dependencies.map { |p| Package[p].installstamp }
164
+
165
+ file installstamp => stamps do
166
+ install
163
167
  end
164
- # Add dependencies declared in spec
165
- depends_on *@spec_dependencies if @spec_dependencies
168
+ task "#{name}-build" => installstamp
166
169
 
167
170
  Autobuild.update_environment prefix
168
171
  end
@@ -183,6 +186,18 @@ module Autobuild
183
186
  Autobuild.progress_value(value)
184
187
  end
185
188
 
189
+ # Install the result in prefix
190
+ def install
191
+ Dir.chdir(srcdir) do
192
+ Autobuild.apply_post_install(name, @post_install)
193
+ end
194
+ Autobuild.touch_stamp(installstamp)
195
+ end
196
+
197
+ def run(*args, &block)
198
+ Autobuild::Subprocess.run(self, *args, &block)
199
+ end
200
+
186
201
  # Directory in which the documentation target will have generated the
187
202
  # documentation (if any). The interpretation of relative directories
188
203
  # is package-specific. The default implementation interpret them
@@ -279,7 +294,6 @@ module Autobuild
279
294
  unless Package[p]
280
295
  raise ConfigException.new(name), "package #{p} not defined"
281
296
  end
282
- file installstamp => Package[p].installstamp
283
297
  task "#{name}-import" => "#{p}-import"
284
298
  task "#{name}-prepare" => "#{p}-prepare"
285
299
  @dependencies << p
@@ -21,31 +21,13 @@ module Autobuild
21
21
  #
22
22
  # To override this default behaviour on a per-package basis, use Autotools#use
23
23
  #
24
- class Autotools < Package
24
+ class Autotools < Configurable
25
25
  attr_accessor :using
26
26
  attr_accessor :configureflags
27
- class << self
28
- attr_reader :builddir
29
- def builddir=(new)
30
- raise ConfigException, "absolute builddirs are not supported" if (Pathname.new(new).absolute?)
31
- raise ConfigException, "builddir must be non-nil and non-empty" if (new.nil? || new.empty?)
32
- @builddir = new
33
- end
34
- end
27
+
35
28
  @builddir = 'build'
36
29
 
37
- def builddir=(new)
38
- raise ConfigException, "absolute builddirs are not supported" if (Pathname.new(new).absolute?)
39
- raise ConfigException, "builddir must be non-empty" if new.empty?
40
- @builddir = new
41
- end
42
- # Returns the absolute builddir
43
- def builddir; File.expand_path(@builddir || Autotools.builddir, srcdir) end
44
-
45
- # Build stamp
46
- # This returns the name of the file which marks when the package has been
47
- # successfully built for the last time. The path is absolute
48
- def buildstamp; "#{builddir}/#{STAMPFILE}" end
30
+ def configurestamp; "#{builddir}/config.status" end
49
31
 
50
32
  def initialize(options)
51
33
  @using = Hash.new
@@ -54,10 +36,6 @@ module Autobuild
54
36
  super
55
37
  end
56
38
 
57
- def install_doc(relative_to = builddir)
58
- super(relative_to)
59
- end
60
-
61
39
  # Declare that the given target can be used to generate documentation
62
40
  def with_doc(target = 'doc')
63
41
  doc_task do
@@ -107,30 +85,17 @@ module Autobuild
107
85
  nil
108
86
  end
109
87
 
110
- def depends_on(*packages)
111
- super
112
- stamps = packages.collect { |p| Package[p.to_s].installstamp }
113
- file "#{builddir}/config.status" => stamps
114
- end
115
-
116
- def ensure_dependencies_installed
117
- dependencies.each do |pkg|
118
- Rake::Task[Package[pkg].installstamp].invoke
119
- end
120
- end
121
-
122
88
  def prepare
123
89
  super
124
90
 
125
- configureflags.flatten!
126
-
127
91
  # Check if config.status has been generated with the
128
92
  # same options than the ones in configureflags
129
- config_status = "#{builddir}/config.status"
130
-
93
+ #
94
+ # If it is not the case, remove it to force reconfiguration
95
+ configureflags.flatten!
131
96
  force_reconfigure = false
132
- if File.exists?(config_status)
133
- output = IO.popen("#{config_status} --version").readlines.grep(/with options/).first.chomp
97
+ if File.exists?(configurestamp)
98
+ output = IO.popen("#{configurestamp} --version").readlines.grep(/with options/).first.chomp
134
99
  raise "invalid output of config.status --version" unless output =~ /with options "(.*)"$/
135
100
  options = Shellwords.shellwords($1)
136
101
 
@@ -139,34 +104,17 @@ module Autobuild
139
104
  old_opt = options.find { |o| !testflags.include?(o) }
140
105
  new_opt = testflags.find { |o| !options.include?(o) }
141
106
  if old_opt || new_opt
142
- FileUtils.rm_f config_status # to force reconfiguration
107
+ FileUtils.rm_f configurestamp # to force reconfiguration
143
108
  end
144
109
  end
145
110
 
146
- file config_status => regen do
147
- ensure_dependencies_installed
148
- configure
149
- end
150
-
151
- Autobuild.source_tree srcdir do |pkg|
152
- pkg.exclude << Regexp.new("^#{Regexp.quote(builddir)}")
153
- end
154
- file buildstamp => [ srcdir, "#{builddir}/config.status" ] do
155
- ensure_dependencies_installed
156
- build
157
- end
158
- task "#{name}-build" => installstamp
159
-
160
- file installstamp => buildstamp do
161
- install
162
- end
163
-
164
- Autobuild.update_environment(prefix)
111
+ regen_target = create_regen_target
112
+ file configurestamp => regen_target
165
113
  end
166
114
 
167
115
  private
168
116
  # Adds a target to rebuild the autotools environment
169
- def regen(confsource = nil)
117
+ def create_regen_target(confsource = nil)
170
118
  conffile = "#{srcdir}/configure"
171
119
  if confsource
172
120
  file conffile => confsource
@@ -206,6 +154,13 @@ module Autobuild
206
154
  Subprocess.run(self, 'configure', tool_program)
207
155
  end
208
156
  end
157
+
158
+ if using[:libtool].nil?
159
+ using[:libtool] = File.exists?(File.join(srcdir, 'ltmain.sh'))
160
+ end
161
+ if using[:libtool]
162
+ Subprocess.run(self, 'configure', Autobuild.tool('libtoolize'), '--copy')
163
+ end
209
164
  end
210
165
  end
211
166
  end
@@ -215,18 +170,15 @@ module Autobuild
215
170
 
216
171
  # Configure the builddir directory before starting make
217
172
  def configure
218
- if File.exists?(builddir) && !File.directory?(builddir)
219
- raise ConfigException, "#{builddir} already exists but is not a directory"
173
+ super do
174
+ Dir.chdir(builddir) do
175
+ command = [ "#{srcdir}/configure", "--no-create", "--prefix=#{prefix}" ]
176
+ command += Array[*configureflags]
177
+
178
+ progress "configuring build system for %s"
179
+ Subprocess.run(self, 'configure', *command)
180
+ end
220
181
  end
221
-
222
- FileUtils.mkdir_p builddir if !File.directory?(builddir)
223
- Dir.chdir(builddir) {
224
- command = [ "#{srcdir}/configure", "--no-create", "--prefix=#{prefix}" ]
225
- command += Array[*configureflags]
226
-
227
- progress "configuring build system for %s"
228
- Subprocess.run(self, 'configure', *command)
229
- }
230
182
  end
231
183
 
232
184
  # Do the build in builddir
@@ -245,8 +197,8 @@ module Autobuild
245
197
  progress "installing %s"
246
198
  Subprocess.run(self, 'install', Autobuild.tool(:make), "-j#{parallel_build_level}", 'install')
247
199
  end
248
- Autobuild.touch_stamp(installstamp)
249
- Autobuild.update_environment(prefix)
200
+
201
+ super
250
202
  end
251
203
  end
252
204
  end
@@ -100,19 +100,20 @@ module Autobuild
100
100
  end
101
101
 
102
102
  def prepare
103
- super
104
-
105
- all_defines = defines.dup
106
- all_defines['CMAKE_INSTALL_PREFIX'] = prefix
107
-
103
+ # A failed initial CMake configuration leaves a CMakeCache.txt file,
104
+ # but no Makefile.
105
+ #
106
+ # Delete the CMakeCache to force reconfiguration
108
107
  if !File.exists?( File.join(builddir, 'Makefile') )
109
108
  FileUtils.rm_f configurestamp
110
109
  end
111
110
 
112
111
  if File.exists?(configurestamp)
112
+ all_defines = defines.dup
113
+ all_defines['CMAKE_INSTALL_PREFIX'] = prefix
113
114
  cache = File.read(configurestamp)
114
115
  did_change = all_defines.any? do |name, value|
115
- cache_line = cache.find do |line|
116
+ cache_line = cache.each_line.find do |line|
116
117
  line =~ /^#{name}:/
117
118
  end
118
119
 
@@ -133,28 +134,26 @@ module Autobuild
133
134
  FileUtils.rm_f configurestamp
134
135
  end
135
136
  end
137
+
138
+ super
136
139
  end
137
140
 
138
141
  # Configure the builddir directory before starting make
139
142
  def configure
140
- if File.exists?(builddir) && !File.directory?(builddir)
141
- raise ConfigException, "#{builddir} already exists but is not a directory"
142
- end
143
-
144
- FileUtils.mkdir_p builddir if !File.directory?(builddir)
145
- Dir.chdir(builddir) do
146
- command = [ "cmake", "-DCMAKE_INSTALL_PREFIX=#{prefix}" ]
147
- defines.each do |name, value|
148
- command << "-D#{name}=#{value}"
149
- end
150
- command << srcdir
151
-
152
- progress "generating and configuring build system for %s"
153
- if full_reconfigures?
154
- FileUtils.rm_f configurestamp
143
+ super do
144
+ Dir.chdir(builddir) do
145
+ command = [ "cmake", "-DCMAKE_INSTALL_PREFIX=#{prefix}" ]
146
+ defines.each do |name, value|
147
+ command << "-D#{name}=#{value}"
148
+ end
149
+ command << srcdir
150
+
151
+ progress "generating and configuring build system for %s"
152
+ if full_reconfigures?
153
+ FileUtils.rm_f configurestamp
154
+ end
155
+ Subprocess.run(self, 'configure', *command)
155
156
  end
156
- Subprocess.run(self, 'configure', *command)
157
- super
158
157
  end
159
158
  end
160
159
 
@@ -179,7 +178,6 @@ module Autobuild
179
178
  Dir.chdir(builddir) do
180
179
  progress "installing %s"
181
180
  Subprocess.run(self, 'build', Autobuild.tool(:make), "-j#{parallel_build_level}", 'install')
182
- Autobuild.update_environment prefix
183
181
  end
184
182
  super
185
183
  end
@@ -24,6 +24,8 @@ module Autobuild
24
24
  Rake.task(installstamp)
25
25
  t = Rake::Task[installstamp]
26
26
  def t.needed?; false end
27
+
28
+ super
27
29
  end
28
30
  end
29
31
  end
@@ -26,9 +26,11 @@ module Autobuild
26
26
  # after all imports have been made
27
27
  def prepare
28
28
  genomflags.flatten!
29
+ get_requires
29
30
 
30
31
  super
31
- get_requires
32
+
33
+ file genomstamp => dependencies.map { |p| Package[p].installstamp }
32
34
  end
33
35
 
34
36
  # The file touched by genom on successful generation
@@ -85,11 +87,6 @@ module Autobuild
85
87
  }
86
88
  end
87
89
  end
88
-
89
- def depends_on(*packages)
90
- super
91
- file genomstamp => packages.map { |p| Package[p].installstamp }
92
- end
93
90
 
94
91
  # Make the genom-stamp file depend on
95
92
  # * genom includes
@@ -32,9 +32,7 @@ module Autobuild
32
32
  exclude.freeze
33
33
  end
34
34
 
35
- file installstamp => srcdir do
36
- Autobuild.touch_stamp installstamp
37
- end
35
+ file installstamp => srcdir
38
36
  end
39
37
  end
40
38
  end
@@ -150,14 +150,24 @@ module Autobuild
150
150
  end
151
151
  end
152
152
 
153
- def self.orogen_root
154
- if @orogen_root.nil?
155
- @orogen_root = `orogen --base-dir 2>&1`
156
- if @orogen_root.empty?
157
- @orogen_root = false
158
- end
153
+ def self.orogen_bin
154
+ if @orogen_bin
155
+ @orogen_bin
159
156
  else
157
+ program_name = Autobuild.tool('orogen')
158
+ if orogen_path = ENV['PATH'].split(':').find { |p| File.file?(File.join(p, program_name)) }
159
+ @orogen_bin = File.join(orogen_path, program_name)
160
+ else
161
+ program_name
162
+ end
163
+ end
164
+ end
165
+
166
+ def self.orogen_root
167
+ if @orogen_root
160
168
  @orogen_root
169
+ elsif orogen_bin = self.orogen_bin
170
+ @orogen_root = File.expand_path('../lib', File.dirname(orogen_bin))
161
171
  end
162
172
  end
163
173
 
@@ -186,14 +196,6 @@ module Autobuild
186
196
  @orogen_file ||= "#{File.basename(name)}.orogen"
187
197
  end
188
198
 
189
- def depends_on(*packages)
190
- super
191
-
192
- packages.each do |p|
193
- file genstamp => Package[p].installstamp
194
- end
195
- end
196
-
197
199
  def import
198
200
  super
199
201
 
@@ -206,8 +208,6 @@ module Autobuild
206
208
  end
207
209
 
208
210
  def prepare
209
- super
210
-
211
211
  # Check if someone provides the pkgconfig/orocos-rtt-TARGET package,
212
212
  # and if so add it into our dependency list
213
213
  if rtt = Autobuild::Package["pkgconfig/orocos-rtt-#{orocos_target}"]
@@ -234,11 +234,8 @@ module Autobuild
234
234
  # Find out where orogen is, and make sure the configurestamp depend
235
235
  # on it. Ignore if orogen is too old to have a --base-dir option
236
236
  if orogen_root = self.class.orogen_root
237
- orogen_root = orogen_root.split[0].chomp
238
- if File.directory?(orogen_root)
239
- orogen_root = File.join(orogen_root, 'orogen')
240
- file genstamp => Autobuild.source_tree(orogen_root)
241
- end
237
+ orogen_root = File.join(orogen_root, 'orogen')
238
+ file genstamp => Autobuild.source_tree(orogen_root)
242
239
  end
243
240
  end
244
241
 
@@ -248,11 +245,26 @@ module Autobuild
248
245
  end
249
246
 
250
247
  with_doc
248
+
249
+ super
250
+
251
+ dependencies.each do |p|
252
+ file genstamp => Package[p].installstamp
253
+ end
251
254
  end
252
255
  def genstamp; File.join(srcdir, '.orogen', 'orogen-stamp') end
253
256
 
257
+ def guess_ruby_name
258
+ if Autobuild.programs['ruby']
259
+ Autobuild.tool('ruby')
260
+ else
261
+ ruby_bin = Config::CONFIG['RUBY_INSTALL_NAME']
262
+ Autobuild.programs['ruby'] = ruby_bin
263
+ end
264
+ end
265
+
254
266
  def regen
255
- cmdline = [Autobuild.tool('orogen')]
267
+ cmdline = [guess_ruby_name, self.class.orogen_bin]
256
268
  cmdline << '--corba' if corba
257
269
  cmdline << orogen_file
258
270
 
@@ -23,7 +23,7 @@ module Autobuild
23
23
  Find.prune
24
24
  end
25
25
  }
26
- next if File.directory?(p)
26
+ next if !File.file?(p)
27
27
 
28
28
  p_time = File.mtime(p)
29
29
  if latest < p_time
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: autobuild
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.9
4
+ version: 1.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sylvain Joyeux
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2010-01-15 00:00:00 +01:00
12
+ date: 2010-02-06 00:00:00 +01:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -52,6 +52,26 @@ dependencies:
52
52
  - !ruby/object:Gem::Version
53
53
  version: 1.3.3
54
54
  version:
55
+ - !ruby/object:Gem::Dependency
56
+ name: rubyforge
57
+ type: :development
58
+ version_requirement:
59
+ version_requirements: !ruby/object:Gem::Requirement
60
+ requirements:
61
+ - - ">="
62
+ - !ruby/object:Gem::Version
63
+ version: 2.0.3
64
+ version:
65
+ - !ruby/object:Gem::Dependency
66
+ name: gemcutter
67
+ type: :development
68
+ version_requirement:
69
+ version_requirements: !ruby/object:Gem::Requirement
70
+ requirements:
71
+ - - ">="
72
+ - !ruby/object:Gem::Version
73
+ version: 0.3.0
74
+ version:
55
75
  - !ruby/object:Gem::Dependency
56
76
  name: hoe
57
77
  type: :development
@@ -60,7 +80,7 @@ dependencies:
60
80
  requirements:
61
81
  - - ">="
62
82
  - !ruby/object:Gem::Version
63
- version: 2.4.0
83
+ version: 2.5.0
64
84
  version:
65
85
  description: |-
66
86
  This work is licensed under the GPLv2 license. See License.txt for details