blob: f8a51a87f5fc4d5cdeb28c095a274fb1c76f0d41 (
plain) (
blame)
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
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
|
# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Contributor: Shiz <hi@shiz.me>
# Contributor: Jeizsm <jeizsm@gmail.com>
# Maintainer: Samuel Holland <samuel@sholland.org>
pkgname=rust
pkgver=1.30.1
_bootcargover=0.30.0
_bootver=1.29.2
_llvmver=6
pkgrel=0
pkgdesc="The Rust Programming Language"
url="https://www.rust-lang.org"
arch="all"
license="(Apache-2.0 OR MIT) AND (NCSA OR MIT) AND BSD-2-Clause AND BSD-3-Clause"
depends="$pkgname-stdlib=$pkgver-r$pkgrel gcc musl-dev"
makedepends="
curl-dev
libgit2-dev
libssh2-dev
llvm$_llvmver-dev
llvm$_llvmver-test-utils
openssl-dev
python3
zlib-dev
"
subpackages="
$pkgname-dbg
$pkgname-stdlib
$pkgname-analysis
$pkgname-doc
$pkgname-gdb::noarch
$pkgname-lldb::noarch
$pkgname-src::noarch
cargo
cargo-clippy:_cargo_clippy
cargo-fmt:_cargo_fmt
cargo-doc:_cargo_doc:noarch
cargo-bash-completion:_cargo_bashcomp:noarch
cargo-zsh-completion:_cargo_zshcomp:noarch
rls
rustfmt
"
source="https://static.rust-lang.org/dist/rustc-$pkgver-src.tar.xz
https://distfiles.adelielinux.org/source/rust/cargo-$_bootcargover-$CBUILD.tar.xz
https://distfiles.adelielinux.org/source/rust/rust-std-$_bootver-$CBUILD.tar.xz
https://distfiles.adelielinux.org/source/rust/rustc-$_bootver-$CBUILD.tar.xz
0001-Don-t-pass-CFLAGS-to-the-C-compiler.patch
0002-Fix-LLVM-build.patch
0003-Allow-rustdoc-to-work-when-cross-compiling-on-musl.patch
0004-Require-static-native-libraries-when-linking-static-.patch
0005-Remove-nostdlib-and-musl_root-from-musl-targets.patch
0006-Prefer-libgcc_eh-over-libunwind-for-musl.patch
0007-Add-powerpc-unknown-linux-musl-target.patch
0008-Fix-powerpc64-ELFv2-big-endian-struct-passing-ABI.patch
0009-Use-the-ELFv2-ABI-on-powerpc64-musl.patch
0010-Add-powerpc64-unknown-linux-musl-target.patch
0011-Add-missing-OpenSSL-configurations-for-musl-targets.patch
0012-rustc_data_structures-use-libc-types-constants-in-fl.patch
0013-runtest-Fix-proc-macro-tests-on-musl-hosts.patch
0014-Fix-double_check-tests-on-big-endian-targets.patch
0015-test-invalid_const_promotion-Accept-SIGTRAP-as-a-val.patch
0016-test-linkage-visibility-Ensure-symbols-are-visible-t.patch
0017-x.py-Use-python3-instead-of-python.patch
0018-test-target-feature-gate-Only-run-on-relevant-target.patch
0019-test-use-extern-for-plugins-Don-t-assume-multilib.patch
0020-test-sysroot-crates-are-unstable-Fix-test-when-rpath.patch
0021-Ignore-broken-and-non-applicable-tests.patch
0022-Link-stage-2-tools-dynamically-to-libstd.patch
0023-Move-debugger-scripts-to-usr-share-rust.patch
0024-Add-foxkit-target-specs.patch
0030-liblibc-linkage.patch
0031-liblibc-1b130d4c349d.patch
0040-rls-atomics.patch
"
builddir="$srcdir/rustc-$pkgver-src"
_rlibdir="/usr/lib/rustlib/$CTARGET/lib"
prepare() {
cd "$builddir"
default_prepare
$srcdir/cargo-$_bootcargover-$CBUILD/install.sh \
--destdir=$srcdir/prebuilt \
--prefix=/ \
--disable-ldconfig
$srcdir/rust-std-$_bootver-$CBUILD/install.sh \
--destdir=$srcdir/prebuilt \
--prefix=/ \
--disable-ldconfig
$srcdir/rustc-$_bootver-$CBUILD/install.sh \
--destdir=$srcdir/prebuilt \
--prefix=/ \
--disable-ldconfig
}
build() {
cd "$builddir"
cat > config.toml <<- EOF
[build]
build = "$CBUILD"
host = [ "$CHOST" ]
target = [ "$CTARGET" ]
cargo = "$srcdir/prebuilt/bin/cargo"
rustc = "$srcdir/prebuilt/bin/rustc"
submodules = false
python = "python3"
locked-deps = true
vendor = true
extended = true
tools = [ "analysis", "cargo", "clippy", "rls", "rustfmt", "src" ]
[install]
prefix = "/usr"
[rust]
codegen-units = 1
debuginfo = true
debuginfo-lines = true
debuginfo-only-std = false
debuginfo-tools = true
use-jemalloc = false
backtrace = true
channel = "stable"
rpath = false
[target.$CTARGET]
cc = "$CTARGET-gcc"
cxx = "$CTARGET-g++"
linker = "$CTARGET-gcc"
llvm-config = "/usr/lib/llvm$_llvmver/bin/llvm-config"
crt-static = false
EOF
LIBGIT2_SYS_USE_PKG_CONFIG=1 \
LLVM_LINK_SHARED=1 \
RUST_BACKTRACE=1 \
./x.py build -j ${JOBS:-2}
}
check() {
cd "$builddir"
./x.py test -j ${JOBS:-2} --no-doc --no-fail-fast \
src/test/codegen \
src/test/codegen-units \
src/test/compile-fail \
src/test/compile-fail-fulldeps \
src/test/incremental \
src/test/incremental-fulldeps \
src/test/mir-opt \
src/test/parse-fail \
src/test/pretty \
src/test/run-fail \
src/test/run-fail/pretty \
src/test/run-fail-fulldeps \
src/test/run-fail-fulldeps/pretty \
src/test/run-make \
src/test/run-make-fulldeps \
src/test/run-pass \
src/test/run-pass/pretty \
src/test/run-pass-fulldeps \
src/test/run-pass-fulldeps/pretty \
src/test/ui \
src/test/ui-fulldeps
}
package() {
cd "$builddir"
DESTDIR="$pkgdir" ./x.py install
rm "$pkgdir"/usr/lib/*.so \
"$pkgdir"/usr/lib/rustlib/components \
"$pkgdir"/usr/lib/rustlib/install.log \
"$pkgdir"/usr/lib/rustlib/manifest-* \
"$pkgdir"/usr/lib/rustlib/rust-installer-version \
"$pkgdir"/usr/lib/rustlib/uninstall.sh \
"$pkgdir"/usr/share/doc/rust/*.old
}
stdlib() {
pkgdesc="Standard library for Rust"
depends="musl-utils"
_mv "$pkgdir"$_rlibdir/*.so "$subpkgdir"$_rlibdir
mkdir -p "$subpkgdir"/etc/ld.so.conf.d
echo "$_rlibdir" > "$subpkgdir"/etc/ld.so.conf.d/$pkgname.conf
}
analysis() {
pkgdesc="Compiler analysis data for the Rust standard library"
depends="$pkgname=$pkgver-r$pkgrel $pkgname-stdlib=$pkgver-r$pkgrel"
_mv "$pkgdir"${_rlibdir%/*}/analysis "$subpkgdir"${_rlibdir%/*}
}
gdb() {
pkgdesc="GDB pretty printers for Rust"
license="Apache-2.0 OR MIT"
depends="$pkgname gdb"
install_if="$pkgname=$pkgver-r$pkgrel gdb"
_mv "$pkgdir"/usr/bin/rust-gdb "$subpkgdir"/usr/bin
_mv "$pkgdir"/usr/share/rust/gdb_*.py "$subpkgdir"/usr/share/rust || true
}
lldb() {
pkgdesc="LLDB pretty printers for Rust"
license="Apache-2.0 OR MIT"
depends="$pkgname lldb py3-lldb"
install_if="$pkgname=$pkgver-r$pkgrel lldb"
_mv "$pkgdir"/usr/bin/rust-lldb "$subpkgdir"/usr/bin
_mv "$pkgdir"/usr/share/rust/lldb_*.py "$subpkgdir"/usr/share/rust || true
}
src() {
pkgdesc="$pkgdesc (source code)"
depends=""
_mv "$pkgdir"/usr/lib/rustlib/src/rust "$subpkgdir"/usr/src
rmdir -p "$pkgdir"/usr/lib/rustlib/src 2>/dev/null || true
mkdir -p "$subpkgdir"/usr/lib/rustlib/src
ln -s ../../../src/rust "$subpkgdir"/usr/lib/rustlib/src/rust
}
cargo() {
pkgdesc="The Rust package manager"
depends="$pkgname-stdlib=$pkgver-r$pkgrel $pkgname"
_mv "$pkgdir"/usr/bin/cargo "$subpkgdir"/usr/bin
}
_cargo_clippy() {
pkgdesc="A collection of Rust lints (cargo plugin)"
depends="$pkgname-stdlib=$pkgver-r$pkgrel cargo"
_mv "$pkgdir"/usr/bin/cargo-clippy \
"$pkgdir"/usr/bin/clippy-driver \
"$subpkgdir"/usr/bin
}
_cargo_fmt() {
pkgdesc="Format Rust code (cargo plugin)"
depends="$pkgname-stdlib=$pkgver-r$pkgrel cargo rustfmt"
install_if="cargo=$pkgver-r$pkgrel rustfmt=$pkgver-r$pkgrel"
_mv "$pkgdir"/usr/bin/cargo-fmt "$subpkgdir"/usr/bin
}
_cargo_bashcomp() {
pkgdesc="Bash completion for cargo"
license="Apache-2.0 OR MIT"
depends=""
install_if="cargo=$pkgver-r$pkgrel bash-completion"
_mv "$pkgdir"/etc/bash_completion.d/cargo \
"$subpkgdir"/usr/share/bash-completion/completions
rmdir -p "$pkgdir"/etc/bash_completion.d 2>/dev/null || true
}
_cargo_zshcomp() {
pkgdesc="ZSH completion for cargo"
license="Apache-2.0 OR MIT"
depends=""
install_if="cargo=$pkgver-r$pkgrel zsh"
_mv "$pkgdir"/usr/share/zsh/site-functions/_cargo \
"$subpkgdir"/usr/share/zsh/site-functions/_cargo
rmdir -p "$pkgdir"/usr/share/zsh/site-functions 2>/dev/null || true
}
_cargo_doc() {
pkgdesc="The Rust package manager (documentation)"
license="Apache-2.0 OR MIT"
depends=""
install_if="cargo=$pkgver-r$pkgrel docs"
# XXX: This is hackish!
_mv "$pkgdir"/../$pkgname-doc/usr/share/man/man1/cargo* \
"$subpkgdir"/usr/share/man/man1
}
rls() {
pkgdesc="The Rust language server"
license="Apache-2.0 OR MIT"
depends="$pkgname-stdlib=$pkgver-r$pkgrel"
_mv "$pkgdir"/usr/bin/rls "$subpkgdir"/usr/bin
}
rustfmt() {
pkgdesc="Format Rust code"
depends="$pkgname-stdlib=$pkgver-r$pkgrel"
_mv "$pkgdir"/usr/bin/rustfmt "$subpkgdir"/usr/bin
}
_mv() {
local dest; for dest; do true; done # get last argument
mkdir -p "$dest"
mv "$@"
}
sha512sums="e466db81b9a82239670c48b876dc7390fcdda28c6390308691ddf2e0c12a39b57bd5ddb18322d1b4cd58165f69a666c7d83bee6573049da3b94e401657459bf5 rustc-1.30.1-src.tar.xz
0f7c92e69f15cb014a1a6c263df2d0675842db9a3789467aa0d8811130adb1ffb3e0a344cfb59c069f5aa0f99b1f2422536ec96064b71374a3077b3a2a02d0fa cargo-0.30.0-powerpc64-foxkit-linux-musl.tar.xz
95f447bd698177732f4105ddcf4e60d5695a4345f6eb49d5d49ff2402de6d28199ca1aba1a630088beee40b8063477bed4dd47532c53cbb72de3ee5687a9c689 rust-std-1.29.2-powerpc64-foxkit-linux-musl.tar.xz
a140b9f524205a756192fed740492bbc01205ce77196dd44244752a99d8e6ede03cb9b8ef0d986e23ea882ebf24e773d6e426054c5840989379d81427ad37f07 rustc-1.29.2-powerpc64-foxkit-linux-musl.tar.xz
4ffea7a1e90eed9a69630ea2724450ffc5012593050c0109fff45dc70aec6d5b215f52777d4ecb72a6a78e2ba7ac0bea9117b68adc0e729ae482749462f0a83a 0001-Don-t-pass-CFLAGS-to-the-C-compiler.patch
e87a7ac69a007cc21cbdd6a8ec36003989803be55f1f96a5866ff07b113286ecc6fb9cec6614b1b5e63ca07b84d6c167b1e3d2bd1e104dab02d24597a176b31d 0002-Fix-LLVM-build.patch
03c3edd924a8751407c41a9ab67b5d2848e56c5b3da3556d1f83b72d33e982c97dabbec36a8ab4f8ec22143efeb2c77fabc922c9b0f11fee02c6f04868d2d90b 0003-Allow-rustdoc-to-work-when-cross-compiling-on-musl.patch
2a8b1f4d5f3ff49d74b2308cf8e4e6e04d0af0f9a7d29b3ae25c94c24ded7ce59f16b5277ec946f1a5fa61dcac857a897b63883d8f5ed753ba36f109498aee80 0004-Require-static-native-libraries-when-linking-static-.patch
1c41ff8163119c49116a7c6a1e4934fcfac36ad6240672ebded65e04dd478d86cb2627f47ae0b7871435bf8b30844fa10caaec03d2d3d27313b777b7be22bc4e 0005-Remove-nostdlib-and-musl_root-from-musl-targets.patch
58c14405cd27d3f825689d8df06f04cebf8b149132ede3317915059dbca2eb9599eb224105f4120a75df52bdc0e77a6412bf3a34f803752787c7bd3a25622046 0006-Prefer-libgcc_eh-over-libunwind-for-musl.patch
8cfb9ce9bdbf5ff75e85780af202caa431408d362a8e1f3119975275e00dfa8dc5724146625dc04ad9c31bb061d141857f693e4fb7611330e42277faa9a0f83e 0007-Add-powerpc-unknown-linux-musl-target.patch
b9f9cb032805614c7d30d426a8e1ce0d83658175bc1d173946673b614a3577abf89ae029a91ec8d55e77114fc45a48db4f750fd95294259f19ef1e60431ad8d7 0008-Fix-powerpc64-ELFv2-big-endian-struct-passing-ABI.patch
c5b1315ac9c622d32e9721cb807971fada8187a097be9923f09556da4828aa780b51509a7d95b3f2debd91a1a4ea1ecd40c641f23b426a2586a2a48a78671280 0009-Use-the-ELFv2-ABI-on-powerpc64-musl.patch
ed231ff4bfa3e4fd7dfb185f0af347ef6fe40d4c788ee38f064a8b6ebcb0767565a94cd4759664864b5c70508bd5e60008dde94b35d67a800baae118a351419c 0010-Add-powerpc64-unknown-linux-musl-target.patch
5a32ed9c224765a44635ff88f9d1d071868b27417d1a60c1f9db40d1557d8152f8858c760cda638952aa2c13ffd412aac516833460975339de5d0b79345a4d2c 0011-Add-missing-OpenSSL-configurations-for-musl-targets.patch
27f71d6849abb00a788326e28b01f92e238101b2cb9270275b6bd6042c38138fc92faf2ed9df1e3658ebb74686058ef748fdf9c6f211f38fa786355830552dba 0012-rustc_data_structures-use-libc-types-constants-in-fl.patch
d3b595f6d4561594efa170ce737f9b330d540a617272baaf8f7a22494fc15bfbdb3b0bfc381a50995ac79d99fbf11a7f786ffa71f8d88701ba1b247a2bb5fd3a 0013-runtest-Fix-proc-macro-tests-on-musl-hosts.patch
b8d62857b0260fe2566757686c9346245df2977aa8b09713e66f3d6626a5493fa23cbb80576627d4ce3b164ec6aabd2a3281c109a68bd5494a42a0fc1e786fe8 0014-Fix-double_check-tests-on-big-endian-targets.patch
cd9c0ab80c111b7a30d1d7887e746ff095083a31570723bd316e1f2772303484cf18f418368205585d86e6f142b2e102d34131990fcc5af0010e2b10237911ad 0015-test-invalid_const_promotion-Accept-SIGTRAP-as-a-val.patch
cd7894b166d230713e2bd55ffa8edcc91626170439e956ce87e0fead4ae80fcf20770a611f6ac0b0b5f12008f8d3d31bb36d708d7b970fb800d39b9056cd0f65 0016-test-linkage-visibility-Ensure-symbols-are-visible-t.patch
fbed66fd91f86ab24315170003bdb15d083de41b284fc20ada5d26c71a11b60ee9d2040b1ce5688801d02a2c4f0b183bd02444f7f7265ed0070ac083e293b7b4 0017-x.py-Use-python3-instead-of-python.patch
9a466ada691a3b05801bdfd6af3416817cc9bb9cc3018ec5bda47f7cbe2475f13b1928be5a34f919d34a1e304595c06a98ca337d259c17a2813a01ca38264734 0018-test-target-feature-gate-Only-run-on-relevant-target.patch
841c6f67f01a3e0714ae46b3ab14de6bb072bf9fbdc10e9b58eb0b0102786cad5667356fafa51e03eadcf12c0f5efe85106ef1b325906a3a4cb6a009cacc6f34 0019-test-use-extern-for-plugins-Don-t-assume-multilib.patch
e3f7b9d7b605156d14afc7e6012f0b19053eb4cf23d2f708860fb5de7390bb245910a03d844ba0dce933dddff8bac015361435cdfb8ce695687994344a2542c2 0020-test-sysroot-crates-are-unstable-Fix-test-when-rpath.patch
34ba04178ddd3f8d632ff45a274b4a4352fdc867829aee9635bd26224c49728e7c46e683f814fce09b11d6e30e3739bc7098cb4bb48fa97785570cf19c763dd2 0021-Ignore-broken-and-non-applicable-tests.patch
3e298b3040e5a5ae2ac794d375302d7277d59758101831ca3646c40f3eea42454a3a8793a2a41879dfdf623f63603815b0923209b0068170d63c9d28580c1228 0022-Link-stage-2-tools-dynamically-to-libstd.patch
86be931b629a5212be2821c918d95753686afa5ac9923f234186bd460545d094c38d63c680aa32dd1f90ae2a477f06bbe4343fbfa6a3d02ad43e6bdd3d3f4f9f 0023-Move-debugger-scripts-to-usr-share-rust.patch
5ce1947cdd51d5221c03fefe1d2bef8700b560a889e09ec7a3e7d906146111049864c9ed5688005e215a18f1102a01f3987db606d4a9a05ec83f1619d1d901e9 0024-Add-foxkit-target-specs.patch
f94abe390798b968bccfba1c908ab5895220ed0d167314b790a9c28b10cac81fb2e3b08760b4e8551ad5a5d02cd052d3d0d647ad8f8634e97f4d3b0470a21c42 0030-liblibc-linkage.patch
ba7b8c3504b7d24d6686d2dea2819d2def75c268848128a7beb63108f9a4e5610352ef5bdda7a9956193f0786c3bdd9ea39eedd6fe733e6243b08af36810ed24 0031-liblibc-1b130d4c349d.patch
41ab9d6f361ee2fba267c9836c1a382dc86101d1bfb59cd942be8e8fc526ad65d845c9395cba7f760808d345d107f32e75af9057d67c450b8fbdd8a73636fb2e 0040-rls-atomics.patch"
|