1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
|
---|
3 | "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
|
---|
4 | <!ENTITY % general-entities SYSTEM "../../general.ent">
|
---|
5 | %general-entities;
|
---|
6 |
|
---|
7 | <!ENTITY cargo-download-http "https://github.com/rust-lang/cargo/archive/&cargo-version;/cargo-&cargo-version;.tar.gz">
|
---|
8 | <!ENTITY cargo-download-ftp " ">
|
---|
9 | <!ENTITY cargo-md5sum "c0bdbfdeead6a7cdfd7fbfe2183bfc61">
|
---|
10 | <!ENTITY cargo-size "624 KB">
|
---|
11 | <!ENTITY cargo-buildsize "129 MB plus extra 115 MB in ~/.cargo and 2.2GB for the testsuite">
|
---|
12 | <!ENTITY cargo-time "1.8 SBU plus 2.4 SBU for the testsuite on a machine with 4 cores">
|
---|
13 |
|
---|
14 | <!-- RUSTIDATE is deined in packages.ent -->
|
---|
15 | <!-- temporarily at higgs so people can download it -->
|
---|
16 | <!ENTITY rusti-download-http "&sources-anduin-http;/rust/rust-installer-&RUSTIDATE;.tar.xz">
|
---|
17 | <!ENTITY rusti-md5sum "8fb6c87f12d735b0a8bc1304d7640c69">
|
---|
18 | <!ENTITY rusti-size "18 KB">
|
---|
19 |
|
---|
20 | <!-- similarly, CARGOPREV is defined in packages.ent -->
|
---|
21 | <!ENTITY cargoprev64-download-http "https://static.rust-lang.org/dist/cargo-&CARGOPREV;-x86_64-unknown-linux-gnu.tar.gz">
|
---|
22 | <!ENTITY cargoprev64-md5sum "ad2b513d591f35271f1041e2e04f484c">
|
---|
23 | <!ENTITY cargoprev64-size "4.4 MB">
|
---|
24 | <!ENTITY cargoprev32-download-http "https://static.rust-lang.org/dist/cargo-&CARGOPREV;-i686-unknown-linux-gnu.tar.gz">
|
---|
25 | <!ENTITY cargoprev32-md5sum "24d4eda62991bfbaecb3a6d1e09df143">
|
---|
26 | <!ENTITY cargoprev32-size "4.3 MB">
|
---|
27 | ]>
|
---|
28 |
|
---|
29 | <sect1 id="cargo" xreflabel="cargo-&cargo-version;">
|
---|
30 | <?dbhtml filename="cargo.html"?>
|
---|
31 |
|
---|
32 |
|
---|
33 | <title>Cargo-&cargo-version;</title>
|
---|
34 |
|
---|
35 | <indexterm zone="cargo">
|
---|
36 | <primary sortas="a-cargo">Cargo</primary>
|
---|
37 | </indexterm>
|
---|
38 |
|
---|
39 | <sect2 role="package">
|
---|
40 | <title>Introduction to cargo</title>
|
---|
41 |
|
---|
42 | <para>
|
---|
43 | <application>Cargo</application> is the Package Manager for
|
---|
44 | <application>Rust</application>. Like that, during the build it uses
|
---|
45 | <command>curl</command> to download <filename>cargo</filename> files
|
---|
46 | which are actually <filename>.tar.gz</filename> source archives.
|
---|
47 | </para>
|
---|
48 |
|
---|
49 | <para>
|
---|
50 | This package requires internet access to build and at runtime (when
|
---|
51 | <command>rust</command> is compiling another package). It will use all
|
---|
52 | available cores. It also needs the current or previous version to compile
|
---|
53 | itself, so here a binary of the previous version is used to bootstrap.
|
---|
54 | </para>
|
---|
55 |
|
---|
56 | &lfs80_checked;
|
---|
57 |
|
---|
58 | <bridgehead renderas="sect3">Package Information</bridgehead>
|
---|
59 | <itemizedlist spacing="compact">
|
---|
60 | <listitem>
|
---|
61 | <para>
|
---|
62 | Download (HTTP): <ulink url="&cargo-download-http;"/>
|
---|
63 | </para>
|
---|
64 | </listitem>
|
---|
65 | <listitem>
|
---|
66 | <para>
|
---|
67 | Download (FTP): <ulink url="&cargo-download-ftp;"/>
|
---|
68 | </para>
|
---|
69 | </listitem>
|
---|
70 | <listitem>
|
---|
71 | <para>
|
---|
72 | Download MD5 sum: &cargo-md5sum;
|
---|
73 | </para>
|
---|
74 | </listitem>
|
---|
75 | <listitem>
|
---|
76 | <para>
|
---|
77 | Download size: &cargo-size;
|
---|
78 | </para>
|
---|
79 | </listitem>
|
---|
80 | <listitem>
|
---|
81 | <para>
|
---|
82 | Estimated disk space required: &cargo-buildsize;
|
---|
83 | </para>
|
---|
84 | </listitem>
|
---|
85 | <listitem>
|
---|
86 | <para>
|
---|
87 | Estimated build time: &cargo-time;
|
---|
88 | </para>
|
---|
89 | </listitem>
|
---|
90 | </itemizedlist>
|
---|
91 |
|
---|
92 | <bridgehead renderas="sect3">Additional Downloads</bridgehead>
|
---|
93 | <itemizedlist spacing="compact">
|
---|
94 | <listitem>
|
---|
95 | <para>Rust Installer:
|
---|
96 | <ulink url="&rusti-download-http;"/></para>
|
---|
97 | </listitem>
|
---|
98 | <listitem>
|
---|
99 | <para>Installer MD5 sum: &rusti-md5sum;</para>
|
---|
100 | </listitem>
|
---|
101 | <listitem>
|
---|
102 | <para>Installer size: &rusti-size;</para>
|
---|
103 | </listitem>
|
---|
104 | </itemizedlist>
|
---|
105 | <itemizedlist spacing="compact">
|
---|
106 | <listitem>
|
---|
107 | <para>Binary download (x86_64):
|
---|
108 | <ulink url="&cargoprev64-download-http;"/></para>
|
---|
109 | </listitem>
|
---|
110 | <listitem>
|
---|
111 | <para>Binary x86_64 MD5 sum: &cargoprev64-md5sum;</para>
|
---|
112 | </listitem>
|
---|
113 | <listitem>
|
---|
114 | <para>Binary x86_64 download size: &cargoprev64-size;</para>
|
---|
115 | </listitem>
|
---|
116 | </itemizedlist>
|
---|
117 | <itemizedlist spacing="compact">
|
---|
118 | <listitem>
|
---|
119 | <para>Binary download (i686):
|
---|
120 | <ulink url="&cargoprev32-download-http;"/></para>
|
---|
121 | </listitem>
|
---|
122 | <listitem>
|
---|
123 | <para>Binary i686 MD5 sum: &cargoprev32-md5sum;</para>
|
---|
124 | </listitem>
|
---|
125 | <listitem>
|
---|
126 | <para>Binary i686 download size: &cargoprev32-size;</para>
|
---|
127 | </listitem>
|
---|
128 | </itemizedlist>
|
---|
129 |
|
---|
130 | <bridgehead renderas="sect3">Cargo Dependencies</bridgehead>
|
---|
131 |
|
---|
132 | <bridgehead renderas="sect4">Required</bridgehead>
|
---|
133 | <para role="required">
|
---|
134 | <xref linkend="cmake"/>,
|
---|
135 | <xref linkend="rust"/>
|
---|
136 | </para>
|
---|
137 |
|
---|
138 | <bridgehead renderas="sect4">Optional</bridgehead>
|
---|
139 | <para role="optional">
|
---|
140 | <xref linkend="git"/>,
|
---|
141 | <xref linkend="openssl"/>
|
---|
142 | </para>
|
---|
143 |
|
---|
144 | <para condition="html" role="usernotes">
|
---|
145 | User Notes: <ulink url="&blfs-wiki;/cargo"/>
|
---|
146 | </para>
|
---|
147 | </sect2>
|
---|
148 |
|
---|
149 | <sect2 role="installation">
|
---|
150 | <title>Installation of cargo</title>
|
---|
151 |
|
---|
152 | <para>
|
---|
153 | Install <application>cargo</application> by running the following
|
---|
154 | commands:
|
---|
155 | </para>
|
---|
156 |
|
---|
157 | <screen><userinput>tar -xf ../rust-installer-&RUSTIDATE;.tar.xz \
|
---|
158 | --strip-components=1 --directory src/rust-installer &&
|
---|
159 |
|
---|
160 | case $(uname -m) in
|
---|
161 | x86_64) tar -xf ../cargo-&CARGOPREV;-x86_64-unknown-linux-gnu.tar.gz
|
---|
162 | ;;
|
---|
163 | i686) tar -xf ../cargo-&CARGOPREV;-i686-unknown-linux-gnu.tar.gz
|
---|
164 | ;;
|
---|
165 | esac &&
|
---|
166 |
|
---|
167 | ./configure --prefix=/usr \
|
---|
168 | --sysconfdir=/etc \
|
---|
169 | --docdir=/usr/share/doc/cargo-&cargo-version; \
|
---|
170 | --cargo=./cargo-nightly*/cargo/bin/cargo &&
|
---|
171 | make</userinput></screen>
|
---|
172 |
|
---|
173 | <para>
|
---|
174 | To test the results, issue: <command>CFG_DISABLE_CROSS_TESTS=1
|
---|
175 | ./target/*-unknown-linux-gnu/release/cargo test</command>.
|
---|
176 | </para>
|
---|
177 |
|
---|
178 | <para>
|
---|
179 | Now, as the <systemitem class="username">root</systemitem> user:
|
---|
180 | </para>
|
---|
181 |
|
---|
182 | <screen role="root"><userinput>make install &&
|
---|
183 | mv -v /usr/etc/bash_completion.d/cargo /etc/bash_completion.d</userinput></screen>
|
---|
184 | </sect2>
|
---|
185 |
|
---|
186 | <sect2 role="commands">
|
---|
187 | <title>Command Explanations</title>
|
---|
188 |
|
---|
189 | <para>
|
---|
190 | <command>tar -xf ../rust-installer-&RUSTIDATE;.tar.xz ...</command>:
|
---|
191 | The rust-installer is needed, but not shipped with
|
---|
192 | <application>cargo</application>, so BLFS provides a repackaged git
|
---|
193 | snapshot.
|
---|
194 | </para>
|
---|
195 |
|
---|
196 | <para>
|
---|
197 | <parameter>--cargo=</parameter>: This points to the binary of the previous
|
---|
198 | version, so that the package can be bootstrapped. When upgrading, or if
|
---|
199 | rebuilding, it is possible to use the current installed version without
|
---|
200 | this switch, but that takes longer and uses more space.
|
---|
201 | </para>
|
---|
202 |
|
---|
203 | <para>
|
---|
204 | <command>CFG_DISABLE_CROSS_TESTS=1 ...</command>: By default the tests
|
---|
205 | will try to cover cross-builds for other architectures, but BLFS only
|
---|
206 | installs <command>rust</command> for the host architecture. This switch
|
---|
207 | also points to where cargo has been created, using a wildcard to match the
|
---|
208 | one target-triple directory which has been created.
|
---|
209 | </para>
|
---|
210 |
|
---|
211 | <para>
|
---|
212 | <command>mv -v /usr/etc/bash_completion.d/cargo ...</command>: Cargo
|
---|
213 | accepts the sysconfdir switch but does not respect it. This fixes up the
|
---|
214 | misplaced file.
|
---|
215 | </para>
|
---|
216 | </sect2>
|
---|
217 |
|
---|
218 | <sect2 role="content">
|
---|
219 | <title>Contents</title>
|
---|
220 |
|
---|
221 | <segmentedlist>
|
---|
222 | <segtitle>Installed Program(s)</segtitle>
|
---|
223 | <segtitle>Installed Librar(y,ies)</segtitle>
|
---|
224 | <segtitle>Installed Director(y,ies)</segtitle>
|
---|
225 |
|
---|
226 | <seglistitem>
|
---|
227 | <seg>
|
---|
228 | cargo
|
---|
229 | </seg>
|
---|
230 | <seg>
|
---|
231 | None
|
---|
232 | </seg>
|
---|
233 | <seg>
|
---|
234 | /usr/share/doc/cargo-&cargo-version; and
|
---|
235 | /usr/share/zsh/site-functions.
|
---|
236 | </seg>
|
---|
237 | </seglistitem>
|
---|
238 | </segmentedlist>
|
---|
239 |
|
---|
240 | <variablelist>
|
---|
241 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
242 | <?dbfo list-presentation="list"?>
|
---|
243 | <?dbhtml list-presentation="table"?>
|
---|
244 |
|
---|
245 | <varlistentry id="cargo-prog">
|
---|
246 | <term><command>cargo</command></term>
|
---|
247 | <listitem>
|
---|
248 | <para>
|
---|
249 | is the Package Manager for Rust.
|
---|
250 | </para>
|
---|
251 | <indexterm zone="cargo cargo-prog">
|
---|
252 | <primary sortas="b-cargo">cargo</primary>
|
---|
253 | </indexterm>
|
---|
254 | </listitem>
|
---|
255 | </varlistentry>
|
---|
256 |
|
---|
257 | </variablelist>
|
---|
258 | </sect2>
|
---|
259 | </sect1>
|
---|