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.27.1 |
%global bootstrap_rust 1.28.0 |
18 |
%global bootstrap_cargo 1.27.0 |
%global bootstrap_cargo 1.28.0 |
19 |
%global bootstrap_channel %{bootstrap_rust} |
%global bootstrap_channel %{bootstrap_rust} |
20 |
%global bootstrap_date 2018-07-20 |
%global bootstrap_date 2018-08-02 |
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} |
26 |
%bcond_with llvm_static |
%bcond_with llvm_static |
27 |
|
|
28 |
# 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 |
29 |
# is insufficient. Rust currently requires LLVM 3.9+. |
# is insufficient. Rust currently requires LLVM 5.0+. |
30 |
%if 0%{?rhel} && !0%{?epel} |
%if 0%{?rhel} && !0%{?epel} |
31 |
%bcond_without bundled_llvm |
%bcond_without bundled_llvm |
32 |
%else |
%else |
39 |
# So, tread carefully if you toggle this... |
# So, tread carefully if you toggle this... |
40 |
%bcond_without bundled_libgit2 |
%bcond_without bundled_libgit2 |
41 |
|
|
42 |
|
%if 0%{?rhel} |
43 |
|
%bcond_without bundled_libssh2 |
44 |
|
%else |
45 |
|
%bcond_with bundled_libssh2 |
46 |
|
%endif |
47 |
|
|
48 |
# LLDB only works on some architectures |
# LLDB only works on some architectures |
49 |
%ifarch %{arm} aarch64 %{ix86} x86_64 |
%ifarch %{arm} aarch64 %{ix86} x86_64 |
50 |
# LLDB isn't available everywhere... |
# LLDB isn't available everywhere... |
60 |
# Some sub-packages are versioned independently of the rust compiler and runtime itself. |
# Some sub-packages are versioned independently of the rust compiler and runtime itself. |
61 |
# Also beware that if any of these are not changed in a version bump, then the release |
# Also beware that if any of these are not changed in a version bump, then the release |
62 |
# number should still increase, not be reset to 1! |
# number should still increase, not be reset to 1! |
63 |
%global rustc_version 1.28.0 |
%global rustc_version 1.29.1 |
64 |
%global cargo_version 1.28.0 |
%global cargo_version 1.29.0 |
65 |
%global rustfmt_version 0.8.2 |
%global rustfmt_version 0.99.1 |
66 |
%global rls_version 0.128.0 |
%global rls_version 0.130.0 |
67 |
|
%global clippy_version 0.0.212 |
68 |
|
|
69 |
Name: rust |
Name: rust |
70 |
Version: %{rustc_version} |
Version: %{rustc_version} |
71 |
Release: %mkrel 3 |
Release: %mkrel 1 |
72 |
Summary: The Rust Programming Language |
Summary: The Rust Programming Language |
73 |
%if 0%{?mageia} |
%if 0%{?mageia} |
74 |
Group: Development/Other |
Group: Development/Other |
85 |
%endif |
%endif |
86 |
Source0: https://static.rust-lang.org/dist/%{rustc_package}.tar.xz |
Source0: https://static.rust-lang.org/dist/%{rustc_package}.tar.xz |
87 |
|
|
|
# https://github.com/rust-lang/rust/pull/52760 |
|
|
Patch1: rust-52760-test_loading_atoi.patch |
|
|
|
|
88 |
# https://github.com/rust-lang/rust/pull/52876 |
# https://github.com/rust-lang/rust/pull/52876 |
89 |
Patch2: rust-52876-const-endianess.patch |
Patch1: rust-52876-const-endianess.patch |
90 |
|
|
91 |
|
# https://github.com/rust-lang/rust/pull/53436 |
92 |
|
Patch2: 0001-std-stop-backtracing-when-the-frames-are-full.patch |
93 |
|
|
94 |
|
# https://github.com/rust-lang/rust/pull/53437 |
95 |
|
Patch3: 0001-Set-more-llvm-function-attributes-for-__rust_try.patch |
96 |
|
|
97 |
# Get the Rust triple for any arch. |
# Get the Rust triple for any arch. |
98 |
%{lua: function rust_triple(arch) |
%{lua: function rust_triple(arch) |
155 |
BuildRequires: curl |
BuildRequires: curl |
156 |
BuildRequires: pkgconfig(libcurl) |
BuildRequires: pkgconfig(libcurl) |
157 |
BuildRequires: pkgconfig(liblzma) |
BuildRequires: pkgconfig(liblzma) |
|
BuildRequires: pkgconfig(libssh2) |
|
158 |
BuildRequires: pkgconfig(openssl) |
BuildRequires: pkgconfig(openssl) |
159 |
BuildRequires: pkgconfig(zlib) |
BuildRequires: pkgconfig(zlib) |
160 |
|
|
161 |
|
%if %without bundled_libgit2 |
162 |
|
BuildRequires: pkgconfig(libgit2) >= 0.27 |
163 |
|
%endif |
164 |
|
|
165 |
|
%if %without bundled_libssh2 |
166 |
|
# needs libssh2_userauth_publickey_frommemory |
167 |
|
BuildRequires: pkgconfig(libssh2) >= 1.6.0 |
168 |
|
%endif |
169 |
|
|
170 |
%if 0%{?rhel} && 0%{?rhel} <= 7 |
%if 0%{?rhel} && 0%{?rhel} <= 7 |
171 |
%global python python2 |
%global python python2 |
172 |
%else |
%else |
176 |
|
|
177 |
%if %with bundled_llvm |
%if %with bundled_llvm |
178 |
BuildRequires: cmake3 >= 3.4.3 |
BuildRequires: cmake3 >= 3.4.3 |
179 |
Provides: bundled(llvm) = 6.0 |
Provides: bundled(llvm) = 7.0 |
180 |
%else |
%else |
181 |
BuildRequires: cmake >= 2.8.11 |
BuildRequires: cmake >= 2.8.11 |
182 |
%if 0%{?epel} |
%if 0%{?epel} |
188 |
%global llvm llvm |
%global llvm llvm |
189 |
%global llvm_root %{_prefix} |
%global llvm_root %{_prefix} |
190 |
%endif |
%endif |
191 |
BuildRequires: %{llvm}-devel >= 3.9 |
BuildRequires: %{llvm}-devel >= 5.0 |
192 |
%if %with llvm_static |
%if %with llvm_static |
193 |
BuildRequires: %{llvm}-static |
BuildRequires: %{llvm}-static |
194 |
BuildRequires: libffi-devel |
BuildRequires: libffi-devel |
222 |
%endif |
%endif |
223 |
|
|
224 |
# ALL Rust libraries are private, because they don't keep an ABI. |
# ALL Rust libraries are private, because they don't keep an ABI. |
225 |
%global _privatelibs lib(.*-[[:xdigit:]]*|rustc.*)[.]so.* |
%global _privatelibs lib(.*-[[:xdigit:]]{16}*|rustc.*)[.]so.* |
226 |
%global __provides_exclude ^(%{_privatelibs})$ |
%global __provides_exclude ^(%{_privatelibs})$ |
227 |
%global __requires_exclude ^(%{_privatelibs})$ |
%global __requires_exclude ^(%{_privatelibs})$ |
228 |
%global __provides_exclude_from ^(%{_docdir}|%{rustlibdir}/src)/.*$ |
%global __provides_exclude_from ^(%{_docdir}|%{rustlibdir}/src)/.*$ |
327 |
Version: %{cargo_version} |
Version: %{cargo_version} |
328 |
%if %with bundled_libgit2 |
%if %with bundled_libgit2 |
329 |
Provides: bundled(libgit2) = 0.27 |
Provides: bundled(libgit2) = 0.27 |
330 |
%else |
%endif |
331 |
BuildRequires: pkgconfig(libgit2) >= 0.27 |
%if %with bundled_libssh2 |
332 |
|
Provides: bundled(libssh2) = 1.8.1 |
333 |
%endif |
%endif |
334 |
# For tests: |
# For tests: |
335 |
BuildRequires: git |
BuildRequires: git |
351 |
BuildArch: noarch |
BuildArch: noarch |
352 |
# Cargo no longer builds its own documentation |
# Cargo no longer builds its own documentation |
353 |
# https://github.com/rust-lang/cargo/pull/4904 |
# https://github.com/rust-lang/cargo/pull/4904 |
354 |
Requires: rust-doc |
Requires: rust-doc = %{rustc_version}-%{release} |
355 |
|
|
356 |
%if 0%{?mageia} |
%if 0%{?mageia} |
357 |
Obsoletes: cargo-doc < 1.26.0-1 |
Obsoletes: cargo-doc < 1.26.0-1 |
382 |
%if %with bundled_libgit2 |
%if %with bundled_libgit2 |
383 |
Provides: bundled(libgit2) = 0.27 |
Provides: bundled(libgit2) = 0.27 |
384 |
%endif |
%endif |
385 |
|
%if %with bundled_libssh2 |
386 |
|
Provides: bundled(libssh2) = 1.8.1 |
387 |
|
%endif |
388 |
Requires: rust-analysis |
Requires: rust-analysis |
389 |
# /usr/bin/rls is dynamically linked against internal rustc libs |
# /usr/bin/rls is dynamically linked against internal rustc libs |
390 |
Requires: %{name}%{?_isa} = %{rustc_version}-%{release} |
Requires: %{name}%{?_isa} = %{rustc_version}-%{release} |
396 |
reformatting, and code completion, and enables renaming and refactorings. |
reformatting, and code completion, and enables renaming and refactorings. |
397 |
|
|
398 |
|
|
399 |
|
%package -n clippy-preview |
400 |
|
Summary: Lints to catch common mistakes and improve your Rust code |
401 |
|
Version: %{clippy_version} |
402 |
|
License: MPLv2.0 |
403 |
|
Provides: clippy = %{clippy_version} |
404 |
|
Requires: cargo |
405 |
|
# /usr/bin/clippy-driver is dynamically linked against internal rustc libs |
406 |
|
Requires: %{name}%{?_isa} = %{rustc_version}-%{release} |
407 |
|
|
408 |
|
%description -n clippy-preview |
409 |
|
A collection of lints to catch common mistakes and improve your Rust code. |
410 |
|
|
411 |
|
|
412 |
%package src |
%package src |
413 |
Summary: Sources for the Rust standard library |
Summary: Sources for the Rust standard library |
414 |
BuildArch: noarch |
BuildArch: noarch |
442 |
|
|
443 |
%patch1 -p1 |
%patch1 -p1 |
444 |
%patch2 -p1 |
%patch2 -p1 |
445 |
|
%patch3 -p1 |
446 |
|
|
447 |
%if "%{python}" == "python3" |
%if "%{python}" == "python3" |
448 |
sed -i.try-py3 -e '/try python2.7/i try python3 "$@"' ./configure |
sed -i.try-py3 -e '/try python2.7/i try python3 "$@"' ./configure |
494 |
export LIBGIT2_SYS_USE_PKG_CONFIG=1 |
export LIBGIT2_SYS_USE_PKG_CONFIG=1 |
495 |
%endif |
%endif |
496 |
|
|
497 |
|
%if %without bundled_libssh2 |
498 |
|
# convince libssh2-sys to use the distro libssh2 |
499 |
|
export LIBSSH2_SYS_USE_PKG_CONFIG=1 |
500 |
|
%endif |
501 |
|
|
502 |
%{?cmake_path:export PATH=%{cmake_path}:$PATH} |
%{?cmake_path:export PATH=%{cmake_path}:$PATH} |
503 |
%{?library_path:export LIBRARY_PATH="%{library_path}"} |
%{?library_path:export LIBRARY_PATH="%{library_path}"} |
504 |
%{?rustflags:export RUSTFLAGS="%{rustflags}"} |
%{?rustflags:export RUSTFLAGS="%{rustflags}"} |
569 |
# Remove backup files from %%configure munging |
# Remove backup files from %%configure munging |
570 |
find %{buildroot}%{rustlibdir} -type f -name '*.orig' -exec rm -v '{}' '+' |
find %{buildroot}%{rustlibdir} -type f -name '*.orig' -exec rm -v '{}' '+' |
571 |
|
|
572 |
|
# https://fedoraproject.org/wiki/Changes/Make_ambiguous_python_shebangs_error |
573 |
|
# We don't actually need to ship any of those python scripts in rust-src anyway. |
574 |
|
find %{buildroot}%{rustlibdir}/src -type f -name '*.py' -exec rm -v '{}' '+' |
575 |
|
|
576 |
# FIXME: __os_install_post will strip the rlibs |
# FIXME: __os_install_post will strip the rlibs |
577 |
# -- should we find a way to preserve debuginfo? |
# -- should we find a way to preserve debuginfo? |
578 |
|
|
579 |
# Remove unwanted documentation files (we already package them) |
# Remove unwanted documentation files (we already package them) |
580 |
rm -f %{buildroot}%{_docdir}/%{name}/README.md |
rm -f %{buildroot}%{_docdir}/%{name}/README.md |
581 |
rm -f %{buildroot}%{_docdir}/%{name}/COPYRIGHT |
rm -f %{buildroot}%{_docdir}/%{name}/COPYRIGHT |
582 |
|
rm -f %{buildroot}%{_docdir}/%{name}/LICENSE |
583 |
rm -f %{buildroot}%{_docdir}/%{name}/LICENSE-APACHE |
rm -f %{buildroot}%{_docdir}/%{name}/LICENSE-APACHE |
584 |
rm -f %{buildroot}%{_docdir}/%{name}/LICENSE-MIT |
rm -f %{buildroot}%{_docdir}/%{name}/LICENSE-MIT |
585 |
rm -f %{buildroot}%{_docdir}/%{name}/LICENSE-THIRD-PARTY |
rm -f %{buildroot}%{_docdir}/%{name}/LICENSE-THIRD-PARTY |
594 |
|
|
595 |
# Cargo no longer builds its own documentation |
# Cargo no longer builds its own documentation |
596 |
# https://github.com/rust-lang/cargo/pull/4904 |
# https://github.com/rust-lang/cargo/pull/4904 |
597 |
mkdir -p %{buildroot}%{_docdir}/cargo/html |
mkdir -p %{buildroot}%{_docdir}/cargo |
598 |
cat <<EOF > %{buildroot}%{_docdir}/cargo/html/index.html |
ln -sT ../rust/html/cargo/ %{buildroot}%{_docdir}/cargo/html |
|
<!DOCTYPE HTML> |
|
|
<html lang="en-US"> |
|
|
<head> |
|
|
<meta charset="UTF-8"> |
|
|
<meta http-equiv="refresh" content="0; url=../../rust/html/cargo/index.html"> |
|
|
<script type="text/javascript"> |
|
|
window.location.href = "../../rust/html/cargo/index.html" |
|
|
</script> |
|
|
<title>cargo-doc redirection</title> |
|
|
</head> |
|
|
<body> |
|
|
Cargo documentation has been moved to the rust-doc package. |
|
|
If you are not redirected automatically, please follow this |
|
|
<a href="../../rust/html/cargo/index.html">link</a>. |
|
|
</body> |
|
|
</html> |
|
|
EOF |
|
599 |
|
|
600 |
%if %without lldb |
%if %without lldb |
601 |
rm -f %{buildroot}%{_bindir}/rust-lldb |
rm -f %{buildroot}%{_bindir}/rust-lldb |
611 |
# 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. |
612 |
%{python} ./x.py test --no-fail-fast || : |
%{python} ./x.py test --no-fail-fast || : |
613 |
%{python} ./x.py test --no-fail-fast cargo || : |
%{python} ./x.py test --no-fail-fast cargo || : |
614 |
|
%{python} ./x.py test --no-fail-fast clippy || : |
615 |
%{python} ./x.py test --no-fail-fast rls || : |
%{python} ./x.py test --no-fail-fast rls || : |
616 |
%{python} ./x.py test --no-fail-fast rustfmt || : |
%{python} ./x.py test --no-fail-fast rustfmt || : |
617 |
|
|
687 |
|
|
688 |
|
|
689 |
%files -n cargo-doc |
%files -n cargo-doc |
690 |
|
%docdir %{_docdir}/cargo |
691 |
|
%dir %{_docdir}/cargo |
692 |
%{_docdir}/cargo/html |
%{_docdir}/cargo/html |
693 |
|
|
694 |
|
|
705 |
%license src/tools/rls/LICENSE-{APACHE,MIT} |
%license src/tools/rls/LICENSE-{APACHE,MIT} |
706 |
|
|
707 |
|
|
708 |
|
%files -n clippy-preview |
709 |
|
%{_bindir}/cargo-clippy |
710 |
|
%{_bindir}/clippy-driver |
711 |
|
%doc src/tools/clippy/{README.md,CHANGELOG.md} |
712 |
|
%license src/tools/clippy/LICENSE |
713 |
|
|
714 |
|
|
715 |
%files src |
%files src |
716 |
%dir %{rustlibdir} |
%dir %{rustlibdir} |
717 |
%{rustlibdir}/src |
%{rustlibdir}/src |