1
1
# Template file for 'rust'
2
2
pkgname=rust
3
- version=1.31.1
3
+ version=1.32.0
4
4
revision=1
5
- _rust_dist_version=1.31 .0
5
+ _rust_dist_version=1.32 .0
6
6
_cargo_dist_version=0.32.0
7
7
# NB. if you push any(!) new version, don't forget to put a build
8
8
# output of musl to https://alpha.de.repo.voidlinux.org/distfiles/
9
9
wrksrc="rustc-${version}-src"
10
- lib32disabled=yes
11
- patch_args="-Np1"
12
10
build_style=configure
11
+ # unset LDFLAGS, otherwise cross builds to the same arch will fail
13
12
make_build_args="dist VERBOSE=1"
14
13
hostmakedepends="cmake curl pkg-config python"
15
- makedepends="libffi-devel llvm ncurses-devel libxml2-devel zlib-devel"
14
+ makedepends="libffi-devel ncurses-devel libxml2-devel zlib-devel
15
+ $(vopt_if internal_llvm python-devel llvm)"
16
16
depends="rust-std"
17
17
short_desc="Safe, concurrent, practical systems language"
18
18
maintainer="Enno Boland <
[email protected] >"
19
- homepage="https://www.rust-lang.org/"
20
19
license="MIT, Apache-2.0"
20
+ homepage="https://www.rust-lang.org/"
21
21
distfiles="https://static.rust-lang.org/dist/rustc-${version}-src.tar.gz"
22
- checksum=91d2fc22f08d986adab7a54eb3a6a9b99e490f677d2d092e5b9e4e069c23686a
22
+ checksum=4c594c7712a0e7e8eae6526c464bf6ea1d82f77b4f61717c3fc28fb27ba2224a
23
+ lib32disabled=yes
24
+ patch_args="-Np1"
25
+
26
+ build_options="internal_llvm"
23
27
24
28
if [ "$CROSS_BUILD" ]; then
25
- hostmakedepends+=" cargo llvm"
29
+ hostmakedepends+=" cargo $(vopt_if internal_llvm '' llvm) "
26
30
27
31
# These are required for building the buildhost's stage0/1
28
32
hostmakedepends+=" libffi-devel libxml2-devel
36
40
https://alpha.de.repo.voidlinux.org/distfiles/rust-std-${_rust_dist_version}-x86_64-unknown-linux-musl.tar.xz
37
41
https://alpha.de.repo.voidlinux.org/distfiles/cargo-${_cargo_dist_version}-x86_64-unknown-linux-musl.tar.xz"
38
42
checksum+="
39
- 7ca7360b9243b7117bbb5281b563fdf2bfae61d223ad858199aabc438c828926
40
- b5cadf379e82905459dea5359c7111b30cfbba33a17b6960e3beb72ce79b7db9
43
+ 1fa1c8b4b976919e229c8f3ca070ed2235e6f1cecf4967041ef0b8a29a75d517
44
+ bfc82c04c46a58ae09be1f32a11a11000830c257969afbf2a270e6eb36d6533a
41
45
4dfb1cca7730b38920c04731be0e9d47ec520b3365059b4ccd9c0948346787ea"
42
46
;;
43
47
x86_64)
47
51
https://static.rust-lang.org/dist/rust-std-${_rust_dist_version}-x86_64-unknown-linux-gnu.tar.gz
48
52
https://static.rust-lang.org/dist/cargo-${_cargo_dist_version}-x86_64-unknown-linux-gnu.tar.xz"
49
53
checksum+="
50
- 5c4581f0fc05f0f5076db6231b0c1a4d27eb61c0b36bfb42d97243ad8f4e43a0
51
- fe67a62c7a63acbf2458a36d7689ef41903187a472f0c28850f1fca7ea478da8
54
+ 75c31f32e19548c1608611d08b82b87560e02f15caac7b2663a8189a4609977c
55
+ 9f2705a3ed3217c13fd55569406c52f590030752f57520312e135223ae930caf
52
56
7e46150e431eaafef9439c9cd958aa8d980a0a70f0bb052473f0a75023930dcc"
53
57
;;
54
58
i686)
58
62
https://static.rust-lang.org/dist/rust-std-${_rust_dist_version}-i686-unknown-linux-gnu.tar.gz
59
63
https://static.rust-lang.org/dist/cargo-${_cargo_dist_version}-i686-unknown-linux-gnu.tar.xz"
60
64
checksum+="
61
- 549116e23dce8687f69327f5ea2c717c93175d24d82d456fab37160f800f8ce8
62
- 14de38321f6f2c64496e77bac793ad5511d37696b9c33283bb6f395dc590c4d9
65
+ 45e633c985c259a13d3b096662241bd8255a86ed4917e0fec396e7071c04c734
66
+ 69bd6064f605c1d0d7d41070efea1e329d75755b04fbc5a13ffc53efdc3a97c7
63
67
200cf76636ccbb153d5c430a5c0f3ad5af206899f76470e3cd046679a5a4ab3f"
64
68
;;
69
+ ppc64le)
70
+ distfiles+="
71
+ https://static.rust-lang.org/dist/rustc-${_rust_dist_version}-powerpc64le-unknown-linux-gnu.tar.xz
72
+ https://static.rust-lang.org/dist/rust-std-${_rust_dist_version}-powerpc64le-unknown-linux-gnu.tar.xz
73
+ https://void-ppc64.octaforge.org/distfiles/cargo-${_cargo_dist_version}-powerpc64le-unknown-linux-gnu.tar.xz"
74
+ checksum+="
75
+ e41bce347e11e9c4868fec2892778e51ed8f3383bd6ee59dd991376c1dea56a9
76
+ b281c20115467429573da6b2b5b7a8863f29e203d7919989e71d91e6914d3bbe
77
+ bf426e52beb08e0f663b00b23a89053e713ec15c8e6d69b3f5ae85fe23ad7e18"
78
+ ;;
79
+ ppc64le-musl)
80
+ distfiles+="
81
+ https://void-ppc64.octaforge.org/distfiles/rustc-${_rust_dist_version}-powerpc64le-unknown-linux-musl.tar.xz
82
+ https://void-ppc64.octaforge.org/distfiles/rust-std-${_rust_dist_version}-powerpc64le-unknown-linux-musl.tar.xz
83
+ https://void-ppc64.octaforge.org/distfiles/cargo-${_cargo_dist_version}-powerpc64le-unknown-linux-musl.tar.xz"
84
+ checksum+="
85
+ bacb713d86be555af4410d685aab475ac63ad66e358f6b00c058253fba275187
86
+ 24b6b79356c7bf113ad34f43c14a7a6cec92b9008b05ab58624ce7a353b0e6d0
87
+ d9d91997a781753474e89dbb9b7dbbef2f6cfad9387def076d51d654f6bc21fa"
88
+ ;;
89
+ ppc64-musl)
90
+ distfiles+="
91
+ https://void-ppc64.octaforge.org/distfiles/rustc-${_rust_dist_version}-powerpc64-unknown-linux-musl.tar.xz
92
+ https://void-ppc64.octaforge.org/distfiles/rust-std-${_rust_dist_version}-powerpc64-unknown-linux-musl.tar.xz
93
+ https://void-ppc64.octaforge.org/distfiles/cargo-${_cargo_dist_version}-powerpc64-unknown-linux-musl.tar.xz"
94
+ checksum+="
95
+ fd090e1329687c1b8e3320b40f0b13640444f93cbb7c235d8491c140337c27df
96
+ 791d046ecb3203d90263cddb5f53eafdeb042a55923fea35bbb8db223c892603
97
+ ec846d1e9674f60dbd4416d54f74a618288114cea4907b61363adc71b3c8c26f"
98
+ ;;
65
99
esac
66
100
fi
67
101
68
102
# In rust terminology 'build' is the build host ($CBUILD) and `target`
69
103
# and `host` are the triplets that are supposed to run the built binaries
70
104
# ($CTARGET)
71
105
case $XBPS_MACHINE in
106
+ ppc64le) _build_triplet=powerpc64le-unknown-linux-gnu;;
107
+ ppc64le-musl) _build_triplet=powerpc64le-unknown-linux-musl;;
108
+ ppc64-musl) _build_triplet=powerpc64-unknown-linux-musl;;
72
109
*-musl) _build_triplet=${XBPS_MACHINE%-musl}-unknown-linux-musl;;
73
110
*) _build_triplet=${XBPS_MACHINE}-unknown-linux-gnu;;
74
111
esac
75
112
76
113
post_extract() {
77
- rm -rf src/llvm
114
+ if [ "$build_option_internal_llvm" ]; then
115
+ # patches for Rust's bundled LLVM
116
+ pushd src/llvm
117
+ for x in ${FILESDIR}/patches/internal_llvm/llvm-*.patch; do
118
+ msg_normal "Applying $x to llvm\n"
119
+ patch -sNp1 -i ${x}
120
+ done
121
+ popd
122
+ else
123
+ rm -rf src/llvm
124
+ # patches for system LLVM
125
+ for x in ${FILESDIR}/patches/sys-llvm/*.patch; do
126
+ msg_normal "Applying patch $x\n"
127
+ patch -sNp1 -i ${x}
128
+ done
129
+ fi
78
130
79
131
if [ -z "$CROSS_BUILD" ]; then
80
132
mkdir -p stage0
@@ -83,7 +135,7 @@ post_extract() {
83
135
rm ../rust-std-*/rust-std-*/manifest.in
84
136
cp -bflr ../rust-std-*/rust-std-*/* stage0
85
137
case "$XBPS_MACHINE" in
86
- *-musl) cp -bflr ../cargo stage0/bin;;
138
+ *-musl|ppc64* ) cp -bflr ../cargo stage0/bin;;
87
139
*)
88
140
rm ../cargo-*/cargo/manifest.in
89
141
cp -flr ../cargo-*/cargo/* stage0
@@ -107,14 +159,15 @@ do_configure() {
107
159
--disable-rpath
108
160
--disable-docs
109
161
--disable-codegen-tests
110
- --llvm-root=/usr
111
- --set=target.${_build_triplet}.llvm-config=/usr/bin/llvm-config
112
162
"
113
163
114
- # Disable jemalloc for now. It increases the size of small programs
115
- # significantly (hello world without jemalloc 130KB vs with jemalloc
116
- # 300KB) and provides worse performance in some cases.
117
- configure_args+=" --disable-jemalloc"
164
+ if ! [ "$build_option_internal_llvm" ]; then
165
+ configure_args+="
166
+ --llvm-root=/usr
167
+ --set=target.${_build_triplet}.llvm-config=/usr/bin/llvm-config
168
+ --set=target.${RUST_TARGET}.llvm-config=/usr/bin/llvm-config
169
+ "
170
+ fi
118
171
119
172
if [ "$CROSS_BUILD" ]; then
120
173
configure_args+="
@@ -129,12 +182,6 @@ do_configure() {
129
182
--set=target.${_build_triplet}.ar=${AR_host}
130
183
--set=target.${_build_triplet}.linker=${CC_host}
131
184
"
132
-
133
- # Set 'llvm-config' for the cross target (host) so that we don't build
134
- # LLVM for it again.
135
- configure_args+="
136
- --set=target.${RUST_TARGET}.llvm-config="/usr/bin/llvm-config"
137
- "
138
185
else
139
186
configure_args+=" --local-rust-root=$wrksrc/stage0"
140
187
fi
@@ -161,7 +208,7 @@ pre_build() {
161
208
# for it during stage1. Otherwise it attemps to use CFLAGS, which are the CFLAGS
162
209
# of the cross host.
163
210
do_build() {
164
- env CFLAGS_${_build_triplet}="${CFLAGS_host}" make ${makejobs} ${make_build_args}
211
+ env CFLAGS_${_build_triplet}="${CFLAGS_host}" LDFLAGS='' make ${makejobs} ${make_build_args}
165
212
}
166
213
167
214
do_install() {
0 commit comments