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 |
# Note that cargo matches the program version here, not its crate version. |
# Note that cargo matches the program version here, not its crate version. |
17 |
%global bootstrap_rust 1.31.0 |
%global bootstrap_rust 1.32.0 |
18 |
%global bootstrap_cargo 1.31.0 |
%global bootstrap_cargo 1.32.0 |
19 |
%global bootstrap_channel %{bootstrap_rust} |
%global bootstrap_channel %{bootstrap_rust} |
20 |
%global bootstrap_date 2018-12-20 |
%global bootstrap_date 2019-01-17 |
21 |
|
|
22 |
# Only the specified arches will use bootstrap binaries. |
# Only the specified arches will use bootstrap binaries. |
23 |
#global bootstrap_arches %%{rust_arches} |
#global bootstrap_arches %%{rust_arches} |
58 |
%endif |
%endif |
59 |
|
|
60 |
Name: rust |
Name: rust |
61 |
Version: 1.32.0 |
Version: 1.33.0 |
62 |
Release: %mkrel 1 |
Release: %mkrel 1 |
63 |
Summary: The Rust Programming Language |
Summary: The Rust Programming Language |
64 |
%if 0%{?mageia} |
%if 0%{?mageia} |
79 |
# https://github.com/rust-dev-tools/rls-analysis/pull/160 |
# https://github.com/rust-dev-tools/rls-analysis/pull/160 |
80 |
Patch1: 0001-Try-to-get-the-target-triple-from-rustc-itself.patch |
Patch1: 0001-Try-to-get-the-target-triple-from-rustc-itself.patch |
81 |
|
|
82 |
# https://github.com/rust-lang/rust/pull/57453 |
# https://github.com/rust-lang/rust/pull/57647 |
83 |
Patch2: 0001-lldb_batchmode.py-try-import-_thread-for-Python-3.patch |
Patch2: 0001-rust-gdb-relax-the-GDB-version-regex.patch |
84 |
|
|
85 |
|
# Revert https://github.com/rust-lang/rust/pull/57840 |
86 |
|
# We do have the necessary fix in our LLVM 7. |
87 |
|
Patch3: rust-pr57840-llvm7-debuginfo-variants.patch |
88 |
|
|
89 |
|
# https://github.com/rust-lang/rust/issues/58845 |
90 |
|
Patch4: 0001-Backport-deprecation-fixes-from-commit-b7f030e.patch |
91 |
|
|
92 |
# Get the Rust triple for any arch. |
# Get the Rust triple for any arch. |
93 |
%{lua: function rust_triple(arch) |
%{lua: function rust_triple(arch) |
174 |
Provides: bundled(llvm) = 8.0.0~svn |
Provides: bundled(llvm) = 8.0.0~svn |
175 |
%else |
%else |
176 |
BuildRequires: cmake >= 2.8.11 |
BuildRequires: cmake >= 2.8.11 |
177 |
%if 0%{?epel} |
%if 0%{?epel} || 0%{?fedora} >= 30 |
178 |
%global llvm llvm5.0 |
# TODO: for f30+, we'll be ready for LLVM8 in Rust 1.34 |
179 |
|
%global llvm llvm7.0 |
180 |
%endif |
%endif |
181 |
%if %defined llvm |
%if %defined llvm |
182 |
%global llvm_root %{_libdir}/%{llvm} |
%global llvm_root %{_libdir}/%{llvm} |
184 |
%global llvm llvm |
%global llvm llvm |
185 |
%global llvm_root %{_prefix} |
%global llvm_root %{_prefix} |
186 |
%endif |
%endif |
187 |
BuildRequires: %{llvm}-devel >= 5.0 |
BuildRequires: %{llvm}-devel >= 6.0 |
188 |
%if %with llvm_static |
%if %with llvm_static |
189 |
BuildRequires: %{llvm}-static |
BuildRequires: %{llvm}-static |
190 |
BuildRequires: libffi-devel |
BuildRequires: libffi-devel |
199 |
|
|
200 |
# TODO: work on unbundling these! |
# TODO: work on unbundling these! |
201 |
Provides: bundled(libbacktrace) = 8.1.0 |
Provides: bundled(libbacktrace) = 8.1.0 |
202 |
Provides: bundled(miniz) = 1.16~beta+r1 |
Provides: bundled(miniz) = 2.0.7 |
203 |
|
|
204 |
# Virtual provides for folks who attempt "dnf install rustc" |
# Virtual provides for folks who attempt "dnf install rustc" |
205 |
Provides: rustc = %{version}-%{release} |
Provides: rustc = %{version}-%{release} |
240 |
%global rustflags -Clink-arg=-Wl,-z,relro,-z,now |
%global rustflags -Clink-arg=-Wl,-z,relro,-z,now |
241 |
|
|
242 |
%if %{without bundled_llvm} |
%if %{without bundled_llvm} |
243 |
%if 0%{?fedora} || 0%{?rhel} > 7 || 0%{?scl:1} || 0%{?mageia} |
%if "%{llvm_root}" == "%{_prefix}" || 0%{?scl:1} |
244 |
%global llvm_has_filecheck 1 |
%global llvm_has_filecheck 1 |
245 |
%endif |
%endif |
246 |
%if "%{llvm_root}" != "%{_prefix}" |
%if "%{llvm_root}" != "%{_prefix}" |
427 |
%patch1 -p1 |
%patch1 -p1 |
428 |
popd |
popd |
429 |
%patch2 -p1 |
%patch2 -p1 |
430 |
|
%patch3 -p1 -R |
431 |
|
%patch4 -p1 |
432 |
|
|
433 |
%if "%{python}" == "python3" |
%if "%{python}" == "python3" |
434 |
sed -i.try-py3 -e '/try python2.7/i try python3 "$@"' ./configure |
sed -i.try-py3 -e '/try python2.7/i try python3 "$@"' ./configure |
446 |
rm -rf src/tools/lld |
rm -rf src/tools/lld |
447 |
rm -rf src/tools/lldb |
rm -rf src/tools/lldb |
448 |
|
|
449 |
# extract bundled licenses for packaging |
# rename bundled license for packaging |
450 |
sed -e '/*\//q' src/libbacktrace/backtrace.h \ |
cp -a vendor/backtrace-sys/src/libbacktrace/LICENSE{,-libbacktrace} |
|
>src/libbacktrace/LICENSE-libbacktrace |
|
451 |
|
|
452 |
%if %{with bundled_llvm} && 0%{?epel} |
%if %{with bundled_llvm} && 0%{?epel} |
453 |
mkdir -p cmake-bin |
mkdir -p cmake-bin |
490 |
%global common_libdir %{_prefix}/lib |
%global common_libdir %{_prefix}/lib |
491 |
%global rustlibdir %{common_libdir}/rustlib |
%global rustlibdir %{common_libdir}/rustlib |
492 |
|
|
493 |
%ifarch %{arm} %{ix86} |
%ifarch %{arm} %{ix86} s390x |
494 |
# full debuginfo is exhausting memory; just do libstd for now |
# full debuginfo is exhausting memory; just do libstd for now |
495 |
# https://github.com/rust-lang/rust/issues/45854 |
# https://github.com/rust-lang/rust/issues/45854 |
496 |
%if (0%{?fedora} && 0%{?fedora} < 27) || (0%{?rhel} && 0%{?rhel} <= 7) |
%if (0%{?fedora} && 0%{?fedora} < 27) || (0%{?rhel} && 0%{?rhel} <= 7) |
604 |
%{python} ./x.py test --no-fail-fast rustfmt || : |
%{python} ./x.py test --no-fail-fast rustfmt || : |
605 |
|
|
606 |
|
|
607 |
%if ! 0%{?mageia} |
%{?ldconfig_scriptlets} |
|
%ldconfig_scriptlets |
|
|
%endif |
|
608 |
|
|
609 |
|
|
610 |
%files |
%files |
611 |
%license COPYRIGHT LICENSE-APACHE LICENSE-MIT |
%license COPYRIGHT LICENSE-APACHE LICENSE-MIT |
612 |
%license src/libbacktrace/LICENSE-libbacktrace |
%license vendor/backtrace-sys/src/libbacktrace/LICENSE-libbacktrace |
613 |
%doc README.md |
%doc README.md |
614 |
%{_bindir}/rustc |
%{_bindir}/rustc |
615 |
%{_bindir}/rustdoc |
%{_bindir}/rustdoc |
621 |
%dir %{rustlibdir}/%{rust_triple}/lib |
%dir %{rustlibdir}/%{rust_triple}/lib |
622 |
%{rustlibdir}/%{rust_triple}/lib/*.so |
%{rustlibdir}/%{rust_triple}/lib/*.so |
623 |
%{rustlibdir}/%{rust_triple}/codegen-backends/ |
%{rustlibdir}/%{rust_triple}/codegen-backends/ |
624 |
|
%exclude %{_bindir}/*miri |
625 |
|
|
626 |
|
|
627 |
%files std-static |
%files std-static |