autobuild 1.5.8 → 1.5.9
Sign up to get free protection for your applications and to get access to all the features.
- data/Changes.txt +5 -0
- data/lib/autobuild.rb +1 -1
- data/lib/autobuild/configurable.rb +0 -12
- data/lib/autobuild/import/git.rb +14 -0
- data/lib/autobuild/importer.rb +2 -0
- data/lib/autobuild/package.rb +32 -8
- data/lib/autobuild/packages/autotools.rb +1 -1
- data/lib/autobuild/packages/cmake.rb +4 -0
- data/lib/autobuild/subcommand.rb +1 -1
- data/lib/autobuild/timestamps.rb +6 -0
- metadata +58 -39
data/Changes.txt
CHANGED
data/lib/autobuild.rb
CHANGED
@@ -56,12 +56,6 @@ module Autobuild
|
|
56
56
|
# successfully built for the last time. The path is absolute
|
57
57
|
def buildstamp; "#{builddir}/#{STAMPFILE}" end
|
58
58
|
|
59
|
-
def initialize(options)
|
60
|
-
super
|
61
|
-
|
62
|
-
Autobuild.update_environment(prefix)
|
63
|
-
end
|
64
|
-
|
65
59
|
def prepare_for_forced_build
|
66
60
|
FileUtils.rm_f buildstamp
|
67
61
|
FileUtils.rm_f configurestamp
|
@@ -102,7 +96,6 @@ module Autobuild
|
|
102
96
|
task "#{name}-build" => buildstamp
|
103
97
|
|
104
98
|
file installstamp => buildstamp
|
105
|
-
Autobuild.update_environment(prefix)
|
106
99
|
end
|
107
100
|
|
108
101
|
# Configure the builddir directory before starting make
|
@@ -120,11 +113,6 @@ module Autobuild
|
|
120
113
|
# Do the build in builddir
|
121
114
|
def build
|
122
115
|
end
|
123
|
-
|
124
|
-
def install
|
125
|
-
super
|
126
|
-
Autobuild.update_environment(prefix)
|
127
|
-
end
|
128
116
|
end
|
129
117
|
end
|
130
118
|
|
data/lib/autobuild/import/git.rb
CHANGED
@@ -193,6 +193,20 @@ module Autobuild
|
|
193
193
|
Status.new(status, fetch_commit, head_commit, common_commit)
|
194
194
|
end
|
195
195
|
|
196
|
+
# Returns a hash that represents the whole import configuration
|
197
|
+
#
|
198
|
+
# The returned hash is:
|
199
|
+
#
|
200
|
+
# 'type' => 'git'
|
201
|
+
# 'url' => the_package_url
|
202
|
+
# 'tag' => current_commit_id
|
203
|
+
#
|
204
|
+
def current_state
|
205
|
+
return_value = { 'type' => 'git', 'url' => repository }
|
206
|
+
return_value
|
207
|
+
end
|
208
|
+
|
209
|
+
|
196
210
|
def update(package)
|
197
211
|
validate_srcdir(package)
|
198
212
|
Dir.chdir(package.srcdir) do
|
data/lib/autobuild/importer.rb
CHANGED
@@ -62,6 +62,7 @@ class Importer
|
|
62
62
|
package.progress "updating %s"
|
63
63
|
update(package)
|
64
64
|
patch(package)
|
65
|
+
package.updated = true
|
65
66
|
else
|
66
67
|
if Autobuild.verbose
|
67
68
|
puts " not updating #{package.name}"
|
@@ -76,6 +77,7 @@ class Importer
|
|
76
77
|
package.progress "checking out %s"
|
77
78
|
checkout(package)
|
78
79
|
patch(package)
|
80
|
+
package.updated = true
|
79
81
|
rescue Autobuild::Exception
|
80
82
|
FileUtils.rm_rf package.srcdir
|
81
83
|
raise
|
data/lib/autobuild/package.rb
CHANGED
@@ -72,7 +72,7 @@ module Autobuild
|
|
72
72
|
# Absolute path to the installation directory. See #prefix=
|
73
73
|
def prefix; File.expand_path(@prefix || '', Autobuild.prefix) end
|
74
74
|
# Absolute path to the log directory for this package. See #logdir=
|
75
|
-
def logdir; File.expand_path(@logdir ||
|
75
|
+
def logdir; File.expand_path(@logdir || 'log', prefix) end
|
76
76
|
|
77
77
|
# The file which marks when the last sucessful install
|
78
78
|
# has finished. The path is absolute
|
@@ -82,6 +82,13 @@ module Autobuild
|
|
82
82
|
File.join(logdir, "#{name}-#{STAMPFILE}")
|
83
83
|
end
|
84
84
|
|
85
|
+
attr_writer :updated
|
86
|
+
|
87
|
+
# Returns true if this package has already been updated. It will not be
|
88
|
+
# true if the importer has been called while Autobuild.do_update was
|
89
|
+
# false.
|
90
|
+
def updated?; !!@updated end
|
91
|
+
|
85
92
|
def initialize(spec)
|
86
93
|
@dependencies = Array.new
|
87
94
|
@provides = Array.new
|
@@ -155,6 +162,10 @@ module Autobuild
|
|
155
162
|
|
156
163
|
# Add the dependencies declared in spec
|
157
164
|
depends_on *@spec_dependencies if @spec_dependencies
|
165
|
+
|
166
|
+
if File.directory?(prefix)
|
167
|
+
Autobuild.update_environment prefix
|
168
|
+
end
|
158
169
|
end
|
159
170
|
|
160
171
|
# Create all the dependencies required to reconfigure and/or rebuild the
|
@@ -169,8 +180,6 @@ module Autobuild
|
|
169
180
|
install
|
170
181
|
end
|
171
182
|
task "#{name}-build" => installstamp
|
172
|
-
|
173
|
-
Autobuild.update_environment prefix
|
174
183
|
end
|
175
184
|
|
176
185
|
# Display a progress message. %s in the string is replaced by the
|
@@ -195,6 +204,7 @@ module Autobuild
|
|
195
204
|
Autobuild.apply_post_install(name, @post_install)
|
196
205
|
end
|
197
206
|
Autobuild.touch_stamp(installstamp)
|
207
|
+
Autobuild.update_environment prefix
|
198
208
|
end
|
199
209
|
|
200
210
|
def run(*args, &block)
|
@@ -315,13 +325,20 @@ module Autobuild
|
|
315
325
|
raise ConfigException, "#{p.inspect} should be a string" if !p.respond_to? :to_str
|
316
326
|
p = p.to_str
|
317
327
|
next if p == name
|
318
|
-
unless Package[p]
|
328
|
+
unless pkg = Package[p]
|
319
329
|
raise ConfigException.new(name), "package #{p} not defined"
|
320
330
|
end
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
331
|
+
|
332
|
+
next if @dependencies.include?(pkg.name)
|
333
|
+
|
334
|
+
if Autobuild.verbose
|
335
|
+
STDERR.puts " #{name} depends on #{pkg.name}"
|
336
|
+
end
|
337
|
+
|
338
|
+
task "#{name}-import" => "#{pkg.name}-import"
|
339
|
+
task "#{name}-prepare" => "#{pkg.name}-prepare"
|
340
|
+
task "#{name}-build" => "#{pkg.name}-build"
|
341
|
+
@dependencies << pkg.name
|
325
342
|
end
|
326
343
|
end
|
327
344
|
|
@@ -332,7 +349,14 @@ module Autobuild
|
|
332
349
|
raise ConfigException, "#{p.inspect} should be a string" if !p.respond_to? :to_str
|
333
350
|
p = p.to_str
|
334
351
|
next if p == name
|
352
|
+
next if @provides.include?(name)
|
353
|
+
|
335
354
|
@@provides[p] = self
|
355
|
+
|
356
|
+
if Autobuild.verbose
|
357
|
+
STDERR.puts " #{name} provides #{p}"
|
358
|
+
end
|
359
|
+
|
336
360
|
task p => name
|
337
361
|
task "#{p}-import" => "#{name}-import"
|
338
362
|
task "#{p}-prepare" => "#{name}-prepare"
|
@@ -215,7 +215,7 @@ module Autobuild
|
|
215
215
|
# Do the build in builddir
|
216
216
|
def build
|
217
217
|
Dir.chdir(builddir) do
|
218
|
-
progress "building %s"
|
218
|
+
progress "building %s [progress not available]"
|
219
219
|
Subprocess.run(self, 'build', './config.status')
|
220
220
|
Subprocess.run(self, 'build', Autobuild.tool(:make), "-j#{parallel_build_level}")
|
221
221
|
end
|
@@ -145,6 +145,10 @@ module Autobuild
|
|
145
145
|
def configure
|
146
146
|
super do
|
147
147
|
Dir.chdir(builddir) do
|
148
|
+
if !File.file?(File.join(srcdir, 'CMakeLists.txt'))
|
149
|
+
raise ConfigException, "#{srcdir} contains no CMakeLists.txt file"
|
150
|
+
end
|
151
|
+
|
148
152
|
command = [ "cmake", "-DCMAKE_INSTALL_PREFIX=#{prefix}" ]
|
149
153
|
defines.each do |name, value|
|
150
154
|
command << "-D#{name}=#{value}"
|
data/lib/autobuild/subcommand.rb
CHANGED
data/lib/autobuild/timestamps.rb
CHANGED
@@ -60,6 +60,12 @@ module Autobuild
|
|
60
60
|
|
61
61
|
def self.touch_stamp(stampfile)
|
62
62
|
puts "Touching #{stampfile}" if Autobuild.debug
|
63
|
+
dir = File.dirname(stampfile)
|
64
|
+
if File.exists?(dir) && !File.directory?(dir)
|
65
|
+
raise "#{dir} exists and is not a directory"
|
66
|
+
elsif !File.exists?(dir)
|
67
|
+
FileUtils.mkdir_p dir
|
68
|
+
end
|
63
69
|
FileUtils.touch(stampfile)
|
64
70
|
|
65
71
|
# File modification times on most Unix filesystems have a granularity of
|
metadata
CHANGED
@@ -1,7 +1,12 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: autobuild
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
4
|
+
prerelease: false
|
5
|
+
segments:
|
6
|
+
- 1
|
7
|
+
- 5
|
8
|
+
- 9
|
9
|
+
version: 1.5.9
|
5
10
|
platform: ruby
|
6
11
|
authors:
|
7
12
|
- Sylvain Joyeux
|
@@ -9,79 +14,91 @@ autorequire:
|
|
9
14
|
bindir: bin
|
10
15
|
cert_chain: []
|
11
16
|
|
12
|
-
date: 2010-
|
17
|
+
date: 2010-05-26 00:00:00 +02:00
|
13
18
|
default_executable:
|
14
19
|
dependencies:
|
15
20
|
- !ruby/object:Gem::Dependency
|
16
21
|
name: rake
|
17
|
-
|
18
|
-
|
19
|
-
version_requirements: !ruby/object:Gem::Requirement
|
22
|
+
prerelease: false
|
23
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
20
24
|
requirements:
|
21
25
|
- - ">="
|
22
26
|
- !ruby/object:Gem::Version
|
27
|
+
segments:
|
28
|
+
- 0
|
29
|
+
- 7
|
30
|
+
- 0
|
23
31
|
version: 0.7.0
|
24
|
-
|
32
|
+
type: :runtime
|
33
|
+
version_requirements: *id001
|
25
34
|
- !ruby/object:Gem::Dependency
|
26
35
|
name: rmail
|
27
|
-
|
28
|
-
|
29
|
-
version_requirements: !ruby/object:Gem::Requirement
|
36
|
+
prerelease: false
|
37
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
30
38
|
requirements:
|
31
39
|
- - ">="
|
32
40
|
- !ruby/object:Gem::Version
|
41
|
+
segments:
|
42
|
+
- 1
|
43
|
+
- 0
|
33
44
|
version: "1.0"
|
34
|
-
|
45
|
+
type: :runtime
|
46
|
+
version_requirements: *id002
|
35
47
|
- !ruby/object:Gem::Dependency
|
36
48
|
name: daemons
|
37
|
-
|
38
|
-
|
39
|
-
version_requirements: !ruby/object:Gem::Requirement
|
49
|
+
prerelease: false
|
50
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
40
51
|
requirements:
|
41
52
|
- - ">="
|
42
53
|
- !ruby/object:Gem::Version
|
54
|
+
segments:
|
55
|
+
- 0
|
56
|
+
- 0
|
43
57
|
version: "0.0"
|
44
|
-
|
58
|
+
type: :runtime
|
59
|
+
version_requirements: *id003
|
45
60
|
- !ruby/object:Gem::Dependency
|
46
61
|
name: utilrb
|
47
|
-
|
48
|
-
|
49
|
-
version_requirements: !ruby/object:Gem::Requirement
|
62
|
+
prerelease: false
|
63
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
50
64
|
requirements:
|
51
65
|
- - ">="
|
52
66
|
- !ruby/object:Gem::Version
|
67
|
+
segments:
|
68
|
+
- 1
|
69
|
+
- 3
|
70
|
+
- 3
|
53
71
|
version: 1.3.3
|
54
|
-
|
72
|
+
type: :runtime
|
73
|
+
version_requirements: *id004
|
55
74
|
- !ruby/object:Gem::Dependency
|
56
75
|
name: rubyforge
|
57
|
-
|
58
|
-
|
59
|
-
version_requirements: !ruby/object:Gem::Requirement
|
76
|
+
prerelease: false
|
77
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
60
78
|
requirements:
|
61
79
|
- - ">="
|
62
80
|
- !ruby/object:Gem::Version
|
81
|
+
segments:
|
82
|
+
- 2
|
83
|
+
- 0
|
84
|
+
- 3
|
63
85
|
version: 2.0.3
|
64
|
-
version:
|
65
|
-
- !ruby/object:Gem::Dependency
|
66
|
-
name: gemcutter
|
67
86
|
type: :development
|
68
|
-
|
69
|
-
version_requirements: !ruby/object:Gem::Requirement
|
70
|
-
requirements:
|
71
|
-
- - ">="
|
72
|
-
- !ruby/object:Gem::Version
|
73
|
-
version: 0.3.0
|
74
|
-
version:
|
87
|
+
version_requirements: *id005
|
75
88
|
- !ruby/object:Gem::Dependency
|
76
89
|
name: hoe
|
77
|
-
|
78
|
-
|
79
|
-
version_requirements: !ruby/object:Gem::Requirement
|
90
|
+
prerelease: false
|
91
|
+
requirement: &id006 !ruby/object:Gem::Requirement
|
80
92
|
requirements:
|
81
93
|
- - ">="
|
82
94
|
- !ruby/object:Gem::Version
|
83
|
-
|
84
|
-
|
95
|
+
segments:
|
96
|
+
- 2
|
97
|
+
- 6
|
98
|
+
- 0
|
99
|
+
version: 2.6.0
|
100
|
+
type: :development
|
101
|
+
version_requirements: *id006
|
85
102
|
description: |-
|
86
103
|
This work is licensed under the GPLv2 license. See License.txt for details
|
87
104
|
|
@@ -164,18 +181,20 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
164
181
|
requirements:
|
165
182
|
- - ">="
|
166
183
|
- !ruby/object:Gem::Version
|
184
|
+
segments:
|
185
|
+
- 0
|
167
186
|
version: "0"
|
168
|
-
version:
|
169
187
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
170
188
|
requirements:
|
171
189
|
- - ">="
|
172
190
|
- !ruby/object:Gem::Version
|
191
|
+
segments:
|
192
|
+
- 0
|
173
193
|
version: "0"
|
174
|
-
version:
|
175
194
|
requirements: []
|
176
195
|
|
177
196
|
rubyforge_project: autobuild
|
178
|
-
rubygems_version: 1.3.
|
197
|
+
rubygems_version: 1.3.6
|
179
198
|
signing_key:
|
180
199
|
specification_version: 3
|
181
200
|
summary: Rake-based utility to build and install multiple packages with dependencies
|