1 |
akien |
1085562 |
# (akien) This package is synced with Fedora / Josh Stone's spec. |
2 |
akien |
1057871 |
# The aim is to work with them on a rust packaging policy we could share, |
3 |
|
|
# so that we can ensure a good packaging and share the workload. |
4 |
thatsamguy |
617730 |
|
5 |
thatsamguy |
494699 |
|
6 |
akien |
1076532 |
# Only x86_64 and i686 are Tier 1 platforms at this time. |
7 |
|
|
# https://forge.rust-lang.org/platform-support.html |
8 |
akien |
1192969 |
%global rust_arches x86_64 i686 i586 armv7hl aarch64 ppc64 ppc64le s390x |
9 |
akien |
1076532 |
|
10 |
akien |
1057871 |
# The channel can be stable, beta, or nightly |
11 |
|
|
%{!?channel: %global channel stable} |
12 |
thatsamguy |
494699 |
|
13 |
akien |
1057871 |
# To bootstrap from scratch, set the channel and date from src/stage0.txt |
14 |
|
|
# e.g. 1.10.0 wants rustc: 1.9.0-2016-05-24 |
15 |
|
|
# or nightly wants some beta-YYYY-MM-DD |
16 |
akien |
1208625 |
%global bootstrap_rust 1.23.0 |
17 |
|
|
%global bootstrap_cargo 0.24.0 |
18 |
akien |
1093561 |
%global bootstrap_channel %{bootstrap_rust} |
19 |
akien |
1208625 |
%global bootstrap_date 2018-01-04 |
20 |
akien |
1057871 |
|
21 |
akien |
1076532 |
# Only the specified arches will use bootstrap binaries. |
22 |
|
|
#global bootstrap_arches %%{rust_arches} |
23 |
|
|
|
24 |
akien |
1062905 |
# We generally don't want llvm-static present at all, since llvm-config will |
25 |
|
|
# make us link statically. But we can opt in, e.g. to aid LLVM rebases. |
26 |
akien |
1066912 |
# FIXME: LLVM 3.9 prefers shared linking now! Which is good, but next time we |
27 |
|
|
# *want* static we'll have to force it with "llvm-config --link-static". |
28 |
|
|
# See also https://github.com/rust-lang/rust/issues/36854 |
29 |
akien |
1085562 |
# The new rustbuild accepts `--enable-llvm-link-shared`, else links static. |
30 |
akien |
1062905 |
%bcond_with llvm_static |
31 |
|
|
|
32 |
akien |
1085562 |
# We can also choose to just use Rust's bundled LLVM, in case the system LLVM |
33 |
akien |
1208625 |
# is insufficient. Rust currently requires LLVM 3.9+. |
34 |
|
|
%if 0%{?rhel} && !0%{?epel} |
35 |
akien |
1085562 |
%bcond_without bundled_llvm |
36 |
|
|
%else |
37 |
|
|
%bcond_with bundled_llvm |
38 |
|
|
%endif |
39 |
akien |
1076532 |
|
40 |
akien |
1098716 |
# LLDB only works on some architectures |
41 |
|
|
%ifarch %{arm} aarch64 %{ix86} x86_64 |
42 |
akien |
1093561 |
# LLDB isn't available everywhere... |
43 |
akien |
1098716 |
%if !0%{?rhel} |
44 |
|
|
%bcond_without lldb |
45 |
|
|
%else |
46 |
akien |
1093561 |
%bcond_with lldb |
47 |
akien |
1098716 |
%endif |
48 |
akien |
1093561 |
%else |
49 |
akien |
1098716 |
%bcond_with lldb |
50 |
akien |
1093561 |
%endif |
51 |
akien |
1085562 |
|
52 |
akien |
1093561 |
|
53 |
akien |
1098716 |
|
54 |
akien |
1057871 |
Name: rust |
55 |
akien |
1208625 |
Version: 1.24.1 |
56 |
akien |
1209449 |
Release: %mkrel 2 |
57 |
akien |
1057871 |
Summary: The Rust Programming Language |
58 |
akien |
1085562 |
%if 0%{?mageia} |
59 |
akien |
1076533 |
Group: Development/Other |
60 |
akien |
1085562 |
%endif |
61 |
akien |
1057871 |
License: (ASL 2.0 or MIT) and (BSD and ISC and MIT) |
62 |
|
|
# ^ written as: (rust itself) and (bundled libraries) |
63 |
|
|
URL: https://www.rust-lang.org |
64 |
akien |
1076532 |
ExclusiveArch: %{rust_arches} |
65 |
akien |
1057871 |
|
66 |
|
|
%if "%{channel}" == "stable" |
67 |
akien |
1085562 |
%global rustc_package rustc-%{version}-src |
68 |
akien |
1057871 |
%else |
69 |
akien |
1085562 |
%global rustc_package rustc-%{channel}-src |
70 |
akien |
1057871 |
%endif |
71 |
akien |
1130315 |
Source0: https://static.rust-lang.org/dist/%{rustc_package}.tar.xz |
72 |
akien |
1057871 |
|
73 |
akien |
1208625 |
# https://github.com/WebAssembly/binaryen/pull/1400 |
74 |
|
|
Patch1: 0001-Fix-Wcatch-value-from-GCC-8.patch |
75 |
akien |
1192548 |
|
76 |
akien |
1208625 |
# https://github.com/rust-lang/rust/pull/47610 |
77 |
|
|
Patch2: 0001-Update-DW_OP_plus-to-DW_OP_plus_uconst.patch |
78 |
|
|
|
79 |
|
|
# https://github.com/rust-lang/rust/pull/47688 |
80 |
|
|
Patch3: 0001-Let-LLVM-5-add-DW_OP_deref-to-indirect-args-itself.patch |
81 |
|
|
|
82 |
|
|
# https://github.com/rust-lang/rust/pull/47884 |
83 |
|
|
Patch4: 0001-Ignore-run-pass-sse2-when-using-system-LLVM.patch |
84 |
|
|
|
85 |
|
|
# https://github.com/rust-lang/rust/pull/47912 |
86 |
|
|
Patch5: 0001-Enable-stack-probe-tests-with-system-LLVM-5.0.patch |
87 |
|
|
Patch6: 0002-Use-a-range-to-identify-SIGSEGV-in-stack-guards.patch |
88 |
|
|
|
89 |
|
|
# fix for https://github.com/rust-lang/rust/issues/47469 |
90 |
|
|
# via https://github.com/rust-lang/rust/pull/46592 |
91 |
|
|
Patch7: rust-pr46592-bootstrap-libdir.patch |
92 |
|
|
Patch8: rust-pr48362-libdir-relative.patch |
93 |
|
|
|
94 |
akien |
1076532 |
# Get the Rust triple for any arch. |
95 |
|
|
%{lua: function rust_triple(arch) |
96 |
|
|
local abi = "gnu" |
97 |
|
|
if arch == "armv7hl" then |
98 |
|
|
arch = "armv7" |
99 |
|
|
abi = "gnueabihf" |
100 |
|
|
elseif arch == "ppc64" then |
101 |
|
|
arch = "powerpc64" |
102 |
|
|
elseif arch == "ppc64le" then |
103 |
|
|
arch = "powerpc64le" |
104 |
akien |
1192969 |
elseif arch == "i586" then |
105 |
|
|
arch = "i686" |
106 |
akien |
1076532 |
end |
107 |
|
|
return arch.."-unknown-linux-"..abi |
108 |
|
|
end} |
109 |
pterjan |
1058164 |
|
110 |
akien |
1076532 |
%global rust_triple %{lua: print(rust_triple(rpm.expand("%{_target_cpu}")))} |
111 |
|
|
|
112 |
|
|
%if %defined bootstrap_arches |
113 |
|
|
# For each bootstrap arch, add an additional binary Source. |
114 |
|
|
# Also define bootstrap_source just for the current target. |
115 |
|
|
%{lua: do |
116 |
|
|
local bootstrap_arches = {} |
117 |
|
|
for arch in string.gmatch(rpm.expand("%{bootstrap_arches}"), "%S+") do |
118 |
|
|
table.insert(bootstrap_arches, arch) |
119 |
|
|
end |
120 |
|
|
local base = rpm.expand("https://static.rust-lang.org/dist/%{bootstrap_date}" |
121 |
akien |
1093561 |
.."/rust-%{bootstrap_channel}") |
122 |
akien |
1076532 |
local target_arch = rpm.expand("%{_target_cpu}") |
123 |
|
|
for i, arch in ipairs(bootstrap_arches) do |
124 |
akien |
1151630 |
print(string.format("Source%d: %s-%s.tar.xz\n", |
125 |
akien |
1076532 |
i, base, rust_triple(arch))) |
126 |
|
|
if arch == target_arch then |
127 |
|
|
rpm.define("bootstrap_source "..i) |
128 |
|
|
end |
129 |
|
|
end |
130 |
|
|
end} |
131 |
akien |
1057871 |
%endif |
132 |
|
|
|
133 |
akien |
1076532 |
%ifarch %{bootstrap_arches} |
134 |
akien |
1093561 |
%global bootstrap_root rust-%{bootstrap_channel}-%{rust_triple} |
135 |
akien |
1107392 |
%global local_rust_root %{_builddir}/%{bootstrap_root}/usr |
136 |
akien |
1093561 |
Provides: bundled(%{name}-bootstrap) = %{bootstrap_rust} |
137 |
akien |
1057871 |
%else |
138 |
akien |
1093561 |
BuildRequires: cargo >= %{bootstrap_cargo} |
139 |
|
|
BuildRequires: %{name} >= %{bootstrap_rust} |
140 |
akien |
1085562 |
BuildConflicts: %{name} > %{version} |
141 |
akien |
1076532 |
%global local_rust_root %{_prefix} |
142 |
akien |
1057871 |
%endif |
143 |
|
|
|
144 |
|
|
BuildRequires: make |
145 |
|
|
BuildRequires: gcc |
146 |
|
|
BuildRequires: gcc-c++ |
147 |
akien |
1151628 |
BuildRequires: ncurses-devel |
148 |
|
|
BuildRequires: zlib-devel |
149 |
akien |
1057871 |
BuildRequires: curl |
150 |
|
|
|
151 |
akien |
1208625 |
%if 0%{?rhel} && 0%{?rhel} <= 7 |
152 |
|
|
%global python python2 |
153 |
|
|
%else |
154 |
|
|
%global python python3 |
155 |
|
|
%endif |
156 |
|
|
BuildRequires: %{python} |
157 |
|
|
|
158 |
akien |
1098716 |
%if %with bundled_llvm |
159 |
akien |
1193979 |
BuildRequires: cmake3 >= 3.4.3 |
160 |
akien |
1151630 |
Provides: bundled(llvm) = 4.0 |
161 |
akien |
1085562 |
%else |
162 |
akien |
1193979 |
BuildRequires: cmake >= 2.8.7 |
163 |
akien |
1208625 |
%if 0%{?epel} || 0%{?fedora} >= 28 |
164 |
|
|
%global llvm llvm5.0 |
165 |
akien |
1179950 |
%endif |
166 |
|
|
%if %defined llvm |
167 |
akien |
1098716 |
%global llvm_root %{_libdir}/%{llvm} |
168 |
|
|
%else |
169 |
|
|
%global llvm llvm |
170 |
|
|
%global llvm_root %{_prefix} |
171 |
|
|
%endif |
172 |
|
|
BuildRequires: %{llvm}-devel >= 3.7 |
173 |
akien |
1062905 |
%if %with llvm_static |
174 |
akien |
1098716 |
BuildRequires: %{llvm}-static |
175 |
akien |
1062905 |
BuildRequires: libffi-devel |
176 |
|
|
%else |
177 |
|
|
# Make sure llvm-config doesn't see it. |
178 |
akien |
1098716 |
BuildConflicts: %{llvm}-static |
179 |
akien |
1062905 |
%endif |
180 |
akien |
1085562 |
%endif |
181 |
akien |
1062905 |
|
182 |
akien |
1058123 |
# make check needs "ps" for src/test/run-pass/wait-forked-but-failed-child.rs |
183 |
akien |
1057887 |
BuildRequires: procps-ng |
184 |
akien |
1057871 |
|
185 |
akien |
1093561 |
# debuginfo-gdb tests need gdb |
186 |
|
|
BuildRequires: gdb |
187 |
|
|
|
188 |
akien |
1057871 |
# TODO: work on unbundling these! |
189 |
akien |
1208625 |
Provides: bundled(hoedown) = 3.0.7 |
190 |
akien |
1057871 |
Provides: bundled(jquery) = 2.1.4 |
191 |
|
|
Provides: bundled(libbacktrace) = 6.1.0 |
192 |
akien |
1208625 |
Provides: bundled(miniz) = 1.16~beta+r1 |
193 |
akien |
1057871 |
|
194 |
akien |
1066912 |
# Virtual provides for folks who attempt "dnf install rustc" |
195 |
|
|
Provides: rustc = %{version}-%{release} |
196 |
|
|
Provides: rustc%{?_isa} = %{version}-%{release} |
197 |
|
|
|
198 |
|
|
# Always require our exact standard library |
199 |
|
|
Requires: %{name}-std-static%{?_isa} = %{version}-%{release} |
200 |
|
|
|
201 |
akien |
1057871 |
# The C compiler is needed at runtime just for linking. Someday rustc might |
202 |
|
|
# invoke the linker directly, and then we'll only need binutils. |
203 |
|
|
# https://github.com/rust-lang/rust/issues/11937 |
204 |
akien |
1151630 |
%if 0%{?mageia} |
205 |
akien |
1057871 |
Requires: gcc |
206 |
akien |
1151630 |
%else |
207 |
|
|
Requires: /usr/bin/cc |
208 |
|
|
%endif |
209 |
akien |
1057871 |
|
210 |
|
|
# ALL Rust libraries are private, because they don't keep an ABI. |
211 |
akien |
1093561 |
%global _privatelibs lib.*-[[:xdigit:]]*[.]so.* |
212 |
akien |
1057871 |
%global __provides_exclude ^(%{_privatelibs})$ |
213 |
|
|
%global __requires_exclude ^(%{_privatelibs})$ |
214 |
akien |
1107392 |
%global __provides_exclude_from ^%{_docdir}/.*$ |
215 |
|
|
%global __requires_exclude_from ^%{_docdir}/.*$ |
216 |
akien |
1057871 |
|
217 |
akien |
1085562 |
# While we don't want to encourage dynamic linking to Rust shared libraries, as |
218 |
|
|
# there's no stable ABI, we still need the unallocated metadata (.rustc) to |
219 |
|
|
# support custom-derive plugins like #[proc_macro_derive(Foo)]. But eu-strip is |
220 |
|
|
# very eager by default, so we have to limit it to -g, only debugging symbols. |
221 |
akien |
1172054 |
%if 0%{?fedora} >= 27 || 0%{?mageia} >= 7 |
222 |
akien |
1151628 |
# Newer find-debuginfo.sh supports --keep-section, which is preferable. rhbz1465997 |
223 |
|
|
%global _find_debuginfo_opts --keep-section .rustc |
224 |
|
|
%else |
225 |
akien |
1085562 |
%global _find_debuginfo_opts -g |
226 |
|
|
%undefine _include_minidebuginfo |
227 |
akien |
1151628 |
%endif |
228 |
akien |
1085562 |
|
229 |
akien |
1098716 |
# Use hardening ldflags. |
230 |
|
|
%global rustflags -Clink-arg=-Wl,-z,relro,-z,now |
231 |
|
|
|
232 |
|
|
%if %{without bundled_llvm} && "%{llvm_root}" != "%{_prefix}" |
233 |
|
|
# https://github.com/rust-lang/rust/issues/40717 |
234 |
akien |
1107392 |
%global library_path $(%{llvm_root}/bin/llvm-config --libdir) |
235 |
akien |
1098716 |
%endif |
236 |
|
|
|
237 |
thatsamguy |
494699 |
%description |
238 |
akien |
1057871 |
Rust is a systems programming language that runs blazingly fast, prevents |
239 |
|
|
segfaults, and guarantees thread safety. |
240 |
thatsamguy |
494699 |
|
241 |
akien |
1066912 |
This package includes the Rust compiler and documentation generator. |
242 |
thatsamguy |
494699 |
|
243 |
akien |
1057871 |
|
244 |
akien |
1066912 |
%package std-static |
245 |
|
|
Summary: Standard library for Rust |
246 |
|
|
|
247 |
|
|
%description std-static |
248 |
|
|
This package includes the standard libraries for building applications |
249 |
|
|
written in Rust. |
250 |
|
|
|
251 |
|
|
|
252 |
akien |
1098716 |
%package debugger-common |
253 |
|
|
Summary: Common debugger pretty printers for Rust |
254 |
|
|
BuildArch: noarch |
255 |
|
|
|
256 |
|
|
%description debugger-common |
257 |
|
|
This package includes the common functionality for %{name}-gdb and %{name}-lldb. |
258 |
|
|
|
259 |
|
|
|
260 |
akien |
1057871 |
%package gdb |
261 |
|
|
Summary: GDB pretty printers for Rust |
262 |
|
|
BuildArch: noarch |
263 |
|
|
Requires: gdb |
264 |
akien |
1098716 |
Requires: %{name}-debugger-common = %{version}-%{release} |
265 |
akien |
1057871 |
|
266 |
akien |
1085562 |
%if 0%{?mageia} == 6 |
267 |
akien |
1057888 |
# (akien) Handle moved files between our old Mageia package and this Fedora-based one |
268 |
|
|
Conflicts: rust < 1.11.0-3 |
269 |
akien |
1085562 |
%endif |
270 |
akien |
1057888 |
|
271 |
akien |
1098861 |
%description gdb |
272 |
|
|
This package includes the rust-gdb script, which allows easier debugging of Rust |
273 |
|
|
programs. |
274 |
akien |
1057871 |
|
275 |
akien |
1098861 |
|
276 |
akien |
1093561 |
%if %with lldb |
277 |
|
|
|
278 |
|
|
%package lldb |
279 |
|
|
Summary: LLDB pretty printers for Rust |
280 |
akien |
1093562 |
|
281 |
akien |
1098716 |
# It could be noarch, but lldb has limited availability |
282 |
|
|
#BuildArch: noarch |
283 |
|
|
|
284 |
akien |
1093561 |
Requires: lldb |
285 |
akien |
1208625 |
%if 0%{?mageia} == 6 |
286 |
akien |
1093562 |
Requires: python-lldb |
287 |
akien |
1208625 |
%else |
288 |
|
|
Requires: python2-lldb |
289 |
|
|
%endif |
290 |
akien |
1098716 |
Requires: %{name}-debugger-common = %{version}-%{release} |
291 |
akien |
1093561 |
|
292 |
|
|
%description lldb |
293 |
|
|
This package includes the rust-lldb script, which allows easier debugging of Rust |
294 |
|
|
programs. |
295 |
|
|
|
296 |
|
|
%endif |
297 |
|
|
|
298 |
|
|
|
299 |
shlomif |
990941 |
%package doc |
300 |
akien |
1057871 |
Summary: Documentation for Rust |
301 |
|
|
# NOT BuildArch: noarch |
302 |
|
|
# Note, while docs are mostly noarch, some things do vary by target_arch. |
303 |
|
|
# Koji will fail the build in rpmdiff if two architectures build a noarch |
304 |
|
|
# subpackage differently, so instead we have to keep its arch. |
305 |
thatsamguy |
494699 |
|
306 |
shlomif |
990941 |
%description doc |
307 |
akien |
1057871 |
This package includes HTML documentation for the Rust programming language and |
308 |
|
|
its standard library. |
309 |
thatsamguy |
494699 |
|
310 |
akien |
1057871 |
|
311 |
akien |
1151630 |
%package src |
312 |
|
|
Summary: Sources for the Rust standard library |
313 |
|
|
BuildArch: noarch |
314 |
|
|
|
315 |
|
|
%description src |
316 |
|
|
This package includes source files for the Rust standard library. It may be |
317 |
|
|
useful as a reference for code completion tools in various editors. |
318 |
|
|
|
319 |
|
|
|
320 |
thatsamguy |
494699 |
%prep |
321 |
|
|
|
322 |
akien |
1076532 |
%ifarch %{bootstrap_arches} |
323 |
|
|
%setup -q -n %{bootstrap_root} -T -b %{bootstrap_source} |
324 |
akien |
1093561 |
./install.sh --components=cargo,rustc,rust-std-%{rust_triple} \ |
325 |
akien |
1107392 |
--prefix=%{local_rust_root} --disable-ldconfig |
326 |
akien |
1093561 |
test -f '%{local_rust_root}/bin/cargo' |
327 |
akien |
1058123 |
test -f '%{local_rust_root}/bin/rustc' |
328 |
|
|
%endif |
329 |
akien |
1057871 |
|
330 |
akien |
1076532 |
%setup -q -n %{rustc_package} |
331 |
akien |
1058123 |
|
332 |
akien |
1208625 |
pushd src/binaryen |
333 |
|
|
%patch1 -p1 -b .catch-value |
334 |
|
|
popd |
335 |
|
|
|
336 |
|
|
%patch2 -p1 -b .DW_OP_plus_uconst |
337 |
|
|
%patch3 -p1 -b .DW_OP_deref |
338 |
|
|
%patch4 -p1 -b .sse2 |
339 |
|
|
%patch5 -p1 -b .out-of-stack |
340 |
|
|
%patch6 -p1 -b .out-of-stack |
341 |
|
|
%patch7 -p1 -b .bootstrap-libdir |
342 |
|
|
%patch8 -p1 -b .bootstrap-libdir-relative |
343 |
|
|
|
344 |
|
|
%if "%{python}" == "python3" |
345 |
|
|
sed -i.try-py3 -e '/try python2.7/i try python3 "$@"' ./configure |
346 |
|
|
%endif |
347 |
|
|
|
348 |
akien |
1151630 |
# We're disabling jemalloc, but rust-src still wants it. |
349 |
|
|
# rm -rf src/jemalloc/ |
350 |
akien |
1156429 |
|
351 |
akien |
1085562 |
%if %without bundled_llvm |
352 |
akien |
1058123 |
rm -rf src/llvm/ |
353 |
akien |
1085562 |
%endif |
354 |
akien |
1057871 |
|
355 |
|
|
# extract bundled licenses for packaging |
356 |
|
|
cp src/rt/hoedown/LICENSE src/rt/hoedown/LICENSE-hoedown |
357 |
|
|
sed -e '/*\//q' src/libbacktrace/backtrace.h \ |
358 |
|
|
>src/libbacktrace/LICENSE-libbacktrace |
359 |
|
|
|
360 |
akien |
1130315 |
# This tests a problem of exponential growth, which seems to be less-reliably |
361 |
|
|
# fixed when running on older LLVM and/or some arches. Just skip it for now. |
362 |
|
|
sed -i.ignore -e '1i // ignore-test may still be exponential...' \ |
363 |
|
|
src/test/run-pass/issue-41696.rs |
364 |
|
|
|
365 |
akien |
1098716 |
%if %{with bundled_llvm} && 0%{?epel} |
366 |
akien |
1093561 |
mkdir -p cmake-bin |
367 |
|
|
ln -s /usr/bin/cmake3 cmake-bin/cmake |
368 |
|
|
%global cmake_path $PWD/cmake-bin |
369 |
akien |
1085562 |
%endif |
370 |
|
|
|
371 |
|
|
%if %{without bundled_llvm} && %{with llvm_static} |
372 |
akien |
1062905 |
# Static linking to distro LLVM needs to add -lffi |
373 |
|
|
# https://github.com/rust-lang/rust/issues/34486 |
374 |
|
|
sed -i.ffi -e '$a #[link(name = "ffi")] extern {}' \ |
375 |
|
|
src/librustc_llvm/lib.rs |
376 |
|
|
%endif |
377 |
akien |
1057871 |
|
378 |
akien |
1130315 |
# The configure macro will modify some autoconf-related files, which upsets |
379 |
|
|
# cargo when it tries to verify checksums in those files. If we just truncate |
380 |
|
|
# that file list, cargo won't have anything to complain about. |
381 |
|
|
find src/vendor -name .cargo-checksum.json \ |
382 |
|
|
-exec sed -i.uncheck -e 's/"files":{[^}]*}/"files":{ }/' '{}' '+' |
383 |
akien |
1093561 |
|
384 |
akien |
1130315 |
|
385 |
thatsamguy |
494699 |
%build |
386 |
akien |
1060081 |
|
387 |
akien |
1093561 |
%{?cmake_path:export PATH=%{cmake_path}:$PATH} |
388 |
akien |
1107392 |
%{?library_path:export LIBRARY_PATH="%{library_path}"} |
389 |
|
|
%{?rustflags:export RUSTFLAGS="%{rustflags}"} |
390 |
akien |
1066912 |
|
391 |
akien |
1076532 |
# We're going to override --libdir when configuring to get rustlib into a |
392 |
akien |
1085562 |
# common path, but we'll fix the shared libraries during install. |
393 |
akien |
1076532 |
%global common_libdir %{_prefix}/lib |
394 |
|
|
%global rustlibdir %{common_libdir}/rustlib |
395 |
akien |
1066912 |
|
396 |
akien |
1179950 |
%ifarch %{arm} |
397 |
|
|
# full debuginfo is exhausting memory; just do libstd for now |
398 |
|
|
# https://github.com/rust-lang/rust/issues/45854 |
399 |
|
|
%define enable_debuginfo --enable-debuginfo --enable-debuginfo-only-std --disable-debuginfo-lines |
400 |
|
|
%else |
401 |
|
|
%define enable_debuginfo --enable-debuginfo --disable-debuginfo-only-std --disable-debuginfo-lines |
402 |
|
|
%endif |
403 |
|
|
|
404 |
akien |
1057871 |
%configure --disable-option-checking \ |
405 |
akien |
1066912 |
--libdir=%{common_libdir} \ |
406 |
akien |
1057871 |
--build=%{rust_triple} --host=%{rust_triple} --target=%{rust_triple} \ |
407 |
akien |
1058123 |
--enable-local-rust --local-rust-root=%{local_rust_root} \ |
408 |
akien |
1098716 |
%{!?with_bundled_llvm: --llvm-root=%{llvm_root} --disable-codegen-tests \ |
409 |
akien |
1085562 |
%{!?with_llvm_static: --enable-llvm-link-shared } } \ |
410 |
akien |
1057871 |
--disable-jemalloc \ |
411 |
|
|
--disable-rpath \ |
412 |
akien |
1179950 |
%{enable_debuginfo} \ |
413 |
akien |
1093561 |
--enable-vendor \ |
414 |
akien |
1208625 |
--release-channel=%{channel} |
415 |
thatsamguy |
494699 |
|
416 |
akien |
1208625 |
%{python} ./x.py build |
417 |
|
|
%{python} ./x.py doc |
418 |
thatsamguy |
494699 |
|
419 |
akien |
1057871 |
|
420 |
thatsamguy |
494699 |
%install |
421 |
akien |
1093561 |
%{?cmake_path:export PATH=%{cmake_path}:$PATH} |
422 |
akien |
1107392 |
%{?library_path:export LIBRARY_PATH="%{library_path}"} |
423 |
|
|
%{?rustflags:export RUSTFLAGS="%{rustflags}"} |
424 |
thatsamguy |
494699 |
|
425 |
akien |
1208625 |
DESTDIR=%{buildroot} %{python} ./x.py install |
426 |
|
|
DESTDIR=%{buildroot} %{python} ./x.py install src |
427 |
akien |
1093561 |
|
428 |
akien |
1156429 |
|
429 |
akien |
1107389 |
# Make sure the shared libraries are in the proper libdir |
430 |
|
|
%if "%{_libdir}" != "%{common_libdir}" |
431 |
|
|
mkdir -p %{buildroot}%{_libdir} |
432 |
|
|
find %{buildroot}%{common_libdir} -maxdepth 1 -type f -name '*.so' \ |
433 |
|
|
-exec mv -v -t %{buildroot}%{_libdir} '{}' '+' |
434 |
|
|
%endif |
435 |
akien |
1066912 |
|
436 |
akien |
1107389 |
# The shared libraries should be executable for debuginfo extraction. |
437 |
|
|
find %{buildroot}%{_libdir} -maxdepth 1 -type f -name '*.so' \ |
438 |
|
|
-exec chmod -v +x '{}' '+' |
439 |
|
|
|
440 |
|
|
# The libdir libraries are identical to those under rustlib/. It's easier on |
441 |
|
|
# library loading if we keep them in libdir, but we do need them in rustlib/ |
442 |
|
|
# to support dynamic linking for compiler plugins, so we'll symlink. |
443 |
|
|
(cd "%{buildroot}%{rustlibdir}/%{rust_triple}/lib" && |
444 |
akien |
1208625 |
find ../../../../%{_lib} -maxdepth 1 -name '*.so' | |
445 |
|
|
while read lib; do |
446 |
|
|
# make sure they're actually identical! |
447 |
|
|
cmp "$lib" "${lib##*/}" |
448 |
|
|
ln -v -f -s -t . "$lib" |
449 |
|
|
done) |
450 |
akien |
1107389 |
|
451 |
akien |
1057871 |
# Remove installer artifacts (manifests, uninstall scripts, etc.) |
452 |
akien |
1085562 |
find %{buildroot}%{rustlibdir} -maxdepth 1 -type f -exec rm -v '{}' '+' |
453 |
akien |
1057871 |
|
454 |
|
|
# FIXME: __os_install_post will strip the rlibs |
455 |
|
|
# -- should we find a way to preserve debuginfo? |
456 |
|
|
|
457 |
|
|
# Remove unwanted documentation files (we already package them) |
458 |
akien |
1085562 |
rm -f %{buildroot}%{_docdir}/%{name}/README.md |
459 |
|
|
rm -f %{buildroot}%{_docdir}/%{name}/COPYRIGHT |
460 |
|
|
rm -f %{buildroot}%{_docdir}/%{name}/LICENSE-APACHE |
461 |
|
|
rm -f %{buildroot}%{_docdir}/%{name}/LICENSE-MIT |
462 |
akien |
1057871 |
|
463 |
|
|
# Sanitize the HTML documentation |
464 |
akien |
1085562 |
find %{buildroot}%{_docdir}/%{name}/html -empty -delete |
465 |
|
|
find %{buildroot}%{_docdir}/%{name}/html -type f -exec chmod -x '{}' '+' |
466 |
akien |
1057871 |
|
467 |
akien |
1093561 |
%if %without lldb |
468 |
|
|
rm -f %{buildroot}%{_bindir}/rust-lldb |
469 |
|
|
rm -f %{buildroot}%{rustlibdir}/etc/lldb_*.py* |
470 |
|
|
%endif |
471 |
akien |
1057871 |
|
472 |
akien |
1093561 |
|
473 |
akien |
1057871 |
%check |
474 |
akien |
1093561 |
%{?cmake_path:export PATH=%{cmake_path}:$PATH} |
475 |
akien |
1107392 |
%{?library_path:export LIBRARY_PATH="%{library_path}"} |
476 |
|
|
%{?rustflags:export RUSTFLAGS="%{rustflags}"} |
477 |
akien |
1093561 |
|
478 |
akien |
1057871 |
# The results are not stable on koji, so mask errors and just log it. |
479 |
akien |
1208625 |
%{python} ./x.py test --no-fail-fast || : |
480 |
akien |
1057871 |
|
481 |
|
|
|
482 |
akien |
1208625 |
%if ! 0%{?mageia} |
483 |
|
|
%ldconfig_scriptlets |
484 |
|
|
%endif |
485 |
akien |
1085562 |
|
486 |
|
|
|
487 |
thatsamguy |
494699 |
%files |
488 |
akien |
1057871 |
%license COPYRIGHT LICENSE-APACHE LICENSE-MIT |
489 |
|
|
%license src/libbacktrace/LICENSE-libbacktrace |
490 |
|
|
%license src/rt/hoedown/LICENSE-hoedown |
491 |
|
|
%doc README.md |
492 |
thatsamguy |
494699 |
%{_bindir}/rustc |
493 |
|
|
%{_bindir}/rustdoc |
494 |
akien |
1107389 |
%{_libdir}/*.so |
495 |
akien |
1057871 |
%{_mandir}/man1/rustc.1* |
496 |
|
|
%{_mandir}/man1/rustdoc.1* |
497 |
akien |
1085562 |
%dir %{rustlibdir} |
498 |
|
|
%dir %{rustlibdir}/%{rust_triple} |
499 |
|
|
%dir %{rustlibdir}/%{rust_triple}/lib |
500 |
|
|
%{rustlibdir}/%{rust_triple}/lib/*.so |
501 |
thatsamguy |
494699 |
|
502 |
akien |
1057871 |
|
503 |
akien |
1066912 |
%files std-static |
504 |
|
|
%dir %{rustlibdir} |
505 |
|
|
%dir %{rustlibdir}/%{rust_triple} |
506 |
|
|
%dir %{rustlibdir}/%{rust_triple}/lib |
507 |
|
|
%{rustlibdir}/%{rust_triple}/lib/*.rlib |
508 |
|
|
|
509 |
|
|
|
510 |
akien |
1098716 |
%files debugger-common |
511 |
akien |
1066912 |
%dir %{rustlibdir} |
512 |
|
|
%dir %{rustlibdir}/etc |
513 |
akien |
1093561 |
%{rustlibdir}/etc/debugger_*.py* |
514 |
akien |
1098716 |
|
515 |
|
|
|
516 |
|
|
%files gdb |
517 |
|
|
%{_bindir}/rust-gdb |
518 |
akien |
1093561 |
%{rustlibdir}/etc/gdb_*.py* |
519 |
akien |
1057871 |
|
520 |
|
|
|
521 |
akien |
1093561 |
%if %with lldb |
522 |
|
|
%files lldb |
523 |
|
|
%{_bindir}/rust-lldb |
524 |
|
|
%{rustlibdir}/etc/lldb_*.py* |
525 |
|
|
%endif |
526 |
|
|
|
527 |
|
|
|
528 |
shlomif |
990941 |
%files doc |
529 |
akien |
1098716 |
%docdir %{_docdir}/%{name} |
530 |
akien |
1057871 |
%dir %{_docdir}/%{name} |
531 |
akien |
1098716 |
%dir %{_docdir}/%{name}/html |
532 |
|
|
%{_docdir}/%{name}/html/*/ |
533 |
|
|
%{_docdir}/%{name}/html/*.html |
534 |
|
|
%{_docdir}/%{name}/html/*.css |
535 |
|
|
%{_docdir}/%{name}/html/*.js |
536 |
|
|
%{_docdir}/%{name}/html/*.woff |
537 |
|
|
%license %{_docdir}/%{name}/html/*.txt |
538 |
akien |
1151630 |
|
539 |
|
|
|
540 |
|
|
%files src |
541 |
|
|
%dir %{rustlibdir} |
542 |
|
|
%{rustlibdir}/src |