13 |
# To bootstrap from scratch, set the channel and date from src/stage0.txt |
# 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 |
# e.g. 1.10.0 wants rustc: 1.9.0-2016-05-24 |
15 |
# or nightly wants some beta-YYYY-MM-DD |
# or nightly wants some beta-YYYY-MM-DD |
16 |
%global bootstrap_rust 1.23.0 |
%global bootstrap_rust 1.24.0 |
17 |
%global bootstrap_cargo 0.24.0 |
%global bootstrap_cargo 0.25.0 |
18 |
%global bootstrap_channel %{bootstrap_rust} |
%global bootstrap_channel %{bootstrap_rust} |
19 |
%global bootstrap_date 2018-01-04 |
%global bootstrap_date 2018-02-15 |
20 |
|
|
21 |
# Only the specified arches will use bootstrap binaries. |
# Only the specified arches will use bootstrap binaries. |
22 |
#global bootstrap_arches %%{rust_arches} |
#global bootstrap_arches %%{rust_arches} |
23 |
|
|
24 |
# We generally don't want llvm-static present at all, since llvm-config will |
# Using llvm-static may be helpful as an opt-in, e.g. to aid LLVM rebases. |
|
# make us link statically. But we can opt in, e.g. to aid LLVM rebases. |
|
|
# FIXME: LLVM 3.9 prefers shared linking now! Which is good, but next time we |
|
|
# *want* static we'll have to force it with "llvm-config --link-static". |
|
|
# See also https://github.com/rust-lang/rust/issues/36854 |
|
|
# The new rustbuild accepts `--enable-llvm-link-shared`, else links static. |
|
25 |
%bcond_with llvm_static |
%bcond_with llvm_static |
26 |
|
|
27 |
# We can also choose to just use Rust's bundled LLVM, in case the system LLVM |
# We can also choose to just use Rust's bundled LLVM, in case the system LLVM |
47 |
|
|
48 |
|
|
49 |
Name: rust |
Name: rust |
50 |
Version: 1.24.1 |
Version: 1.25.0 |
51 |
Release: %mkrel 4 |
Release: %mkrel 1 |
52 |
Summary: The Rust Programming Language |
Summary: The Rust Programming Language |
53 |
%if 0%{?mageia} |
%if 0%{?mageia} |
54 |
Group: Development/Other |
Group: Development/Other |
65 |
%endif |
%endif |
66 |
Source0: https://static.rust-lang.org/dist/%{rustc_package}.tar.xz |
Source0: https://static.rust-lang.org/dist/%{rustc_package}.tar.xz |
67 |
|
|
68 |
# https://github.com/WebAssembly/binaryen/pull/1400 |
# https://github.com/rust-lang/rust/pull/49290 |
69 |
Patch1: 0001-Fix-Wcatch-value-from-GCC-8.patch |
Patch1: 0001-Allow-installing-rustfmt-without-config.extended.patch |
70 |
|
|
71 |
# https://github.com/rust-lang/rust/pull/47610 |
# https://github.com/rust-lang/rust/pull/49484 |
72 |
Patch2: 0001-Update-DW_OP_plus-to-DW_OP_plus_uconst.patch |
Patch2: 0001-Ignore-stack-probes-tests-on-powerpc-s390x-too.patch |
|
|
|
|
# https://github.com/rust-lang/rust/pull/47688 |
|
|
Patch3: 0001-Let-LLVM-5-add-DW_OP_deref-to-indirect-args-itself.patch |
|
|
|
|
|
# https://github.com/rust-lang/rust/pull/47884 |
|
|
Patch4: 0001-Ignore-run-pass-sse2-when-using-system-LLVM.patch |
|
|
|
|
|
# https://github.com/rust-lang/rust/pull/47912 |
|
|
Patch5: 0001-Enable-stack-probe-tests-with-system-LLVM-5.0.patch |
|
|
Patch6: 0002-Use-a-range-to-identify-SIGSEGV-in-stack-guards.patch |
|
|
|
|
|
# fix for https://github.com/rust-lang/rust/issues/47469 |
|
|
# via https://github.com/rust-lang/rust/pull/46592 |
|
|
Patch7: rust-pr46592-bootstrap-libdir.patch |
|
|
Patch8: rust-pr48362-libdir-relative.patch |
|
73 |
|
|
74 |
# Get the Rust triple for any arch. |
# Get the Rust triple for any arch. |
75 |
%{lua: function rust_triple(arch) |
%{lua: function rust_triple(arch) |
116 |
Provides: bundled(%{name}-bootstrap) = %{bootstrap_rust} |
Provides: bundled(%{name}-bootstrap) = %{bootstrap_rust} |
117 |
%else |
%else |
118 |
BuildRequires: cargo >= %{bootstrap_cargo} |
BuildRequires: cargo >= %{bootstrap_cargo} |
119 |
|
%if 0%{?fedora} >= 27 |
120 |
|
BuildRequires: (%{name} >= %{bootstrap_rust} with %{name} <= %{version}) |
121 |
|
%else |
122 |
BuildRequires: %{name} >= %{bootstrap_rust} |
BuildRequires: %{name} >= %{bootstrap_rust} |
123 |
BuildConflicts: %{name} > %{version} |
BuildConflicts: %{name} > %{version} |
124 |
|
%endif |
125 |
%global local_rust_root %{_prefix} |
%global local_rust_root %{_prefix} |
126 |
%endif |
%endif |
127 |
|
|
141 |
|
|
142 |
%if %with bundled_llvm |
%if %with bundled_llvm |
143 |
BuildRequires: cmake3 >= 3.4.3 |
BuildRequires: cmake3 >= 3.4.3 |
144 |
Provides: bundled(llvm) = 4.0 |
Provides: bundled(llvm) = 6.0 |
145 |
%else |
%else |
146 |
BuildRequires: cmake >= 2.8.7 |
BuildRequires: cmake >= 2.8.7 |
147 |
%if 0%{?epel} || 0%{?fedora} >= 28 |
%if 0%{?epel} |
148 |
%global llvm llvm5.0 |
%global llvm llvm5.0 |
149 |
%endif |
%endif |
150 |
%if %defined llvm |
%if %defined llvm |
153 |
%global llvm llvm |
%global llvm llvm |
154 |
%global llvm_root %{_prefix} |
%global llvm_root %{_prefix} |
155 |
%endif |
%endif |
156 |
BuildRequires: %{llvm}-devel >= 3.7 |
BuildRequires: %{llvm}-devel >= 3.9 |
157 |
%if %with llvm_static |
%if %with llvm_static |
158 |
BuildRequires: %{llvm}-static |
BuildRequires: %{llvm}-static |
159 |
BuildRequires: libffi-devel |
BuildRequires: libffi-devel |
|
%else |
|
|
# Make sure llvm-config doesn't see it. |
|
|
BuildConflicts: %{llvm}-static |
|
160 |
%endif |
%endif |
161 |
%endif |
%endif |
162 |
|
|
289 |
its standard library. |
its standard library. |
290 |
|
|
291 |
|
|
292 |
|
%package -n rustfmt-preview |
293 |
|
Summary: Tool to find and fix Rust formatting issues |
294 |
|
Version: 0.3.8 |
295 |
|
Requires: cargo |
296 |
|
|
297 |
|
# Despite the lower version, our rustfmt-preview is newer than rustfmt-0.9. |
298 |
|
# It's expected to stay "preview" until it's released as 1.0. |
299 |
|
Obsoletes: rustfmt <= 0.9.0 |
300 |
|
Provides: rustfmt = %{version} |
301 |
|
|
302 |
|
%description -n rustfmt-preview |
303 |
|
A tool for formatting Rust code according to style guidelines. |
304 |
|
|
305 |
|
|
306 |
%package src |
%package src |
307 |
Summary: Sources for the Rust standard library |
Summary: Sources for the Rust standard library |
308 |
BuildArch: noarch |
BuildArch: noarch |
324 |
|
|
325 |
%setup -q -n %{rustc_package} |
%setup -q -n %{rustc_package} |
326 |
|
|
327 |
pushd src/binaryen |
%patch1 -p1 -b .dist-rustfmt |
328 |
%patch1 -p1 -b .catch-value |
%patch2 -p1 -b .ignore-ibm |
|
popd |
|
|
|
|
|
%patch2 -p1 -b .DW_OP_plus_uconst |
|
|
%patch3 -p1 -b .DW_OP_deref |
|
|
%patch4 -p1 -b .sse2 |
|
|
%patch5 -p1 -b .out-of-stack |
|
|
%patch6 -p1 -b .out-of-stack |
|
|
%patch7 -p1 -b .bootstrap-libdir |
|
|
%patch8 -p1 -b .bootstrap-libdir-relative |
|
329 |
|
|
330 |
%if "%{python}" == "python3" |
%if "%{python}" == "python3" |
331 |
sed -i.try-py3 -e '/try python2.7/i try python3 "$@"' ./configure |
sed -i.try-py3 -e '/try python2.7/i try python3 "$@"' ./configure |
338 |
rm -rf src/llvm/ |
rm -rf src/llvm/ |
339 |
%endif |
%endif |
340 |
|
|
341 |
|
# We never enable emscripten. |
342 |
|
rm -rf src/llvm-emscripten/ |
343 |
|
|
344 |
# extract bundled licenses for packaging |
# extract bundled licenses for packaging |
345 |
cp src/rt/hoedown/LICENSE src/rt/hoedown/LICENSE-hoedown |
cp src/rt/hoedown/LICENSE src/rt/hoedown/LICENSE-hoedown |
346 |
sed -e '/*\//q' src/libbacktrace/backtrace.h \ |
sed -e '/*\//q' src/libbacktrace/backtrace.h \ |
393 |
%configure --disable-option-checking \ |
%configure --disable-option-checking \ |
394 |
--libdir=%{common_libdir} \ |
--libdir=%{common_libdir} \ |
395 |
--build=%{rust_triple} --host=%{rust_triple} --target=%{rust_triple} \ |
--build=%{rust_triple} --host=%{rust_triple} --target=%{rust_triple} \ |
396 |
--enable-local-rust --local-rust-root=%{local_rust_root} \ |
--local-rust-root=%{local_rust_root} \ |
397 |
%{!?with_bundled_llvm: --llvm-root=%{llvm_root} --disable-codegen-tests \ |
%{!?with_bundled_llvm: --llvm-root=%{llvm_root} --disable-codegen-tests \ |
398 |
%{!?with_llvm_static: --enable-llvm-link-shared } } \ |
%{!?with_llvm_static: --enable-llvm-link-shared } } \ |
399 |
--disable-jemalloc \ |
--disable-jemalloc \ |
403 |
--release-channel=%{channel} |
--release-channel=%{channel} |
404 |
|
|
405 |
%{python} ./x.py build |
%{python} ./x.py build |
406 |
|
%{python} ./x.py build src/tools/rustfmt |
407 |
%{python} ./x.py doc |
%{python} ./x.py doc |
408 |
|
|
409 |
|
|
413 |
%{?rustflags:export RUSTFLAGS="%{rustflags}"} |
%{?rustflags:export RUSTFLAGS="%{rustflags}"} |
414 |
|
|
415 |
DESTDIR=%{buildroot} %{python} ./x.py install |
DESTDIR=%{buildroot} %{python} ./x.py install |
416 |
|
DESTDIR=%{buildroot} %{python} ./x.py install rustfmt |
417 |
DESTDIR=%{buildroot} %{python} ./x.py install src |
DESTDIR=%{buildroot} %{python} ./x.py install src |
418 |
|
|
419 |
|
|
450 |
rm -f %{buildroot}%{_docdir}/%{name}/COPYRIGHT |
rm -f %{buildroot}%{_docdir}/%{name}/COPYRIGHT |
451 |
rm -f %{buildroot}%{_docdir}/%{name}/LICENSE-APACHE |
rm -f %{buildroot}%{_docdir}/%{name}/LICENSE-APACHE |
452 |
rm -f %{buildroot}%{_docdir}/%{name}/LICENSE-MIT |
rm -f %{buildroot}%{_docdir}/%{name}/LICENSE-MIT |
453 |
|
rm -f %{buildroot}%{_docdir}/%{name}/*.old |
454 |
|
|
455 |
# Sanitize the HTML documentation |
# Sanitize the HTML documentation |
456 |
find %{buildroot}%{_docdir}/%{name}/html -empty -delete |
find %{buildroot}%{_docdir}/%{name}/html -empty -delete |
469 |
|
|
470 |
# The results are not stable on koji, so mask errors and just log it. |
# The results are not stable on koji, so mask errors and just log it. |
471 |
%{python} ./x.py test --no-fail-fast || : |
%{python} ./x.py test --no-fail-fast || : |
472 |
|
%{python} ./x.py test --no-fail-fast src/tools/rustfmt || : |
473 |
|
|
474 |
|
|
475 |
%if ! 0%{?mageia} |
%if ! 0%{?mageia} |
491 |
%dir %{rustlibdir}/%{rust_triple} |
%dir %{rustlibdir}/%{rust_triple} |
492 |
%dir %{rustlibdir}/%{rust_triple}/lib |
%dir %{rustlibdir}/%{rust_triple}/lib |
493 |
%{rustlibdir}/%{rust_triple}/lib/*.so |
%{rustlibdir}/%{rust_triple}/lib/*.so |
494 |
|
%{rustlibdir}/%{rust_triple}/codegen-backends/ |
495 |
|
|
496 |
|
|
497 |
%files std-static |
%files std-static |
527 |
%{_docdir}/%{name}/html/*.html |
%{_docdir}/%{name}/html/*.html |
528 |
%{_docdir}/%{name}/html/*.css |
%{_docdir}/%{name}/html/*.css |
529 |
%{_docdir}/%{name}/html/*.js |
%{_docdir}/%{name}/html/*.js |
530 |
|
%{_docdir}/%{name}/html/*.svg |
531 |
%{_docdir}/%{name}/html/*.woff |
%{_docdir}/%{name}/html/*.woff |
532 |
%license %{_docdir}/%{name}/html/*.txt |
%license %{_docdir}/%{name}/html/*.txt |
533 |
|
|
534 |
|
|
535 |
|
%files -n rustfmt-preview |
536 |
|
%{_bindir}/rustfmt |
537 |
|
%{_bindir}/cargo-fmt |
538 |
|
%doc src/tools/rustfmt/{README,CHANGELOG,Configurations}.md |
539 |
|
%license src/tools/rustfmt/LICENSE-{APACHE,MIT} |
540 |
|
|
541 |
|
|
542 |
%files src |
%files src |
543 |
%dir %{rustlibdir} |
%dir %{rustlibdir} |
544 |
%{rustlibdir}/src |
%{rustlibdir}/src |