1 | [[tags: manual]] |
---|
2 | [[toc:]] |
---|
3 | |
---|
4 | |
---|
5 | == Format of the egg description file |
---|
6 | |
---|
7 | An egg description is basically an association list holding |
---|
8 | information about the components of the egg. An egg may contain |
---|
9 | multiple components: libraries, programs, Scheme or C include files |
---|
10 | and arbitrary data files. Dependencies between eggs can be |
---|
11 | specified as can be dependencies between components of an egg. |
---|
12 | |
---|
13 | A list of valid properties follows. |
---|
14 | |
---|
15 | === Global properties |
---|
16 | |
---|
17 | ==== version |
---|
18 | |
---|
19 | [egg property] (version STRING) |
---|
20 | |
---|
21 | Specifies version string for this egg. {{STRING}} should have |
---|
22 | the format {{<MAJOR>.<MINOR>.<PATCHLEVEL>}}, where only the |
---|
23 | {{<MAJOR>}} part is mandatory. |
---|
24 | |
---|
25 | Eggs from remote egg servers are automatically versioned - the |
---|
26 | version is part of the protocol to retrieve the egg and does not |
---|
27 | have to be specified in the {{.egg}} file. Eggs installed from |
---|
28 | local directories (see below) should explicitly specify a version. |
---|
29 | |
---|
30 | ==== synopsis |
---|
31 | |
---|
32 | [egg property] (synopsis STRING) |
---|
33 | |
---|
34 | Gives a short description of this egg. |
---|
35 | |
---|
36 | ==== author |
---|
37 | |
---|
38 | [egg property] (author STRING) |
---|
39 | |
---|
40 | Names the author or authors of the contained code. |
---|
41 | |
---|
42 | ==== maintainer |
---|
43 | |
---|
44 | [egg property] (maintainer STRING) |
---|
45 | |
---|
46 | Names the maintainer of this code, if different from author(s). |
---|
47 | |
---|
48 | ==== category |
---|
49 | |
---|
50 | [egg property] (category NAME) |
---|
51 | |
---|
52 | Gives the category under which this egg should be contained. |
---|
53 | See [[/chicken-projects/egg-index-5.html|the egg index]] |
---|
54 | for a list of currently used categories. |
---|
55 | |
---|
56 | ==== license |
---|
57 | |
---|
58 | [egg property] (license STRING) |
---|
59 | |
---|
60 | Names the license under which this code is available. |
---|
61 | |
---|
62 | ==== dependencies |
---|
63 | |
---|
64 | [egg property] (dependencies EGG ...) |
---|
65 | |
---|
66 | Lists eggs that this egg depends on, and which should be |
---|
67 | built and installed if they do not already exist in the repository. |
---|
68 | {{EGG}} should be whether a symbol or a list of the form |
---|
69 | {{EGGNAME VERSION}}, where the former means to install the |
---|
70 | newest available egg with this name and the latter specifies |
---|
71 | a specific version or higher. |
---|
72 | |
---|
73 | ==== test-dependencies |
---|
74 | |
---|
75 | [egg property] (test-dependencies EGG ...) |
---|
76 | |
---|
77 | Lists eggs that are required for this egg to run the tests |
---|
78 | (if tests exist.) This only has an effect if the {{-test}} |
---|
79 | option has been given to {{chicken-install}}. |
---|
80 | |
---|
81 | ==== build-dependencies |
---|
82 | |
---|
83 | [egg property] (build-dependencies EGG ...) |
---|
84 | |
---|
85 | Lists eggs that are build-time dependencies for this egg, |
---|
86 | i.e. there are required to build, but not to run the contained |
---|
87 | code. Currently this is treated identical to {{dependencies}}. |
---|
88 | |
---|
89 | ==== foreign-dependencies |
---|
90 | |
---|
91 | [egg property] (foreign-dependencies NAME ...) |
---|
92 | |
---|
93 | Lists external dependencies like native code libraries |
---|
94 | or system-specific packages and is currently only used for |
---|
95 | documentation purposes. |
---|
96 | |
---|
97 | ==== platform |
---|
98 | |
---|
99 | [egg property] (platform PLATFORM) |
---|
100 | |
---|
101 | Specifies for which platform this egg is intended. {{PLATFORM}} |
---|
102 | should be a symbol naming the target platform ({{windows}}, {{linux}} |
---|
103 | or {{unix}}) or a boolean combination of platform values, allowed |
---|
104 | are {{(not PLATFORM)}}, {{(or PLATFORM ...)}} and {{(and PLATFORM ...)}}. |
---|
105 | If the expression can not be satisfied, then installation of this |
---|
106 | egg will abort. |
---|
107 | |
---|
108 | ==== components |
---|
109 | |
---|
110 | [egg property] (components COMPONENT ...) |
---|
111 | |
---|
112 | Lists components (extensions, programs, include- or data files) |
---|
113 | that this extension installs. See below for information on how |
---|
114 | to specify component-specific information. |
---|
115 | |
---|
116 | ==== host |
---|
117 | |
---|
118 | [egg property] (host PROP ...) |
---|
119 | |
---|
120 | Recursively process {{PROP ...}}, but only for the host (build) |
---|
121 | platform, in case this is a "cross-chicken", a CHICKEN installation |
---|
122 | intended for cross compilation. |
---|
123 | |
---|
124 | ==== target |
---|
125 | |
---|
126 | [egg property] (target PROP ...) |
---|
127 | |
---|
128 | Recursively process {{PROP ...}}, but only for the target |
---|
129 | platform, in case this is a "cross-chicken", a CHICKEN installation |
---|
130 | intended for cross compilation. |
---|
131 | |
---|
132 | ==== Components |
---|
133 | |
---|
134 | ==== extension |
---|
135 | |
---|
136 | [egg property] (extension NAME PROP ...) |
---|
137 | |
---|
138 | Specifies an extension library component. The properties |
---|
139 | {{PROP...}} are processed recursively and apply only to this |
---|
140 | component. |
---|
141 | |
---|
142 | ==== data |
---|
143 | |
---|
144 | [egg property] (data NAME PROP ...) |
---|
145 | |
---|
146 | Specifies one or more arbitrary data files. |
---|
147 | |
---|
148 | ==== generated-source-file |
---|
149 | |
---|
150 | [egg property] (generated-source-file NAME PROP ...) |
---|
151 | |
---|
152 | Specifies a file that is generated during the process of building |
---|
153 | the egg. |
---|
154 | |
---|
155 | ==== c-include |
---|
156 | |
---|
157 | [egg property] (c-include NAME PROP ...) |
---|
158 | |
---|
159 | Specifies one or more C include files. |
---|
160 | |
---|
161 | ==== scheme-include |
---|
162 | |
---|
163 | [egg property] (scheme-include NAME PROP ...) |
---|
164 | |
---|
165 | Specifies one or more Scheme include files. |
---|
166 | |
---|
167 | ==== program |
---|
168 | |
---|
169 | [egg property] (program NAME PROP ...) |
---|
170 | |
---|
171 | Specifies an executable program. |
---|
172 | |
---|
173 | ==== Component properties |
---|
174 | |
---|
175 | ==== host |
---|
176 | |
---|
177 | [egg property] (host PROP ...) |
---|
178 | |
---|
179 | Process {{PROP ...}} recursively for the current component, but |
---|
180 | apply the properties only to the host (build) part, when using |
---|
181 | a CHICKEN installation intended for cross-compilation. |
---|
182 | |
---|
183 | ==== target |
---|
184 | |
---|
185 | [egg property] (target PROP ...) |
---|
186 | |
---|
187 | Process {{PROP ...}} recursively for the current component, but |
---|
188 | apply the properties only to the target part, when using |
---|
189 | a CHICKEN installation intended for cross-compilation. |
---|
190 | |
---|
191 | ==== linkage |
---|
192 | |
---|
193 | [egg property] (linkage LINKAGE) |
---|
194 | |
---|
195 | Define whether the component should be linked dynamically or |
---|
196 | statically. {{LINKAGE}} can be {{static}} or {{dynamic}}. This |
---|
197 | property only makes sense for extension libraries. |
---|
198 | |
---|
199 | ==== types-file |
---|
200 | |
---|
201 | [egg property] (types-file [NAME]) |
---|
202 | |
---|
203 | Specifies that a "type-database" file should be generated and |
---|
204 | installed for this component. This property is only used for |
---|
205 | extension libraries. The name is optional and defaults to the |
---|
206 | name of the extensions (with the proper extension). |
---|
207 | |
---|
208 | If {{NAME}} is a list of the form {{(predefined [NAME])}}, then |
---|
209 | no types file is created during compilation and an existing types file |
---|
210 | for this extension is assumed and installed. |
---|
211 | |
---|
212 | ==== inline-file |
---|
213 | |
---|
214 | [egg property] (inline-file [NAME]) |
---|
215 | |
---|
216 | Specifies that an "inline" file should be generated and installed |
---|
217 | for this component. This property is only used for extension |
---|
218 | libraries. The name is optional and defaults to the |
---|
219 | name of the extensions (with the proper extension). |
---|
220 | |
---|
221 | ==== custom-build |
---|
222 | |
---|
223 | [egg property] (custom-build STRING) |
---|
224 | |
---|
225 | Specifies a custom build operation that should be executed instead of |
---|
226 | the default build operations. This property is mandatory for |
---|
227 | components of type {{generated-source-file}}. {{STRING}} should be the |
---|
228 | name of a shell command (e.g., a script) and thus may be platform |
---|
229 | sensitive. The path to the file is prepended implicitly, so you |
---|
230 | should '''not''' prefix it with {{./}}. On Windows, a file with the |
---|
231 | {{.bat}} extension will be picked before a plain file with no |
---|
232 | extension. |
---|
233 | |
---|
234 | The script will be made executable on UNIX systems, if necessary, |
---|
235 | and will be invoked like the {{csc}} program and |
---|
236 | is executed with the location of the CHICKEN |
---|
237 | binaries in the {{PATH}}. Also, the following environment variables |
---|
238 | are set in the execution environment of the script: |
---|
239 | |
---|
240 | * {{CHICKEN_CC}}: name of the C compiler used for building CHICKEN |
---|
241 | * {{CHICKEN_CXX}}: name of the C++ compiler set during the build of CHICKEN |
---|
242 | * {{CHICKEN_CSC}}: path to {{csc}} |
---|
243 | * {{CHICKEN_CSI}}: path to {{csi}} |
---|
244 | |
---|
245 | |
---|
246 | ==== csc-options |
---|
247 | |
---|
248 | [egg property] (csc-options OPTION ...) |
---|
249 | |
---|
250 | Specifies additional compiler options for {{csc}} that should be |
---|
251 | used when building this component. If this property is not |
---|
252 | given, the default options are used, which are {{-O2 -d1}} |
---|
253 | for extensions and programs and {{-O2 -d0}} for import |
---|
254 | libraries. |
---|
255 | |
---|
256 | Note that the options are quoted when passed to csc during the |
---|
257 | compilation of the extension, so multiple options should be specified |
---|
258 | as {{(csc-options "OPT1" "OPT2" ...)}} instead of {{(csc-options "OPT1 OPT2")}} |
---|
259 | (the latter would be a single option containing a whitespace character). |
---|
260 | |
---|
261 | ==== link-options |
---|
262 | |
---|
263 | [egg property] (link-options OPTION ...) |
---|
264 | |
---|
265 | Specifies additional link options for {{csc}} that should be |
---|
266 | used when building this component. |
---|
267 | |
---|
268 | Note that the options are quoted when passed to csc during the |
---|
269 | compilation of the extension, so multiple options should be specified |
---|
270 | as {{(link-options "OPT1" "OPT2" ...)}} instead of {{(link-options "OPT1 OPT2")}} |
---|
271 | (the latter would be a single option containing a whitespace character). |
---|
272 | |
---|
273 | ==== source |
---|
274 | |
---|
275 | [egg property] (source NAME) |
---|
276 | |
---|
277 | Specifies an alternative source file, in case it has a name |
---|
278 | distinct from the component name. By default the source file |
---|
279 | for a component is named after the component, with the {{.scm}} |
---|
280 | extension added. |
---|
281 | |
---|
282 | ==== install-name |
---|
283 | |
---|
284 | [egg property] (install-name NAME) |
---|
285 | |
---|
286 | Specifies an alternative installation name of the component, |
---|
287 | if it differs from the actual component name. This property |
---|
288 | is most useful if an egg installs an extension and a program |
---|
289 | of the same name, but needs to distinguish the components during |
---|
290 | build time. |
---|
291 | |
---|
292 | ==== component-dependencies |
---|
293 | |
---|
294 | [egg property] (component-dependencies NAME ...) |
---|
295 | |
---|
296 | Specifies dependencies to other components. {{NAME ...}} must |
---|
297 | be the names of extension, program, scheme-include- or generated source file |
---|
298 | components that should be built before the current component. |
---|
299 | |
---|
300 | ==== source-dependencies |
---|
301 | |
---|
302 | [egg property] (source-dependencies NAME ...) |
---|
303 | |
---|
304 | Specifies dependencies to additional source files. {{NAME ...}} must |
---|
305 | denote filenames of which the program or extension depends. |
---|
306 | A program or extension implicitly depends on its source file and |
---|
307 | and on the egg-specification file. |
---|
308 | |
---|
309 | ==== destination |
---|
310 | |
---|
311 | [egg property] (destination NAME) |
---|
312 | |
---|
313 | Specifies an alternative installation destination for the |
---|
314 | built component and only applies |
---|
315 | to components of type {{data}}, {{c-include}} and {{scheme-include}}. |
---|
316 | This property should only be used in extreme |
---|
317 | cases, as it is recommended to use the default installation |
---|
318 | locations, which are: |
---|
319 | |
---|
320 | * for C include files: {{<PREFIX>/include/chicken/}} |
---|
321 | |
---|
322 | * for Scheme include files: {{<PREFIX>/share/chicken/}} |
---|
323 | |
---|
324 | * for data files: {{<PREFIX>/share/chicken/}} |
---|
325 | |
---|
326 | ==== files |
---|
327 | |
---|
328 | [egg property] (files NAME ...) |
---|
329 | |
---|
330 | Specifies source files for this component and only applies |
---|
331 | to components of type {{data}}, {{c-include}} and {{scheme-include}}. |
---|
332 | |
---|
333 | |
---|
334 | --- |
---|
335 | |
---|
336 | Previous: [[Extension tools]] |
---|
337 | |
---|
338 | Next: [[Units and linking model]] |
---|