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.30.0 |
%global bootstrap_rust 1.31.1 |
18 |
%global bootstrap_cargo 1.30.0 |
%global bootstrap_cargo 1.31.0 |
19 |
%global bootstrap_channel %{bootstrap_rust} |
%global bootstrap_channel %{bootstrap_rust} |
20 |
%global bootstrap_date 2018-10-25 |
%global bootstrap_date 2018-12-20 |
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} |
57 |
%bcond_with lldb |
%bcond_with lldb |
58 |
%endif |
%endif |
59 |
|
|
|
# Some sub-packages are versioned independently of the rust compiler and runtime itself. |
|
|
# Also beware that if any of these are not changed in a version bump, then the release |
|
|
# number should still increase, not be reset to 1! |
|
|
%global rustc_version 1.31.0 |
|
|
%global cargo_version 1.31.0 |
|
|
%global rustfmt_version 1.0.0 |
|
|
%global rls_version 1.31.6 |
|
|
%global clippy_version 0.0.212 |
|
|
|
|
60 |
Name: rust |
Name: rust |
61 |
Version: %{rustc_version} |
Version: 1.32.0 |
62 |
Release: %mkrel 5 |
Release: %mkrel 1 |
63 |
Summary: The Rust Programming Language |
Summary: The Rust Programming Language |
64 |
%if 0%{?mageia} |
%if 0%{?mageia} |
65 |
Group: Development/Other |
Group: Development/Other |
70 |
ExclusiveArch: %{rust_arches} |
ExclusiveArch: %{rust_arches} |
71 |
|
|
72 |
%if "%{channel}" == "stable" |
%if "%{channel}" == "stable" |
73 |
%global rustc_package rustc-%{rustc_version}-src |
%global rustc_package rustc-%{version}-src |
74 |
%else |
%else |
75 |
%global rustc_package rustc-%{channel}-src |
%global rustc_package rustc-%{channel}-src |
76 |
%endif |
%endif |
77 |
Source0: https://static.rust-lang.org/dist/%{rustc_package}.tar.xz |
Source0: https://static.rust-lang.org/dist/%{rustc_package}.tar.xz |
78 |
|
|
79 |
# https://github.com/rust-lang/rust/pull/56394 |
# https://github.com/rust-dev-tools/rls-analysis/pull/160 |
80 |
Patch1: 0001-Deal-with-EINTR-in-net-timeout-tests.patch |
Patch1: 0001-Try-to-get-the-target-triple-from-rustc-itself.patch |
81 |
|
|
82 |
|
# https://github.com/rust-lang/rust/pull/57453 |
83 |
|
Patch2: 0001-lldb_batchmode.py-try-import-_thread-for-Python-3.patch |
84 |
|
|
85 |
# Get the Rust triple for any arch. |
# Get the Rust triple for any arch. |
86 |
%{lua: function rust_triple(arch) |
%{lua: function rust_triple(arch) |
128 |
%else |
%else |
129 |
BuildRequires: cargo >= %{bootstrap_cargo} |
BuildRequires: cargo >= %{bootstrap_cargo} |
130 |
%if 0%{?fedora} >= 27 |
%if 0%{?fedora} >= 27 |
131 |
BuildRequires: (%{name} >= %{bootstrap_rust} with %{name} <= %{rustc_version}) |
BuildRequires: (%{name} >= %{bootstrap_rust} with %{name} <= %{version}) |
132 |
%else |
%else |
133 |
BuildRequires: %{name} >= %{bootstrap_rust} |
BuildRequires: %{name} >= %{bootstrap_rust} |
134 |
BuildConflicts: %{name} > %{rustc_version} |
BuildConflicts: %{name} > %{version} |
135 |
%endif |
%endif |
136 |
%global local_rust_root %{_prefix} |
%global local_rust_root %{_prefix} |
137 |
%endif |
%endif |
194 |
Provides: bundled(miniz) = 1.16~beta+r1 |
Provides: bundled(miniz) = 1.16~beta+r1 |
195 |
|
|
196 |
# Virtual provides for folks who attempt "dnf install rustc" |
# Virtual provides for folks who attempt "dnf install rustc" |
197 |
Provides: rustc = %{rustc_version}-%{release} |
Provides: rustc = %{version}-%{release} |
198 |
Provides: rustc%{?_isa} = %{rustc_version}-%{release} |
Provides: rustc%{?_isa} = %{version}-%{release} |
199 |
|
|
200 |
# Always require our exact standard library |
# Always require our exact standard library |
201 |
Requires: %{name}-std-static%{?_isa} = %{rustc_version}-%{release} |
Requires: %{name}-std-static%{?_isa} = %{version}-%{release} |
202 |
|
|
203 |
# The C compiler is needed at runtime just for linking. Someday rustc might |
# The C compiler is needed at runtime just for linking. Someday rustc might |
204 |
# invoke the linker directly, and then we'll only need binutils. |
# invoke the linker directly, and then we'll only need binutils. |
268 |
Summary: GDB pretty printers for Rust |
Summary: GDB pretty printers for Rust |
269 |
BuildArch: noarch |
BuildArch: noarch |
270 |
Requires: gdb |
Requires: gdb |
271 |
Requires: %{name}-debugger-common = %{rustc_version}-%{release} |
Requires: %{name}-debugger-common = %{version}-%{release} |
272 |
|
|
273 |
%if 0%{?mageia} == 6 |
%if 0%{?mageia} == 6 |
274 |
# (akien) Handle moved files between our old Mageia package and this Fedora-based one |
# (akien) Handle moved files between our old Mageia package and this Fedora-based one |
294 |
%else |
%else |
295 |
Requires: python2-lldb |
Requires: python2-lldb |
296 |
%endif |
%endif |
297 |
Requires: %{name}-debugger-common = %{rustc_version}-%{release} |
Requires: %{name}-debugger-common = %{version}-%{release} |
298 |
|
|
299 |
%description lldb |
%description lldb |
300 |
This package includes the rust-lldb script, which allows easier debugging of Rust |
This package includes the rust-lldb script, which allows easier debugging of Rust |
317 |
|
|
318 |
%package -n cargo |
%package -n cargo |
319 |
Summary: Rust's package manager and build tool |
Summary: Rust's package manager and build tool |
|
Version: %{cargo_version} |
|
320 |
%if %with bundled_libgit2 |
%if %with bundled_libgit2 |
321 |
Provides: bundled(libgit2) = 0.27 |
Provides: bundled(libgit2) = 0.27 |
322 |
%endif |
%endif |
339 |
|
|
340 |
%package -n cargo-doc |
%package -n cargo-doc |
341 |
Summary: Documentation for Cargo |
Summary: Documentation for Cargo |
|
Version: %{cargo_version} |
|
342 |
BuildArch: noarch |
BuildArch: noarch |
343 |
# Cargo no longer builds its own documentation |
# Cargo no longer builds its own documentation |
344 |
# https://github.com/rust-lang/cargo/pull/4904 |
# https://github.com/rust-lang/cargo/pull/4904 |
345 |
Requires: rust-doc = %{rustc_version}-%{release} |
Requires: rust-doc = %{version}-%{release} |
346 |
|
|
347 |
%if 0%{?mageia} |
%if 0%{?mageia} |
348 |
Obsoletes: cargo-doc < 1.26.0-1 |
Obsoletes: cargo-doc < 1.26.0-1 |
354 |
|
|
355 |
%package -n rustfmt |
%package -n rustfmt |
356 |
Summary: Tool to find and fix Rust formatting issues |
Summary: Tool to find and fix Rust formatting issues |
|
Version: %{rustfmt_version} |
|
357 |
Requires: cargo |
Requires: cargo |
358 |
|
|
359 |
# The component/package was rustfmt-preview until Rust 1.31. |
# The component/package was rustfmt-preview until Rust 1.31. |
360 |
Obsoletes: rustfmt-preview < 1.0.0 |
Obsoletes: rustfmt-preview < 1.0.0 |
361 |
Provides: rustfmt-preview = %{rustfmt_version}-%{release} |
Provides: rustfmt-preview = %{version}-%{release} |
362 |
|
|
363 |
%description -n rustfmt |
%description -n rustfmt |
364 |
A tool for formatting Rust code according to style guidelines. |
A tool for formatting Rust code according to style guidelines. |
366 |
|
|
367 |
%package -n rls |
%package -n rls |
368 |
Summary: Rust Language Server for IDE integration |
Summary: Rust Language Server for IDE integration |
|
Version: %{rls_version} |
|
|
Provides: rls = %{rls_version} |
|
369 |
%if %with bundled_libgit2 |
%if %with bundled_libgit2 |
370 |
Provides: bundled(libgit2) = 0.27 |
Provides: bundled(libgit2) = 0.27 |
371 |
%endif |
%endif |
374 |
%endif |
%endif |
375 |
Requires: rust-analysis |
Requires: rust-analysis |
376 |
# /usr/bin/rls is dynamically linked against internal rustc libs |
# /usr/bin/rls is dynamically linked against internal rustc libs |
377 |
Requires: %{name}%{?_isa} = %{rustc_version}-%{release} |
Requires: %{name}%{?_isa} = %{version}-%{release} |
378 |
|
|
379 |
# The component/package was rls-preview until Rust 1.31. |
# The component/package was rls-preview until Rust 1.31. |
380 |
Obsoletes: rls-preview < 1.31.6 |
Obsoletes: rls-preview < 1.31.6 |
381 |
Provides: rls-preview = %{rls_version}-%{release} |
Provides: rls-preview = %{version}-%{release} |
382 |
|
|
383 |
%description -n rls |
%description -n rls |
384 |
The Rust Language Server provides a server that runs in the background, |
The Rust Language Server provides a server that runs in the background, |
389 |
|
|
390 |
%package -n clippy |
%package -n clippy |
391 |
Summary: Lints to catch common mistakes and improve your Rust code |
Summary: Lints to catch common mistakes and improve your Rust code |
|
Version: %{clippy_version} |
|
|
Provides: clippy = %{clippy_version} |
|
392 |
Requires: cargo |
Requires: cargo |
393 |
# /usr/bin/clippy-driver is dynamically linked against internal rustc libs |
# /usr/bin/clippy-driver is dynamically linked against internal rustc libs |
394 |
Requires: %{name}%{?_isa} = %{rustc_version}-%{release} |
Requires: %{name}%{?_isa} = %{version}-%{release} |
395 |
|
|
396 |
# The component/package was clippy-preview until Rust 1.31. |
# The component/package was clippy-preview until Rust 1.31. |
397 |
Obsoletes: clippy-preview <= 0.0.212 |
Obsoletes: clippy-preview <= 0.0.212 |
398 |
Provides: clippy-preview = %{clippy_version}-%{release} |
Provides: clippy-preview = %{version}-%{release} |
399 |
|
|
400 |
%description -n clippy |
%description -n clippy |
401 |
A collection of lints to catch common mistakes and improve your Rust code. |
A collection of lints to catch common mistakes and improve your Rust code. |
412 |
|
|
413 |
%package analysis |
%package analysis |
414 |
Summary: Compiler analysis data for the Rust standard library |
Summary: Compiler analysis data for the Rust standard library |
415 |
Requires: rust-std-static%{?_isa} = %{rustc_version}-%{release} |
Requires: rust-std-static%{?_isa} = %{version}-%{release} |
416 |
|
|
417 |
%description analysis |
%description analysis |
418 |
This package contains analysis data files produced with rustc's -Zsave-analysis |
This package contains analysis data files produced with rustc's -Zsave-analysis |
432 |
|
|
433 |
%setup -q -n %{rustc_package} |
%setup -q -n %{rustc_package} |
434 |
|
|
435 |
|
pushd vendor/rls-analysis |
436 |
%patch1 -p1 |
%patch1 -p1 |
437 |
|
popd |
438 |
|
%patch2 -p1 |
439 |
|
|
440 |
%if "%{python}" == "python3" |
%if "%{python}" == "python3" |
441 |
sed -i.try-py3 -e '/try python2.7/i try python3 "$@"' ./configure |
sed -i.try-py3 -e '/try python2.7/i try python3 "$@"' ./configure |
442 |
%endif |
%endif |
443 |
|
|
|
# We're disabling jemalloc, but rust-src still wants it. |
|
|
# rm -rf src/jemalloc/ |
|
|
|
|
444 |
%if %without bundled_llvm |
%if %without bundled_llvm |
445 |
rm -rf src/llvm/ |
rm -rf src/llvm/ |
446 |
%endif |
%endif |
473 |
# The configure macro will modify some autoconf-related files, which upsets |
# The configure macro will modify some autoconf-related files, which upsets |
474 |
# cargo when it tries to verify checksums in those files. If we just truncate |
# cargo when it tries to verify checksums in those files. If we just truncate |
475 |
# that file list, cargo won't have anything to complain about. |
# that file list, cargo won't have anything to complain about. |
476 |
find src/vendor -name .cargo-checksum.json \ |
find vendor -name .cargo-checksum.json \ |
477 |
-exec sed -i.uncheck -e 's/"files":{[^}]*}/"files":{ }/' '{}' '+' |
-exec sed -i.uncheck -e 's/"files":{[^}]*}/"files":{ }/' '{}' '+' |
478 |
|
|
479 |
|
|
519 |
%{!?with_bundled_llvm: --llvm-root=%{llvm_root} \ |
%{!?with_bundled_llvm: --llvm-root=%{llvm_root} \ |
520 |
%{!?llvm_has_filecheck: --disable-codegen-tests} \ |
%{!?llvm_has_filecheck: --disable-codegen-tests} \ |
521 |
%{!?with_llvm_static: --enable-llvm-link-shared } } \ |
%{!?with_llvm_static: --enable-llvm-link-shared } } \ |
|
--disable-jemalloc \ |
|
522 |
--disable-rpath \ |
--disable-rpath \ |
523 |
%{enable_debuginfo} \ |
%{enable_debuginfo} \ |
524 |
--enable-extended \ |
--enable-extended \ |