autoproj 1.3.4 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/History.txt +11 -0
- data/Manifest.txt +6 -2
- data/README.txt +15 -13
- data/Rakefile +1 -1
- data/bin/autoproj +18 -8
- data/doc/guide/ext/init.rb +1 -0
- data/doc/guide/src/autoproj_bootstrap +120 -16
- data/doc/guide/src/customization.page +1 -1
- data/doc/guide/src/default.css +11 -0
- data/doc/guide/src/default.template +1 -1
- data/doc/guide/src/error_messages.page +2 -1
- data/doc/guide/src/htmldoc.metainfo +4 -0
- data/doc/guide/src/index.page +15 -13
- data/doc/guide/src/manifest.xml +14 -0
- data/doc/guide/src/{autobuild.page → package_sets/autobuild.page} +77 -11
- data/doc/guide/src/package_sets/importers.page +164 -0
- data/doc/guide/src/{source_yml.page → package_sets/index.page} +7 -2
- data/doc/guide/src/package_sets/manifest-xml.page +29 -0
- data/doc/guide/src/package_sets/osdeps.page +123 -0
- data/doc/guide/src/structure.page +43 -12
- data/lib/autoproj/autobuild.rb +81 -15
- data/lib/autoproj/default.osdeps +27 -3
- data/lib/autoproj/manifest.rb +27 -2
- data/lib/autoproj/osdeps.rb +49 -6
- data/lib/autoproj/system.rb +47 -2
- data/lib/autoproj/version.rb +1 -1
- metadata +29 -5
@@ -0,0 +1,123 @@
|
|
1
|
+
---
|
2
|
+
title: Operating System dependencies
|
3
|
+
sort_info: 300
|
4
|
+
---
|
5
|
+
|
6
|
+
Each package set can have one or multiple .osdeps files. These files declare
|
7
|
+
how to install prepackaged dependencies, based on the underlying operating system.
|
8
|
+
|
9
|
+
Defining dependencies between source packages and OS packages
|
10
|
+
-------------------------------------------------------------
|
11
|
+
|
12
|
+
These dependencies can be defined in two ways:
|
13
|
+
|
14
|
+
* by adding a <tt><osdep name="depname" /></tt> tag in the package's
|
15
|
+
[manifest.xml](manifest-xml.html)
|
16
|
+
* by calling <tt>pkg.depends_on_os_package("depname")</tt> [in the autobuild
|
17
|
+
file](autobuild.html).
|
18
|
+
|
19
|
+
In both cases, depname is used as a key to find the OS package definition in the
|
20
|
+
osdeps files (see below). It does not have to be the actual package name.
|
21
|
+
|
22
|
+
OS packages
|
23
|
+
-----------
|
24
|
+
|
25
|
+
The general format of the an OS package definition:
|
26
|
+
|
27
|
+
{coderay:: yaml}
|
28
|
+
name:
|
29
|
+
distribution1,distribution2:
|
30
|
+
version1,version2: [package_name1, package_name2]
|
31
|
+
{coderay}
|
32
|
+
|
33
|
+
Where 'name' is the name used to declare the dependency (see above),
|
34
|
+
<tt>distribution*</tt> the name of the distribution and <tt>version*</tt> the
|
35
|
+
distribution's version, and <tt>package_name*</tt> the name of the package in
|
36
|
+
the underlying OS.
|
37
|
+
|
38
|
+
Since the osdeps file is a YAML file, <tt>[package_name1, package_name2]</tt> can also be written
|
39
|
+
|
40
|
+
{coderay:: yaml}
|
41
|
+
name:
|
42
|
+
distribution1,distribution2:
|
43
|
+
version1,version2:
|
44
|
+
- package_name1
|
45
|
+
- package_name2
|
46
|
+
{coderay}
|
47
|
+
|
48
|
+
If only one package needs to be installed, one can use the shortcut
|
49
|
+
|
50
|
+
{coderay:: yaml}
|
51
|
+
name:
|
52
|
+
distribution1,distribution2:
|
53
|
+
version1,version2: package_name
|
54
|
+
{coderay}
|
55
|
+
|
56
|
+
Finally, if the package name is version-independent, the version can be omitted:
|
57
|
+
|
58
|
+
|
59
|
+
{coderay:: yaml}
|
60
|
+
name:
|
61
|
+
distribution1,distribution2: package_name
|
62
|
+
{coderay}
|
63
|
+
|
64
|
+
Examples:
|
65
|
+
|
66
|
+
{coderay:: yaml}
|
67
|
+
ruby:
|
68
|
+
debian,ubuntu:
|
69
|
+
9.04,10.04,sid: libruby-dev
|
70
|
+
boost:
|
71
|
+
debian:
|
72
|
+
- libboost1.38-dev
|
73
|
+
- libboost-program1.38-dev
|
74
|
+
ubuntu:
|
75
|
+
9.04,10.04: libboost-dev
|
76
|
+
{coderay}
|
77
|
+
|
78
|
+
At the time of this writing, autoproj is able to install packages on
|
79
|
+
Ubuntu/Debian and Gentoo. Support for other operating systems can be easily
|
80
|
+
added, so [contact me](http://github.com/doudou) if you want to do so.
|
81
|
+
|
82
|
+
RubyGems packages
|
83
|
+
-----------------
|
84
|
+
|
85
|
+
RubyGems packages are OS-independent. In the osdeps files, they can be referred
|
86
|
+
to by replacing the OS distribution name by 'gem'.
|
87
|
+
|
88
|
+
Example:
|
89
|
+
|
90
|
+
{coderay:: yaml}
|
91
|
+
hoe:
|
92
|
+
gem:
|
93
|
+
hoe
|
94
|
+
{coderay}
|
95
|
+
|
96
|
+
If the OS dep name and the RubyGems name are the same, one can use the shortcut
|
97
|
+
|
98
|
+
{coderay:: yaml}
|
99
|
+
hoe: gem
|
100
|
+
{coderay}
|
101
|
+
|
102
|
+
Note that it is possible to use a mixture of RubyGems and OS packages. For
|
103
|
+
instance, the following snippet will both install the gnuplot package and the
|
104
|
+
gnuplot RubyGems whenever an osdep on 'gnuplot' is declared.
|
105
|
+
|
106
|
+
{coderay:: yaml}
|
107
|
+
gnuplot:
|
108
|
+
gem: gnuplot
|
109
|
+
debian: gnuplot
|
110
|
+
{coderay}
|
111
|
+
|
112
|
+
Ignoring some dependencies
|
113
|
+
--------------------------
|
114
|
+
It is possible that, on some operating systems, a given package should simply be
|
115
|
+
ignored. To do so, simply use the 'ignore' keyword. Example:
|
116
|
+
|
117
|
+
{coderay:: yaml}
|
118
|
+
gnuplot:
|
119
|
+
gem: gnuplot
|
120
|
+
debian: ignore
|
121
|
+
ubuntu: gnuplot
|
122
|
+
{coderay}
|
123
|
+
|
@@ -4,16 +4,37 @@ sort_info: 50
|
|
4
4
|
---
|
5
5
|
|
6
6
|
This page describes the structure of a autoproj installation, and describes how
|
7
|
-
to manage one. See [the introduction](index.
|
7
|
+
to manage one. See [the introduction](index.html) for the bootstrapping process.
|
8
8
|
|
9
9
|
Structure
|
10
10
|
---------
|
11
11
|
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
12
|
+
!overview.png!
|
13
|
+
<img class="full" src="overview.png" />
|
14
|
+
|
15
|
+
The autoproj configuration and build process goes like this:
|
16
|
+
|
17
|
+
* a set of packages are declared in _package sets_. These package sets can
|
18
|
+
either be local (saved along with the rest of the autoproj configuration) or
|
19
|
+
remote (imported from a VCS). They declare how to get, build and install
|
20
|
+
a certain number of packages. On the image above, there are three of those
|
21
|
+
sets: rubim.base, rubim.orocos and rubim.drivers.
|
22
|
+
* packages that are relevant to the local installation are cherry-picked from
|
23
|
+
the package sets. One can either select packages one-by-one (the case for the
|
24
|
+
two packages of rubim.drivers above), or a package set can be imported as a
|
25
|
+
whole (rubim.orocos and rubim.base).
|
26
|
+
* autoproj will then import the selected packages, auto-select their
|
27
|
+
dependencies and import them as well, build and install all of this.
|
28
|
+
* the selected packages can be imported and built in subdirectories of the
|
29
|
+
installation tree. In the above example, all packages from rubim.orocos are
|
30
|
+
built in the tools/ subdirectory, one package of rubim.drivers in the
|
31
|
+
perception/ subdirectory and so on.
|
32
|
+
|
33
|
+
In practice, the autoproj configuration is saved in an autoproj/ directory. It
|
34
|
+
is split like this:
|
35
|
+
|
36
|
+
* autoproj/manifest: list of available package sets, package selection and
|
37
|
+
installation layout (where to put what).
|
17
38
|
* .remotes/\*: package sets that are imported from a remote version
|
18
39
|
control system
|
19
40
|
* autoproj/\*/: local sets, i.e. sets that have not been imported from a remote
|
@@ -29,8 +50,10 @@ The build is done in two steps:
|
|
29
50
|
installation
|
30
51
|
|
31
52
|
Moreover, the <tt>build/log</tt> directory contains the output of all commands
|
32
|
-
that have been run during the build.
|
33
|
-
|
53
|
+
that have been run during the build.
|
54
|
+
|
55
|
+
Finally, a <tt>env.sh</tt> script is generated to set up your shell for the use
|
56
|
+
of the installed software.
|
34
57
|
|
35
58
|
Listing and adding package sets
|
36
59
|
-------------------------------
|
@@ -64,7 +87,9 @@ For the git importer, one of 'branch' or 'tag' options can be provided as well:
|
|
64
87
|
{coderay}
|
65
88
|
|
66
89
|
Imported package sets are saved in the <tt>.remotes</tt> directory of the
|
67
|
-
autoproj installation.
|
90
|
+
autoproj installation. The importers that are available for configuration are
|
91
|
+
the same than the ones available for the packages themselves, so see [this
|
92
|
+
page](package_sets/importers.html#all_importers) for the list of available importers.
|
68
93
|
|
69
94
|
Management
|
70
95
|
----------
|
@@ -84,12 +109,18 @@ autoproj build --reconfigure
|
|
84
109
|
Alternatively, you can edit the autoproj/config.yml file directly.
|
85
110
|
|
86
111
|
If you are in a disconnected environment (i.e. no access to remote
|
87
|
-
repositories), use the
|
88
|
-
autoproj will still
|
112
|
+
repositories), use the fast-build mode, to skip the package update and OS
|
113
|
+
packages installation phases (autoproj will still check out new packages,
|
114
|
+
though):
|
89
115
|
|
90
|
-
autoproj build
|
116
|
+
autoproj fast-build
|
91
117
|
{.commandline}
|
92
118
|
|
119
|
+
The package update can be disabled with --no-update and the OS dependencies
|
120
|
+
installation with --no-osdeps. In practice, "autoproj fast-build" is equivalent
|
121
|
+
to autoproj build --no-update --no-osdeps
|
122
|
+
{.block}
|
123
|
+
|
93
124
|
If, on the other hand, you only want to update the source code, do
|
94
125
|
|
95
126
|
autoproj update
|
data/lib/autoproj/autobuild.rb
CHANGED
@@ -1,13 +1,17 @@
|
|
1
|
+
require 'find'
|
2
|
+
require 'fileutils'
|
1
3
|
require 'autobuild'
|
2
4
|
require 'set'
|
3
5
|
|
4
6
|
class Autobuild::Package
|
5
|
-
def autoproj_name
|
7
|
+
def autoproj_name # :nodoc:
|
6
8
|
srcdir.gsub /^#{Regexp.quote(Autoproj.root_dir)}\//, ''
|
7
9
|
end
|
8
10
|
end
|
9
11
|
|
10
12
|
module Autoproj
|
13
|
+
# Subclass of Autobuild::Reporter, used to display a message when the build
|
14
|
+
# finishes/fails.
|
11
15
|
class Reporter < Autobuild::Reporter
|
12
16
|
def error(error)
|
13
17
|
error_lines = error.to_s.split("\n")
|
@@ -22,15 +26,12 @@ module Autoproj
|
|
22
26
|
end
|
23
27
|
end
|
24
28
|
|
29
|
+
# Displays a warning message
|
25
30
|
def self.warn(message)
|
26
31
|
STDERR.puts Autoproj.console.color(" WARN: #{message}", :magenta)
|
27
32
|
end
|
28
33
|
|
29
|
-
@definition_files = Hash.new
|
30
34
|
@file_stack = Array.new
|
31
|
-
class << self
|
32
|
-
attr_reader :definition_files
|
33
|
-
end
|
34
35
|
|
35
36
|
def self.package_name_from_options(spec)
|
36
37
|
if spec.kind_of?(Hash)
|
@@ -78,16 +79,18 @@ module Autoproj
|
|
78
79
|
end
|
79
80
|
end
|
80
81
|
|
82
|
+
# Sets up a documentation target on pkg that runs 'rake <target>'
|
81
83
|
def ruby_doc(pkg, target = 'doc')
|
82
84
|
pkg.doc_task do
|
85
|
+
pkg.progress "generating documentation for %s"
|
83
86
|
pkg.doc_disabled unless File.file?('Rakefile')
|
84
87
|
Autobuild::Subprocess.run pkg.name, 'doc', 'rake', target
|
85
88
|
end
|
86
89
|
|
87
90
|
end
|
88
91
|
|
89
|
-
# Common setup for packages
|
90
|
-
def package_common(package_type, spec)
|
92
|
+
# Common setup for packages
|
93
|
+
def package_common(package_type, spec) # :nodoc:
|
91
94
|
package_name = Autoproj.package_name_from_options(spec)
|
92
95
|
|
93
96
|
begin
|
@@ -108,6 +111,20 @@ def package_common(package_type, spec)
|
|
108
111
|
end
|
109
112
|
end
|
110
113
|
|
114
|
+
def import_package(options, &block)
|
115
|
+
package_common(:import, options, &block)
|
116
|
+
end
|
117
|
+
|
118
|
+
# Define a cmake package
|
119
|
+
#
|
120
|
+
# Example:
|
121
|
+
#
|
122
|
+
# cmake_package 'package_name' do |pkg|
|
123
|
+
# pkg.define "CMAKE_BUILD_TYPE", "Release"
|
124
|
+
# end
|
125
|
+
#
|
126
|
+
# +pkg+ is an Autobuild::CMake instance. See the Autobuild API for more
|
127
|
+
# information.
|
111
128
|
def cmake_package(options, &block)
|
112
129
|
package_common(:cmake, options) do |pkg|
|
113
130
|
Autoproj.add_build_system_dependency 'cmake'
|
@@ -123,8 +140,15 @@ def cmake_package(options, &block)
|
|
123
140
|
end
|
124
141
|
end
|
125
142
|
|
126
|
-
#
|
127
|
-
#
|
143
|
+
# Define an autotools package
|
144
|
+
#
|
145
|
+
# Example:
|
146
|
+
# autotools_package 'package_name' do |pkg|
|
147
|
+
# pkg.configureflags << "--enable-llvm"
|
148
|
+
# end
|
149
|
+
#
|
150
|
+
# +pkg+ is an Autobuild::Autotools instance. See the Autobuild API for more
|
151
|
+
# information.
|
128
152
|
def autotools_package(options, &block)
|
129
153
|
package_common(:autotools, options) do |pkg|
|
130
154
|
Autoproj.add_build_system_dependency 'autotools'
|
@@ -140,20 +164,32 @@ def autotools_package(options, &block)
|
|
140
164
|
end
|
141
165
|
end
|
142
166
|
|
143
|
-
|
167
|
+
# Common setup for Ruby packages
|
168
|
+
def ruby_common(pkg) # :nodoc:
|
144
169
|
def pkg.prepare_for_forced_build
|
145
170
|
super
|
146
171
|
extdir = File.join(srcdir, 'ext')
|
147
172
|
if File.directory?(extdir)
|
148
|
-
|
149
|
-
|
173
|
+
Find.find(extdir) do |file|
|
174
|
+
next if file !~ /\<Makefile\>|\<CMakeCache.txt\>$/
|
175
|
+
FileUtils.rm_rf file
|
176
|
+
end
|
150
177
|
end
|
151
178
|
end
|
152
179
|
def pkg.prepare_for_rebuild
|
153
180
|
super
|
154
181
|
extdir = File.join(srcdir, 'ext')
|
155
182
|
if File.directory?(extdir)
|
156
|
-
|
183
|
+
Find.find(extdir) do |file|
|
184
|
+
if file =~ /Makefile/
|
185
|
+
Autobuild::Subprocess.run self, 'build', Autobuild.tool("make"), "-C", File.dirname(file), "clean"
|
186
|
+
end
|
187
|
+
end
|
188
|
+
Find.find(extdir) do |file|
|
189
|
+
if File.directory?(file) && file == "build"
|
190
|
+
FileUtils.rm_rf file
|
191
|
+
end
|
192
|
+
end
|
157
193
|
end
|
158
194
|
end
|
159
195
|
|
@@ -180,6 +216,17 @@ def env_add(name, value)
|
|
180
216
|
Autoproj.env_add(name, value)
|
181
217
|
end
|
182
218
|
|
219
|
+
|
220
|
+
# Defines a Ruby package
|
221
|
+
#
|
222
|
+
# Example:
|
223
|
+
#
|
224
|
+
# ruby_package 'package_name' do |pkg|
|
225
|
+
# pkg.doc_target = 'doc'
|
226
|
+
# end
|
227
|
+
#
|
228
|
+
# +pkg+ is an Autobuild::Importer instance. See the Autobuild API for more
|
229
|
+
# information.
|
183
230
|
def ruby_package(options)
|
184
231
|
package_common(:import, options) do |pkg|
|
185
232
|
class << pkg
|
@@ -194,12 +241,25 @@ def ruby_package(options)
|
|
194
241
|
end
|
195
242
|
end
|
196
243
|
|
244
|
+
# Defines an oroGen package. By default, autoproj will look for an orogen file
|
245
|
+
# called package_basename.orogen if the package is called dir/package_basename
|
246
|
+
#
|
247
|
+
# Example:
|
248
|
+
# orogen_package 'package_name' do |pkg|
|
249
|
+
# pkg.orogen_file = "my.orogen"
|
250
|
+
# pkg.corba = false
|
251
|
+
# end
|
252
|
+
#
|
253
|
+
# +pkg+ is an Autobuild::Orogen instance. See the Autobuild API for more
|
254
|
+
# information.
|
197
255
|
def orogen_package(options, &block)
|
198
256
|
package_common(:orogen, options) do |pkg|
|
199
257
|
yield(pkg) if block_given?
|
200
258
|
end
|
201
259
|
end
|
202
260
|
|
261
|
+
# Defines an import-only package, i.e. a package that is simply checked out but
|
262
|
+
# not built in any way
|
203
263
|
def source_package(options)
|
204
264
|
package_common(options) do |pkg|
|
205
265
|
pkg.srcdir = pkg.name
|
@@ -207,11 +267,17 @@ def source_package(options)
|
|
207
267
|
end
|
208
268
|
end
|
209
269
|
|
270
|
+
# Define a configuration option
|
271
|
+
#
|
272
|
+
# See Autoproj.configuration_option
|
210
273
|
def configuration_option(*opts, &block)
|
211
274
|
Autoproj.configuration_option(*opts, &block)
|
212
275
|
end
|
213
276
|
|
214
|
-
|
215
|
-
|
277
|
+
# Retrieves the configuration value for the given option
|
278
|
+
#
|
279
|
+
# See Autoproj.user_config
|
280
|
+
def user_config(key)
|
281
|
+
Autoproj.user_config(key)
|
216
282
|
end
|
217
283
|
|
data/lib/autoproj/default.osdeps
CHANGED
@@ -1,24 +1,44 @@
|
|
1
1
|
# The following definitions are needed to bootstrap autoproj
|
2
2
|
none: ignore
|
3
3
|
|
4
|
-
|
4
|
+
ruby18:
|
5
5
|
debian,ubuntu:
|
6
6
|
- ruby1.8-dev
|
7
7
|
- ruby1.8
|
8
|
+
- rubygems1.8
|
9
|
+
- ri1.8
|
8
10
|
- libopenssl-ruby1.8
|
9
11
|
gentoo:
|
10
12
|
- dev-lang/ruby:1.8
|
11
13
|
|
14
|
+
ruby19:
|
15
|
+
debian,ubuntu:
|
16
|
+
- ruby1.9.1
|
17
|
+
- ruby1.9.1-dev
|
18
|
+
- rubygems1.9.1
|
19
|
+
- ri1.9.1
|
20
|
+
- libopenssl-ruby1.9.1
|
21
|
+
gentoo:
|
22
|
+
- dev-lang/ruby:1.9
|
23
|
+
arch:
|
24
|
+
- ruby
|
25
|
+
|
26
|
+
rdoc: gem
|
27
|
+
|
12
28
|
build-essential:
|
13
29
|
debian,ubuntu: build-essential
|
14
30
|
gentoo:
|
31
|
+
arch:
|
15
32
|
|
16
33
|
libxml2:
|
17
34
|
debian,ubuntu: libxml2-dev
|
18
35
|
gentoo: dev-libs/libxml2
|
36
|
+
arch: libxml2
|
37
|
+
|
19
38
|
libxslt:
|
20
39
|
debian,ubuntu: libxslt1-dev
|
21
40
|
gentoo: dev-libs/libxslt
|
41
|
+
arch: libxslt
|
22
42
|
|
23
43
|
autobuild: gem
|
24
44
|
autoproj: gem
|
@@ -27,26 +47,30 @@ autoproj: gem
|
|
27
47
|
git:
|
28
48
|
debian,ubuntu: git-core
|
29
49
|
gentoo: dev-util/git
|
30
|
-
|
50
|
+
arch: git
|
31
51
|
svn:
|
32
52
|
debian,ubuntu: subversion
|
33
53
|
gentoo: dev-util/subversion
|
34
|
-
|
54
|
+
arch: subversion
|
35
55
|
cmake:
|
36
56
|
debian,ubuntu: cmake
|
37
57
|
gentoo: dev-util/cmake
|
58
|
+
arch: cmake
|
38
59
|
|
39
60
|
autotools:
|
40
61
|
debian,ubuntu: [automake1.9, autoconf]
|
41
62
|
gentoo: [sys-devel/automake:1.9, sys-devel/autoconf]
|
63
|
+
arch: automake autoconf
|
42
64
|
|
43
65
|
lsb_release:
|
44
66
|
debian,ubuntu: lsb-release
|
45
67
|
gentoo: sys-apps/lsb-release
|
68
|
+
arch:
|
46
69
|
|
47
70
|
archive:
|
48
71
|
debian,ubuntu: [tar, unzip]
|
49
72
|
gentoo: [app-arch/tar, app-arch/unzip]
|
73
|
+
arch: [tar, unzip]
|
50
74
|
|
51
75
|
# vim: expandtab
|
52
76
|
|