-
-
Notifications
You must be signed in to change notification settings - Fork 15
/
building-pkgs.php
138 lines (116 loc) · 5.51 KB
/
building-pkgs.php
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
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>How to build LLVM Debian/Ubuntu packages from source?</title>
<link rel="stylesheet" type="text/css" href="http://llvm.org/llvm.css">
</head>
<body>
<div class="rel_title">
How to build LLVM Debian/Ubuntu packages from source?
</div>
<div class="rel_container">
<div class="rel_section">
Building the latest nightly snapshot
</div>
<div class="rel_boxtext">
<p>The latest nightly snapshot can be built with the following steps. First,
ensure you add to your <i>apt.sources</i> the <a href="./">nightly
repositories for your distribution</a>.</p>
<p>Use apt-get to retrieve the sources of the llvm-toolchain-snapshot
package,</p>
<p class="www_code">
$ mkdir build/ && cd build/ <br />
$ apt-get source llvm-toolchain-snapshot
</p>
<p>This should download all the original snapshot tarballs, and create a
directory named llvm-toolchain-snapshot-X.Y~++202.... Depending on the last
update of the jenkins nightly builder, the snapshot version number and git
hash will vary.</p>
<p>Then install the build dependencies,</p>
<p class="www_code"> $ sudo apt-get build-dep llvm-toolchain-snapshot </p>
<p>On older versions of Ubuntu, some build dependencies cannot be satisfied
because the required gcc versions are missing. To fix this issue you should add
the <a href="https://launchpad.net/~ubuntu-toolchain-r/+archive/ubuntu/ppa">Ubuntu
Toolchain PPA</a> to your system before executing the above command.</p>
<p>Once everything is ready, enter the directory and build the package,</p>
<p class="www_code">
$ cd llvm-toolchain-snapshot-X.Y~++202*/ <br />
$ debuild -us -uc -b
</p>
</div>
<div class="rel_section">
Building a snapshot package by hand
</div>
<div class="rel_boxtext">
<p>In some cases you may want to build a snapshot package manually. For example
to debug the Debian package scripts, or to build a package for a specific
development branch. In that scenario, follow the following steps:</p>
<ol>
<li><p>Clone the llvm-toolchain source package.</p>
<p>The source package is maintained in git, you can retrieve it using the
<i>debcheckout</i> command,</p>
<p class="www_code">
$ git clone https://salsa.debian.org/pkg-llvm-team/llvm-toolchain.git -b snapshot snapshot
</p></li>
<li><p>Retrieve the latest snapshot and create original tarballs.</p>
<p>Run the orig-tar.sh script,</p>
<p class="www_code">$ sh snapshot/debian/orig-tar.sh</p>
<p>which will retrieve the latest version for each LLVM subproject
(llvm, clang, lldb, etc.) from the git repository and repack
it as a set of tarballs.</p></li>
<li><p>Unpack the original tarballs and apply quilt Debian patches.</p>
<p>run the unpack.sh script,</p>
<p class="www_code">$ sh snapshot/debian/unpack.sh</p>
<p>which will unpack the source tree inside a new directory such as
<i>branches/llvm-toolchain-snapshot_X.Y~++200*</i>.
Depending on the current snapshot version number and git hash,
the directory name will be different. Quilt patches will then be
applied.</p></li>
<li><p>Build the binary packages using,</p>
<p class="www_code">$ debian/rules binary</p>
<p>When debugging, successive builds can be recompiled faster by using tools
such as ccache (PATH=/usr/lib/ccache:$PATH debian/rules
binary).</p></li>
</ol>
<h2>Retrieving a specific branch or release candidate with orig-tar.sh</h2>
<p>When using orig-tar.sh, if you need to retrieve a specific branch, you can
pass the branch name as the first argument. For example, to get the 13 release
branch at
<i>https://github.com/llvm/llvm-project/tree/release/13.x</i> you
should use,</p>
<p class="www_code">$ sh 13/debian/orig-tar.sh release/13.x</p>
<p>To retrieve a specific release candidate, you can pass the branch name as the
first argument, and the tag rc number as the second argument. For example, to
get the 13.0.1 release candidate rc3 at
<i>https://github.com/llvm/llvm-project/releases/tag/llvmorg-13.0.1-rc3</i>
you should use,</p>
<p class="www_code">$ sh 13/debian/orig-tar.sh 13.0.1 rc3</p>
<h2>Organization of the repository</h2>
<p>The Debian package for each LLVM point release is maintained as a separate
git branch. For example, the 3.8 release lives at 3.8.</p>
<p>The current snapshot release is maintained at branches/snapshot.</p> <h2>Organization of the repository</h2>
<h2>Clone all branches</h2>
<p>
<p class="www_code">
for f in 4.0 5.0 6.0 7.0 snapshot; do<br />
git clone [email protected]:pkg-llvm-team/llvm-toolchain.git -b $f $f;<br />
done
</p>
</p>
<h2>Additional maintainer scripts</h2>
<p>The script <i>qualify-clang.sh</i> that is found at the root should
be used to quickly test a newly built clang package. It runs a short set
of sanity-check tests.</p>
<p>The script <i>releases/snapshot/debian/prepare-new-release.sh</i> is used when
preparing a new point release. It automatically replaces version numbers in
various files of the package.</p>
</div>
<p style="font-size: smaller;">
Contact: <a href="mailto:[email protected]">Sylvestre Ledru</a>
<br />Build infra by <a href="http://www.irill.org/">IRILL</a> / Hosting by LLVM Foundation
</p>
</div> <!-- rel_container -->
</body>
</html>