autoproj 1.7.0.rc2 → 1.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (38) hide show
  1. data/History.txt +29 -20
  2. data/Manifest.txt +2 -29
  3. data/Rakefile +7 -28
  4. data/bin/autolocate +9 -37
  5. data/{doc/guide/src → bin}/autoproj_bootstrap +36 -0
  6. data/bin/autoproj_stress_test +40 -0
  7. data/lib/autoproj/cmdline.rb +22 -3
  8. data/lib/autoproj/manifest.rb +0 -2
  9. data/lib/autoproj/version.rb +1 -1
  10. metadata +12 -40
  11. data/doc/guide/config.yaml +0 -29
  12. data/doc/guide/ext/init.rb +0 -18
  13. data/doc/guide/ext/previous_next.rb +0 -40
  14. data/doc/guide/ext/rdoc_links.rb +0 -33
  15. data/doc/guide/src/adding_packages.page +0 -40
  16. data/doc/guide/src/customization.page +0 -230
  17. data/doc/guide/src/default.css +0 -340
  18. data/doc/guide/src/default.template +0 -74
  19. data/doc/guide/src/error_messages.page +0 -37
  20. data/doc/guide/src/htmldoc.metainfo +0 -8
  21. data/doc/guide/src/htmldoc.virtual +0 -19
  22. data/doc/guide/src/images/bodybg.png +0 -0
  23. data/doc/guide/src/images/contbg.png +0 -0
  24. data/doc/guide/src/images/footerbg.png +0 -0
  25. data/doc/guide/src/images/gradient1.png +0 -0
  26. data/doc/guide/src/images/gradient2.png +0 -0
  27. data/doc/guide/src/index.page +0 -64
  28. data/doc/guide/src/manifest.xml +0 -14
  29. data/doc/guide/src/overview.png +0 -0
  30. data/doc/guide/src/overview.svg +0 -537
  31. data/doc/guide/src/package_sets/autobuild.page +0 -239
  32. data/doc/guide/src/package_sets/importers.page +0 -165
  33. data/doc/guide/src/package_sets/index.page +0 -223
  34. data/doc/guide/src/package_sets/manifest-xml.page +0 -29
  35. data/doc/guide/src/package_sets/osdeps.page +0 -128
  36. data/doc/guide/src/quick_start.page +0 -128
  37. data/doc/guide/src/toc.page +0 -7
  38. data/doc/guide/src/writing_manifest.page +0 -146
@@ -1,239 +0,0 @@
1
- ---
2
- title: Writing autobuild scripts
3
- sort_info: 200
4
- ---
5
-
6
- Defining CMake packages
7
- -----------------------
8
- A simple cmake package is defined with
9
-
10
- {coderay:: ruby}
11
- cmake_package "package_name"
12
- {coderay}
13
-
14
- More complex tweaking is achieved with
15
-
16
- {coderay:: ruby}
17
- cmake_package "package_name" do |pkg|
18
- [modify the pkg object]
19
- end
20
- {coderay}
21
-
22
- In particular, cmake build options can be given with
23
-
24
- {coderay:: ruby}
25
- cmake_package "package_name" do |pkg|
26
- pkg.define "VAR", "VALUE"
27
- end
28
- {coderay}
29
-
30
- The above snippet being equivalent to calling <tt>cmake -DVAR=VALUE</tt>
31
-
32
- The "pkg" variable in the example above is an instance of
33
- [Autobuild::CMake](http://doudou.github.com/autobuild/Autobuild/CMake.html)
34
- {: .block}
35
-
36
- Defining autotools packages {#autotools}
37
- ---------------------------
38
-
39
- {coderay:: ruby}
40
- autotools_package "package_name"
41
- autotools_package "package_name" do |pkg|
42
- pkg.configureflags << "--enable-feature" << "VAR=VALUE"
43
- # additional configuration
44
- end
45
- {coderay}
46
-
47
- The 'pkg' variable in the example above is an instance of
48
- [Autobuild::Autotools](http://doudou.github.com/autobuild/Autobuild/Autotools.html)
49
- {: .block}
50
-
51
- Defining Ruby packages
52
- ----------------------
53
-
54
- {coderay:: ruby}
55
- ruby_package "package_name"
56
- ruby_package "package_name" do |pkg|
57
- # additional configuration
58
- end
59
- {coderay}
60
-
61
- This package handles pure ruby libraries that do not need to be installed at
62
- all. Autoproj assumes that the directory layout of the package follows the following
63
- convention:
64
-
65
- * programs are in bin/
66
- * the library itself is in lib/
67
-
68
- If a Rakefile is present in the root of the source package, its <tt>default</tt>
69
- task will be called during the build, and its <tt>redocs</tt> task will be used
70
- for documentation generation. The <tt>rake_setup_task</tt> and
71
- <tt>rake_doc_task</tt> package properties can be used to override this default
72
- setting:
73
-
74
- {coderay::ruby}
75
- ruby_package "package_name" do |pkg|
76
- pkg.rake_setup_task = "setup"
77
- pkg.rake_doc_task = "doc:all"
78
- end
79
- {coderay}
80
-
81
- Additionally, they can be set to <tt>nil</tt> to disable either setup or documentation
82
- generation. For instance, the following code disables documentation generation
83
- and uses the +setup+ task at build time:
84
-
85
- {coderay::ruby}
86
- ruby_package "package_name" do |pkg|
87
- pkg.rake_setup_task = "setup"
88
- pkg.rake_doc_task = nil
89
- end
90
- {coderay}
91
-
92
- The 'pkg' variable in the example above is an instance of
93
- [Autobuild::ImporterPackage](http://doudou.github.com/autobuild/Autobuild/ImporterPackage.html),
94
- with additional methods coming from [the RubyPackage
95
- module](http://doudou.github.com/autoproj/api/Autoproj/RubyPackage.html)
96
- {: .block}
97
-
98
- Defining oroGen packages
99
- ------------------------
100
-
101
- {coderay:: ruby}
102
- orogen_package "package_name"
103
- orogen_package "package_name" do |pkg|
104
- # customization code
105
- end
106
- {coderay}
107
-
108
- oroGen is a module generator for the Orocos component framework. See [the oroGen
109
- documentation](http://doudou.github.com/orogen) for more information.
110
-
111
- The 'pkg' variable in the example above is an instance of
112
- [Autobuild::Orogen](http://doudou.github.com/autobuild/Autobuild/Orogen.html)
113
- {: .block}
114
-
115
- OS-specific bits (<tt>not_on</tt> and <tt>only_on</tt>) {#not_on_and_only_on}
116
- ----------------
117
- It is possible to have some parts of the autobuild file be OS-specific. Two
118
- calls are made available for that.
119
-
120
- First, if you know that some packages should not be built on some operating
121
- systems, you should enclose their declaration in a 'not_on' statement. For
122
- instance:
123
-
124
- {coderay:: ruby}
125
- not_on 'debian' do
126
- cmake_package 'excluded_package'
127
- end
128
- {coderay}
129
-
130
- It is additionally possible to select specific versions
131
-
132
- {coderay:: ruby}
133
- not_on 'debian', ['ubuntu', '10.04'] do
134
- cmake_package 'excluded_package'
135
- end
136
- {coderay}
137
-
138
- If, on the other hand, you want some bits to be available only **on** a specific
139
- OS, use the only_on statement:
140
-
141
- {coderay:: ruby}
142
- only_on ['ubuntu', '10.04'] do
143
- cmake_package 'only_ubuntu'
144
- end
145
- {coderay}
146
-
147
- If the user tries to build a package that is excluded on his architecture, he
148
- will get the following error message:
149
-
150
- modules/dynamixel depends on drivers/dynamixel, which is excluded from the build: drivers/dynamixel is disabled on this operating system
151
- {: .cmdline}
152
-
153
- Custom package building
154
- -----------------------
155
-
156
- {coderay:: ruby}
157
- import_package "package_name" do |pkg|
158
- pkg.post_install do
159
- # add commands to build and install the package
160
- end
161
- end
162
- {coderay}
163
-
164
- Declaring documentation targets
165
- -------------------------------
166
- Both autotools and cmake packages use <tt>make</tt> as the low-level build tool.
167
- For both packages, you can declare a documentation target that will be used
168
- during the call to <tt>autoproj doc</tt> to generate documentation:
169
-
170
- {coderay:: ruby}
171
- cmake_package "package_name" do |pkg|
172
- pkg.with_doc 'doc'
173
- pkg.doc_dir = "doc/html"
174
- end
175
- {coderay}
176
-
177
- The <tt>doc_dir</tt> assignment above is needed if the package installs its documentation
178
- elsewhere than "doc".
179
-
180
- Defining dependencies
181
- ---------------------
182
- Inter-package dependencies can be defined with
183
-
184
- {coderay:: ruby}
185
- pkg.depends_on "package_name"
186
- {coderay}
187
-
188
- Where package name is either the name of another autoproj-built package, or the
189
- name of a package that is to be [provided by the operating system](osdeps.html).
190
-
191
- Both methods should be used only for dynamic dependencies, i.e. dependencies
192
- that are dependent on build options (see below). Static dependencies should be
193
- defined in [the package's manifest.xml](manifest-xml.html)
194
- {: .warning}
195
-
196
- Finally, it is possible to give aliases to a package's name, by using the
197
- Autobuild::Package#provides method. If one does
198
-
199
- {coderay:: ruby}
200
- cmake_package "mypkg" do |pkg|
201
- pkg.provides "pkgconfig/libmypkg"
202
- end
203
- {coderay}
204
-
205
- then a package that declares a dependency on "pkgconfig/libmypkg" will actually
206
- depend on "mypkg".
207
-
208
- Defining and using options
209
- --------------------------
210
-
211
- It is possible to define configuration options which are set by your user at
212
- build time. These options can then be used in the autobuild scripts to
213
- parametrize the build.
214
-
215
- The general form of an option declaration is:
216
-
217
- {coderay:: ruby}
218
- configuration_option "option_name", "option_type",
219
- :default => "default_value",
220
- :values => ["set", "of", "possible", "values"],
221
- :doc => "description of the option"
222
- {coderay}
223
-
224
- Once declared, it can be used in autobuild scripts with:
225
-
226
- {coderay:: ruby}
227
- user_config("option_name")
228
- {coderay}
229
-
230
- Options are saved in <tt>autoproj/config.yml</tt> after the build. Options that
231
- are already set won't be asked again unless the <tt>--reconfigure</tt> option is
232
- given to <tt>autoproj build</tt>.
233
-
234
- Do not try to have too many options, that is in general bad policy as
235
- non-advanced users won't be able to know what to answer. Advanced users will
236
- always have the option to override your autobuild definitions to tweak the
237
- builds to their needs.
238
- {: .warning}
239
-
@@ -1,165 +0,0 @@
1
- ---
2
- title: Package import
3
- sort_info: 250
4
- ---
5
-
6
- As [we already mentioned](index.html), the source.yml file contains information
7
- on where to import the source packages from. This information is included in the
8
- version\_control field of the source.yml, and is of the general form:
9
-
10
- {coderay:: yaml}
11
- version_control:
12
- package_name:
13
- vcs_def
14
- package_name:
15
- vcs_def:
16
- {coderay}
17
-
18
- Autoproj follows the following rules to find the importer definition for a given
19
- package:
20
-
21
- - it loads the information contained in the version_control section of the
22
- package set that defines the considered package
23
- - it will apply any modification that is contained in the overrides section by
24
- the package sets listed *after* the aforementionned package set
25
-
26
- For both the version_control and overrides section, autoproj will match the
27
- package's name with the package\_name fields. It will consider every matching
28
- block (i.e. every package\_name that matches), overriding earlier setup by later
29
- ones.
30
-
31
- As an example, let's consider the following manifest:
32
-
33
- {coderay:: ruby}
34
- package_sets:
35
- - rubim.base
36
- - rubim.orocos
37
- - rubim.drivers
38
- {coderay}
39
-
40
- Now, let's assume that the rubim.orocos package set has a source.yml file with:
41
-
42
- {coderay:: ruby}
43
- version_control:
44
- - orocos/:
45
- type: git
46
- url: git://github.com/$PACKAGE.git
47
- - orocos/orocos.rb:
48
- branch: roby
49
- {coderay}
50
-
51
- Finally, the rubim.drivers package set has:
52
-
53
- {coderay:: ruby}
54
- overrides:
55
- - orocos/logger:
56
- branch: perf
57
- {coderay}
58
-
59
- Then, the following will happen:
60
-
61
- * all packages that are prefixed with "orocos/" will match the general
62
- definition of rubim.orocos.
63
- * in addition, the 'branch' flag of orocos/orocos.rb will be overriden from
64
- 'master' (the default) to 'roby'
65
- * in the case of orocos/logger, since there is a matching definition in
66
- the overrides section of rubim.drivers, the 'perf' branch will be checked out
67
- instead of the 'roby' branch, keeping the same importer type and URL
68
-
69
- The remaining of this page will detail the various options that exist to import
70
- a source package.
71
-
72
- Git {#all_importers}
73
- \---
74
-
75
- The general setup for git imports is:
76
-
77
- {coderay:: yaml}
78
- version_control:
79
- package_name:
80
- type: git
81
- url: repository_url_or_path
82
- branch: branch_name
83
- tag: tag_name # it is branch OR tag
84
- {coderay}
85
-
86
- Autoproj will maintain an 'autobuild' remote on the checked out repository:
87
- i.e., it will make sure that the URL of this remote is always linked to the
88
- right URL from the config file, and will update the relevant branch on update
89
- (beware: the other branches won't get updated).
90
-
91
- Moreover, autoproj will make sure that updating your local repository always
92
- resolves as a fast-forward (i.e., it will never create a merge)
93
-
94
- Subversion
95
- ----------
96
-
97
- The general setup for subversion imports is:
98
-
99
- {coderay:: yaml}
100
- version_control:
101
- package_name:
102
- type: svn
103
- url: repository_url_or_path
104
- {coderay}
105
-
106
- Note that the repository *must* be accessible without any password, and the
107
- import will fail if a password was needed.
108
- {: .warning}
109
-
110
- Tar archives
111
- ------------
112
-
113
- {coderay:: yaml}
114
- version_control:
115
- package_name:
116
- type: archive
117
- url: http://sourceforge.net/blablabla.tar.gz?option=value
118
- filename: blabla.tar.gz # Optional: if the file name cannot be inferred from the URL
119
- no_subdirectory: false # Optional. Set to true if there is not a leading directory in the archive
120
- update_cached_file: false # Optional. Set to false to disable automatic updates
121
- {coderay}
122
-
123
- The importer expects that there is a leading subdirectory in the archive, under
124
- which all files. If that is not the case, i.e. if all files are in the root of
125
- the archive, do not forget to set the no\_subdirectory option.
126
-
127
- Autoproj tries to guess what is the name of the downloaded file by extracting it
128
- out of the URL. Sometimes, this does not work as the URL does not fit the
129
- expected scheme -- in these cases you will get a tar error on update. To
130
- override this autodetection behaviour, set the filename option to the actual
131
- downloaded file name.
132
-
133
- By default, autoproj will check if the downloaded file has been updated on the
134
- server, and will download it again if it is the case. If you are downloading
135
- release tarballs, this is unneeded as the archive should not be updated. In that
136
- case, set the update\_cached\_file option to false to save the time needed to
137
- check for the update (can be long on, for instance, sourceforge). The source
138
- will of course be updated if you change the URL (i.e. to download a new release
139
- of the same software).
140
-
141
- Patching the source once it is checked out/updated
142
- --------------------------------------------------
143
-
144
- It is possible to apply patches after a given package (imported by any of the
145
- importer types) has been checked out/updated. To do so, simply add a
146
- <tt>patches:</tt> option in the importer configuration, that lists the patches
147
- to apply:
148
-
149
- {coderay:: yaml}
150
- version_control:
151
- package_name:
152
- type: archive
153
- url: http://sourceforge.net/blablabla
154
- patches:
155
- - $AUTOPROJ_SOURCE_DIR/blablabla-01.patch
156
- - $AUTOPROJ_SOURCE_DIR/blablabla-02.patch
157
- {coderay}
158
-
159
- Note that in the example above, the patch is saved in the package set's folder
160
- (the value of AUTOPROJ_SOURCE_DIR). This is a highly required practice.
161
-
162
- Note that if the patch list changes (i.e. the *names* change), autoproj will
163
- automatically unpatch and repatch as required. It is therefore highly required
164
- to change the patch name if the patch changes.
165
-
@@ -1,223 +0,0 @@
1
- ---
2
- title: Overview
3
- sort_info: 100
4
- ---
5
- A package set is made of three things:
6
-
7
- * the description file (source.yml)
8
- * an optional initialization script (init.rb) and override script
9
- (overrides.rb)
10
- * autobuild scripts (\*.autobuild)
11
-
12
- Starting a new package set
13
- --------------------------
14
-
15
- Create a subdirectory in autoproj/ and add a source.yml file that looks like:
16
-
17
- {coderay:: yaml}
18
- name: my_package_set_name
19
- {coderay}
20
-
21
- Et voila ! You have a new empty package set
22
-
23
- Adding a package
24
- ----------------
25
-
26
- Adding a package to a package set involves changing two files:
27
-
28
- * one of the package set's autobuild file that declares what packages there
29
- are. Any file ending with .autobuild is loaded as an autobuild file by
30
- autoproj.
31
- * the package set's source.yml file that declares where to get it (version
32
- control information)
33
-
34
- For the first step, you need to add one of the following lines:
35
-
36
- {coderay:: ruby}
37
- cmake_package "my/package" # for CMake package
38
- autotools_package "my/package" # for autoconf/automake packages
39
- orogen_package "my/package" # for orogen packages
40
- import_package "my/package" # for custom packages
41
- ruby_package "my/package" # for ruby libraries (optionally with C/C++ extensions)
42
- {coderay}
43
-
44
- The package name will be used to refer to this particular package later on --
45
- especially for version control definition. If subdirectories are used, like "my"
46
- in the above example, the package source will be checked out and built in the
47
- corresponding subdirectory. For instance, with
48
-
49
- {coderay:: ruby}
50
- cmake_package "drivers/hokuyo"
51
- {coderay}
52
-
53
- the hokuyo driver will _always_ be built in a <tt>drivers/</tt> subdirectory.
54
-
55
- Now that the package is declared, we need to add version control information to
56
- the source.yml file. This needs to be done in the version\_control section of
57
- the file, as for instance:
58
-
59
- {coderay:: yaml}
60
- version_control:
61
- - my/package:
62
- type: git
63
- url: git://github.com/blabla/my-package.git
64
- {coderay}
65
-
66
- The corresponding subversion definition would be:
67
-
68
- {coderay:: yaml}
69
- version_control:
70
- - my/package:
71
- type: svn
72
- url: svn+ssh://svnhosting.com/blabla/trunk/my/package
73
- {coderay}
74
-
75
- For testing purposes, it is possible to tell autoproj to *not* take into account
76
- any VCS information:
77
-
78
- {coderay:: yaml}
79
- version_control:
80
- - my/package: none
81
- {coderay}
82
-
83
- See [this page](importers.html) for details on the import mechanisms.
84
-
85
- Autobuild scripts
86
- -----------------
87
- The autobuild scripts lists all the packages defined by this set. It is a
88
- Ruby script (but you don't need to know Ruby to write one). In its most simple
89
- form, it looks like:
90
-
91
- {coderay:: ruby}
92
- cmake_package "orocos/rtt"
93
- autotools_package "drivers/imu"
94
- orogen_package "modules/imu"
95
- import_package "external/sisl"
96
- ruby_package "orocos/orocos.rb"
97
- {coderay}
98
-
99
- The above snippet defines two packages. The first one uses CMake as a build
100
- system and will be installed in the <tt>orocos/rtt</tt> subdirectory of the
101
- autoproj installation. The second one is an autotools package. There is, for
102
- now, only support for these two build systems, and for Ruby packages. Package
103
- definitions can be tweaked quite a lot, including the ability to generate
104
- documentation. See [the next page](autobuild.html) for more information on how to write autobuild
105
- scripts.
106
-
107
- source.yml
108
- ----------
109
- The source.yml file gives generic information on the package set itself (most
110
- importantly its name), and version control information (i.e. where to get the
111
- packages). It is a YAML file, and looks like:
112
-
113
- {coderay:: yaml}
114
- name: dfki.orocos
115
- constants:
116
- ROOT_DIR: $HOME/share
117
-
118
- version_control:
119
- - "modules/.*":
120
- type: git
121
- url: $ROOT_DIR/$PACKAGE.git
122
- - "drivers/.*":
123
- type: svn
124
- url: svn+ssh://rlbsvn.informatik.uni-bremen.de/trunk/$PACKAGE.git
125
- {coderay}
126
-
127
- The name field gives a name for the set. It is arbitrary, but the guideline
128
- is to give a name that is java-like for namespaces, i.e. origin.name.
129
-
130
- The <tt>constants:</tt> section lists values that can be reused for different
131
- packages. Autoproj defines two constants:
132
-
133
- * HOME is the user's home directory,
134
- * PACKAGE is the actual package name, useful when using wildcards in package
135
- names (see below)
136
-
137
- It is also possible to use configuration variables, that get asked to the user
138
- during the build (see below).
139
-
140
- Finally, the <tt>version_control:</tt> section describes how to import each
141
- software package. Its general format is:
142
- {coderay:: yaml}
143
- package_name:
144
- type: version_control_type # git, svn, cvs, darcs
145
- url: repository_url
146
- {coderay}
147
-
148
- Where package\_name is a regular expression that matches the package name (for
149
- instance, ".\*" will match all packages and "drivers/.\*" will match packages
150
- whose name starts with 'drivers'). The package name is the one given to the
151
- <tt>blabla_package</tt> stanza in the autobuild file.
152
-
153
- For the git importer, one of 'branch' or 'tag' options can be provided as well:
154
- {coderay:: yaml}
155
- package_name:
156
- branch: branch_to_track
157
- tag: tag_to_stick_to # it is branch OR tag
158
- {coderay}
159
-
160
- The options are applied in order, meaning that the top entries will be overriden
161
- by the lower ones. In general, one will have a ".\*" entry to give options for
162
- all packages, and then override for specific packages:
163
-
164
- {coderay:: yaml}
165
- version_control:
166
- - .*: # common options for all packages
167
- type: git
168
- url: $ROOT_DIR/$PACKAGE.git
169
-
170
- - "modules/logger": # we don't follow master on this module
171
- branch: imoby
172
- {coderay}
173
-
174
- Interaction between package sets definition files
175
- -------------------------------------------
176
- When multiple package sets are used, it is possible to override the version
177
- control definitions in low-priority sets with a higher priority one. Autoproj
178
- has the following rules when searching for version control information:
179
-
180
- * autoproj looks at the package sets *in the order they appear in the
181
- installation manifest*
182
- * autoproj searches a relevant version\_control field, and stops at the first
183
- package set that has one.
184
- * autoproj *stops searching* at the package set that defines the package.
185
- Consequence: this set *must* have a version\_control field for it, and an
186
- error will be issued otherwise.
187
-
188
- Using configuration options
189
- ---------------------------
190
- autoproj offers a configuration system that allows the user to tweak the build
191
- to its needs. If the version control definitions depend on such configuration
192
- options (as, for instance, because you want to parametrize the importer URLs),
193
- then create an init.rb file next to the source.yml file, and add lines looking
194
- like:
195
-
196
- {coderay:: ruby}
197
- configuration_option "option_name", "option_type",
198
- :default => "default_value",
199
- :values => ["set", "of", "possible", "values"],
200
- :doc => "description of the option"
201
- {coderay}
202
-
203
- where the option\_type field can either be "string" or "boolean".
204
-
205
- Then, you can use the option\_name as an expansion in the source.yml file.
206
-
207
- For instance, at my lab we are using an share filesystem to store the git
208
- repositories. Our project's init.rb file has the following option definition:
209
- {coderay:: ruby}
210
- configuration_option "MOUNT_POINT", "string",
211
- :default => "$HOME/nfs",
212
- :doc => "mount point of the NFS server"
213
- {coderay}
214
-
215
- And the source.yml uses it with:
216
-
217
- {coderay:: yaml}
218
- version_control:
219
- ".*":
220
- url: $MOUNT_POINT/git/$PACKAGE.git
221
- type: git
222
- {coderay}
223
-