/
buildgear-buildfile.man5
159 lines (125 loc) · 4.32 KB
/
buildgear-buildfile.man5
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
.TH "Buildgear buildfile" 5 "<===VERSION===>" "<===DATE===>" "Buildgear"
.SH NAME
buildgear_Buildfile \- Buildfile to describe build procedure
.SH DESCRIPTION
Buildfiles describe how a specific build in Buildgear is built. Buildfiles should be located in a folder that describes the builds. Buildfiles for native builds should be located in the \fIbuildfiles/native\fR path, and the cross builds should be located in the \fIbuildfiles/cross\fR path. The depth of the path can be as deep as you like. An example:
.RS
\fIbuildfiles/cross/cross-extra/MesaLib/Buildfile\fR
.RE
The Buildfile contains variables to describe the build, and functions to facilitate building the build.
.PP
A buildfile configuration file is used to provide various variables and functions to the buildfiles. See \fBbuildgear.buildfileconfig\fR(5).
.SH VARIABLES
The following variables are used in the Buildfile
.TP
.B name
.RS
The name of the build. This is the identifier used as argument to the buildgear commands. The name is also used in the name of the resulting package tar archive. The package tar archives are used internally by buildgear to populate sysroots during builds.
.RE
.TP
.B version
.RS
The version of the build. This is reported by the \fBbuildgear show --version \fR<\fIbuild name\fR> command. Furthermore, the version is used in the name of the resulting package tar archive.
.RE
.TP
.B release
.RS
The release identifier of the Buildgear distribution. This identifier will be used in the name of the resulting package tar archive.
.RE
.TP
.B source
.RS
List of sources needed in the build procedure. Sources can be remote (protocols supported by your curl installation, i.e. http://, ftp://, https://, ftps://), or it can be locale, relative to the location of the Builfile. If the source is an archive, it is automatically extracted.
.RE
.TP
.B depends
.RS
List of Buildgear builds that is needed by the build. These builds will be added to the sysroot before building of the selected build is started. Both compile-time and run-time dependencies can be specified. If the build dependency is in the native branch, the name of the build must be given as \fInative/<build name>\fR.
.RE
.TP
.B nostrip
.RS
List of files to not be automatically stripped. List items are treated as regular expressions (as used by grep).
.RE
.TP
.B options
.RS
List of special options. Supported options are:
.TP
.B build-lock
.RS
Locks the build so that it will be the only one building at any given time (even when parallel_builds > 1).
.RE
.TP
.B nostrip
.RS
Disables automatic strip of executables, shared libraries (.so), and static archives (.a).
.RE
.RE
.SH FUNCTIONS
.TP
.B build()
.RS
This function is called by the Buildgear tool, when the building the build. This function will normally contain the usual \fB./configure, make, make install\fR circus. Some environment variables are accessible in this function. The most important are:
.TP
.B SRC
.RS
The path of the directory where the sources are extracted
.RE
.TP
.B PKG
.RS
The path of the directory where the files that should be included in the resulting tar archive is located.
.RE
.TP
.B BUILD
.RS
The build system tuple
.RE
.TP
.B HOST
.RS
The host system tuple
.RE
.RE
.TP
.B check()
.RS
This function is called by the Buildgear tool to check if the pacakage can be built. This function will normally check if required tools on the build system is present.
.RE
.SH EXAMPLE
The example is taken from cross-extra/Mesalib
.PP
# Description: The Mesa 3D Graphics Library
# URL: http://www.mesa3d.org
name=MesaLib
version=8.0.4
release=1
source=(ftp://ftp.freedesktop.org/pub/mesa/$version/$name-$version.tar.bz2
0001-Don-t-cross-compile-src-glsl-builtin_compiler.patch)
depends=(libX11 xextproto libXext)
build() {
cd Mesa-$version
patch -p1 < $SRC/0001-Don-t-cross-compile-src-glsl-builtin_compiler.patch
NOCONFIGURE=1 ./autogen.sh
./configure --build=$BUILD \\
--host=$HOST \\
--prefix=/usr \\
--with-dri-drivers=swrast
make -j $JOBS
make DESTDIR=$PKG install
# Fix libtool files
fix_la_files $PKG
}
check() {
check_tool makedepend
check_tool python2
check_tool autoreconf
check_tool automake
check_tool aclocal
check_lib /usr/share/pyshared/libxml2.py
}
.SH AUTHOR
<===AUTHOR===>
.SH SEE ALSO
\fBbuildgear\fR(1)