X-Git-Url: http://git.pld-linux.org/?p=packages%2Frust.git;a=blobdiff_plain;f=rust.spec;h=c41a0cb14b560d6dbb4342ea3b5b5b5193d51926;hp=c716a90a0175013d7685bc88d8d8301ca3f84ca9;hb=b263378;hpb=fe49e3fce9ff7955ea282779408960df009c819e diff --git a/rust.spec b/rust.spec index c716a90..c41a0cb 100644 --- a/rust.spec +++ b/rust.spec @@ -21,60 +21,113 @@ # To bootstrap from scratch, set the channel and date from src/stage0.txt # e.g. 1.10.0 wants rustc: 1.9.0-2016-05-24 # or nightly wants some beta-YYYY-MM-DD -%define bootstrap_rust 1.33.0 -%define bootstrap_cargo 0.34.0 -%define bootstrap_date 2019-02-28 +%define bootstrap_rust 1.51.0 +%define bootstrap_cargo 1.51.0 +%define bootstrap_date 2021-03-25 + +%ifarch x32 +%define with_cross 1 +%endif + +%if %{without full_debuginfo} +%define _enable_debug_packages 0 +%endif Summary: The Rust Programming Language Summary(pl.UTF-8): Język programowania Rust Name: rust -Version: 1.34.0 +Version: 1.52.1 Release: 1 # Licenses: (rust itself) and (bundled libraries) License: (Apache v2.0 or MIT) and (BSD and ISC and MIT) Group: Development/Languages -Source0: https://static.rust-lang.org/dist/%{rustc_package}.tar.gz -# Source0-md5: 0a09731ce756c7996091517bec197dcc -Source1: https://static.rust-lang.org/dist/%{bootstrap_date}/rust-%{bootstrap_rust}-x86_64-unknown-linux-gnu.tar.gz -# Source1-md5: e037dff9bd3dc5160ff5aa9049908f94 -Source2: https://static.rust-lang.org/dist/%{bootstrap_date}/rust-%{bootstrap_rust}-i686-unknown-linux-gnu.tar.gz -# Source2-md5: 9d3daf9e2e5e12b545b48a0037880519 -Patch0: x32.patch +Source0: https://static.rust-lang.org/dist/%{rustc_package}.tar.xz +# Source0-md5: 2df4835e3a15cc6f7e06fa4a986285d2 +Source1: https://static.rust-lang.org/dist/%{bootstrap_date}/rust-%{bootstrap_rust}-x86_64-unknown-linux-gnu.tar.xz +# Source1-md5: 7640d6538716c6492e56f361e3af0631 +Source2: https://static.rust-lang.org/dist/%{bootstrap_date}/rust-%{bootstrap_rust}-i686-unknown-linux-gnu.tar.xz +# Source2-md5: 64f117dc1ae1543c8910eaa9a971ddd4 +Source3: https://static.rust-lang.org/dist/%{bootstrap_date}/rust-%{bootstrap_rust}-aarch64-unknown-linux-gnu.tar.xz +# Source3-md5: 3ac79872671df7ea0215fd351f52ffcf +Source4: https://static.rust-lang.org/dist/%{bootstrap_date}/rust-%{bootstrap_rust}-arm-unknown-linux-gnueabihf.tar.xz +# Source4-md5: f624772d7c7ba2e83a51b4e9c1657f7b +Patch0: %{name}-x32.patch URL: https://www.rust-lang.org/ # for src/compiler-rt BuildRequires: cmake >= 3.4.3 BuildRequires: curl -BuildRequires: libstdc++-devel -%{?with_system_llvm:BuildRequires: llvm-devel} -BuildRequires: ncurses-devel +# make check needs "ps" for src/test/run-pass/wait-forked-but-failed-child.rs +BuildRequires: procps BuildRequires: python >= 1:2.7 +BuildRequires: rpmbuild(macros) >= 1.752 +%if %{without cross} +BuildRequires: curl-devel +BuildRequires: libgit2-devel >= 1.1.0 +BuildRequires: libstdc++-devel +%{?with_system_llvm:BuildRequires: llvm-devel >= 9.0} +BuildRequires: openssl-devel >= 1.0.1 +BuildRequires: tar >= 1:1.22 +BuildRequires: xz BuildRequires: zlib-devel +%endif %if %{without bootstrap} BuildRequires: %{name} >= %{bootstrap_rust} BuildRequires: cargo >= %{bootstrap_cargo} BuildConflicts: %{name} > %{version} %endif -# make check needs "ps" for src/test/run-pass/wait-forked-but-failed-child.rs -BuildRequires: procps +%ifarch x32 +BuildRequires: glibc-devel(x32) +BuildRequires: glibc-devel(x86_64) +%if "%{_host_cpu}" == "x86_64" +# building on x86_64 host with --target x32-pld-linux +BuildRequires: curl-devel +BuildRequires: gcc-multilib-x32 +BuildRequires: libgit2-devel >= 1.1.0 +BuildRequires: libstdc++-devel +%{?with_system_llvm:BuildRequires: llvm-devel >= 9.0} +BuildRequires: openssl-devel >= 1.0.1 +BuildRequires: zlib-devel +%else +# building x86_64-hosted crosscompiler on x32 host +BuildRequires: curl-devel(x86-64) +BuildRequires: gcc-multilib-64 +BuildRequires: libgit2-devel(x86-64) >= 1.1.0 +BuildRequires: libstdc++-multilib-64-devel +%{?with_system_llvm:BuildRequires: llvm-devel(x86-64) >= 9.0} +BuildRequires: openssl-devel(x86-64) +BuildRequires: zlib-devel(x86-64) +%endif +%endif # The C compiler is needed at runtime just for linking. Someday rustc might # invoke the linker directly, and then we'll only need binutils. # https://github.com/rust-lang/rust/issues/11937 Requires: gcc # Only x86_64 and i686 are Tier 1 platforms at this time. -# https://doc.rust-lang.org/stable/book/getting-started.html#tier-1 -ExclusiveArch: %{x8664} %{ix86} +# x32 is Tier 2, only rust-std is available (no rustc or cargo). +# https://doc.rust-lang.org/nightly/rustc/platform-support.html +ExclusiveArch: %{x8664} %{ix86} x32 aarch64 armv6hl armv7hl armv7hnl BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) %ifarch x32 -%define rust_triple x86_64-unknown-linux-gnux32 +%define rust_triple x86_64-unknown-linux-gnux32 +%define rust_host_triple x86_64-unknown-linux-gnu +%define rust_bootstrap_triple x86_64-unknown-linux-gnu +%else +%ifarch armv6hl armv7hl armv7hnl +%define rust_triple arm-unknown-linux-gnueabihf +%define rust_host_triple %{rust_triple} +%define rust_bootstrap_triple %{rust_triple} %else -%define rust_triple %{_target_cpu}-unknown-linux-gnu +%define rust_triple %{_target_cpu}-unknown-linux-gnu +%define rust_host_triple %{rust_triple} +%define rust_bootstrap_triple %{rust_triple} +%endif %endif %if %{without bootstrap} %define local_rust_root %{_prefix} %else -%define bootstrap_root rust-%{bootstrap_rust}-%{rust_triple} +%define bootstrap_root rust-%{bootstrap_rust}-%{rust_bootstrap_triple} %define local_rust_root %{_builddir}/%{rustc_package}/%{bootstrap_root} %endif @@ -92,6 +145,14 @@ BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) %define _noautoreqfiles lib.*-[[:xdigit:]]{8}[.]so.* %define _noautoprovfiles lib.*-[[:xdigit:]]{8}[.]so.* +%define x_py { \ + x_py() { \ + local cmd="$1"; \ + shift; \ + %{?__jobs:CARGO_BUILD_JOBS=%__jobs }./x.py "$cmd" %{?__jobs:-j %__jobs} "$@"; \ + }; x_py } + + %description Rust is a systems programming language that runs blazingly fast, prevents segfaults, and guarantees thread safety. @@ -104,6 +165,18 @@ Rust to systemowy język programowania działający bardzo szybko, zapobiegający naruszeniom ochrony pamięci i gwarantujący bezpieczną wielowątkowość. +%package analyzer +Summary: Implementation of Language Server Protocol for Rust +Summary(pl.UTF-8): Implementacja Language Server Protocol dla Rusta +Group: Development/Tools +Requires: %{name} = %{version}-%{release} + +%description analyzer +Implementation of Language Server Protocol for Rust. + +%description analyzer -l pl.UTF-8 +Implementacja Language Server Protocol dla Rusta. + %package debugger-common Summary: Common debugger pretty printers for Rust Summary(pl.UTF-8): Narzędzia wypisujące struktury Rusa wspólne dla różnych debuggerów @@ -149,6 +222,18 @@ debugging of Rust programs. Ten pakiet zawiera skrypt rust-lldb, pozwalający na łatwiejsze odpluskwianie programów w języku Rust. +%package rls +Summary: Rust Language Server for IDE integration +Summary(pl.UTF-8): Rust Language Server do integracji z IDE +Group: Development/Tools +Requires: %{name} = %{version}-%{release} + +%description rls +Rust Language Server for IDE integration. + +%description rls -l pl.UTF-8 +Rust Language Server do integracji z IDE. + %package doc Summary: Documentation for Rust Summary(pl.UTF-8): Dokumentacja do Rusta @@ -205,20 +290,25 @@ Dopełnianie parametrów polecenia cargo w powłoce Zsh. %prep %setup -q -n %{rustc_package} -%ifarch x32 -%patch0 -p1 -%endif +# irrelevant when not building rustc for x32 +#%%patch0 -p1 %if %{with bootstrap} -%ifarch %{x8664} +%ifarch %{x8664} x32 tar xf %{SOURCE1} %endif %ifarch %{ix86} tar xf %{SOURCE2} %endif +%ifarch aarch64 +tar xf %{SOURCE3} +%endif +%ifarch armv6hl armv7hl armv7hnl +tar xf %{SOURCE4} +%endif %{__mv} %{bootstrap_root} %{bootstrap_root}-root %{bootstrap_root}-root/install.sh \ - --components=cargo,rustc,rust-std-%{rust_triple} \ + --components=cargo,rustc,rust-std-%{rust_bootstrap_triple} \ --prefix=%{local_rust_root} \ --disable-ldconfig test -f %{local_rust_root}/bin/cargo @@ -228,11 +318,14 @@ test -f %{local_rust_root}/bin/rustc # unbundle # We're disabling jemalloc, but rust-src still wants it. #%{__rm} -r src/jemalloc -%{?with_system_llvm:%{__rm} -r src/llvm-project} +%if %{with system_llvm} +%{__rm} -r src/llvm-project +mkdir -p src/llvm-project/libunwind +%endif # extract bundled licenses for packaging -sed -e '/*\//q' vendor/backtrace-sys/src/libbacktrace/backtrace.h \ - >vendor/backtrace-sys/src/libbacktrace/LICENSE-libbacktrace +sed -e '/*\//q' library/backtrace/crates/backtrace-sys/src/libbacktrace/backtrace.h \ + >library/backtrace/crates/backtrace-sys/src/libbacktrace/LICENSE-libbacktrace # rust-gdb has hardcoded SYSROOT/lib -- let's make it noarch sed -i -e 's#DIRECTORY=".*"#DIRECTORY="%{_datadir}/%{name}/etc"#' \ @@ -246,8 +339,8 @@ find vendor -name .cargo-checksum.json \ %build %configure \ - --build=%{rust_triple} \ - --host=%{rust_triple} \ + --build=%{rust_bootstrap_triple} \ + --host=%{rust_host_triple} \ --target=%{rust_triple} \ --libdir=%{common_libdir} \ --disable-codegen-tests \ @@ -269,16 +362,16 @@ find vendor -name .cargo-checksum.json \ --llvm-root=%{_prefix} \ --release-channel=%{channel} -RUST_BACKTRACE=full \ -./x.py dist --verbose +export RUST_BACKTRACE=full +%x_py dist --verbose -%{?with_tests:./x.py test} +%{?with_tests:%x_py test} %install rm -rf $RPM_BUILD_ROOT -DESTDIR=$RPM_BUILD_ROOT ./x.py install -DESTDIR=$RPM_BUILD_ROOT ./x.py install src +export DESTDIR=$RPM_BUILD_ROOT +%x_py install # Make sure the shared libraries are in the proper libdir %if "%{_libdir}" != "%{common_libdir}" @@ -331,39 +424,33 @@ rm -rf $RPM_BUILD_ROOT %files %defattr(644,root,root,755) -%doc COPYRIGHT LICENSE-APACHE LICENSE-MIT README.md vendor/backtrace-sys/src/libbacktrace/LICENSE-libbacktrace +%doc COPYRIGHT LICENSE-APACHE LICENSE-MIT README.md library/backtrace/crates/backtrace-sys/src/libbacktrace/LICENSE-libbacktrace %attr(755,root,root) %{_bindir}/miri -%attr(755,root,root) %{_bindir}/rls %attr(755,root,root) %{_bindir}/rustc %attr(755,root,root) %{_bindir}/rustdoc %attr(755,root,root) %{_bindir}/rustfmt -%attr(755,root,root) %{_libdir}/libarena-*.so -%attr(755,root,root) %{_libdir}/libfmt_macros-*.so -%attr(755,root,root) %{_libdir}/libgraphviz-*.so %attr(755,root,root) %{_libdir}/librustc*-*.so -%attr(755,root,root) %{_libdir}/libserialize-*.so %attr(755,root,root) %{_libdir}/libstd-*.so -%attr(755,root,root) %{_libdir}/libsyntax-*.so -%attr(755,root,root) %{_libdir}/libsyntax_ext-*.so -%attr(755,root,root) %{_libdir}/libsyntax_pos-*.so -%attr(755,root,root) %{_libdir}/libterm-*.so %attr(755,root,root) %{_libdir}/libtest-*.so %{_mandir}/man1/rustc.1* %{_mandir}/man1/rustdoc.1* %dir %{rustlibdir} %dir %{rustlibdir}/%{rust_triple} %{rustlibdir}/%{rust_triple}/analysis -%dir %{rustlibdir}/%{rust_triple}/codegen-backends -%attr(755,root,root) %{rustlibdir}/%{rust_triple}/codegen-backends/*.so %dir %{rustlibdir}/%{rust_triple}/lib %attr(755,root,root) %{rustlibdir}/%{rust_triple}/lib/*.so %{rustlibdir}/%{rust_triple}/lib/*.rlib +%files analyzer +%defattr(644,root,root,755) +%attr(755,root,root) %{_bindir}/rust-analyzer + %files debugger-common %defattr(644,root,root,755) %dir %{_datadir}/%{name} %dir %{_datadir}/%{name}/etc -%{_datadir}/%{name}/etc/debugger_*.py* +%{_datadir}/%{name}/etc/lldb_commands +%{_datadir}/%{name}/etc/rust_types.py %files lldb %defattr(644,root,root,755) @@ -376,6 +463,10 @@ rm -rf $RPM_BUILD_ROOT %attr(755,root,root) %{_bindir}/rust-gdbgui %{_datadir}/%{name}/etc/gdb_*.py* +%files rls +%defattr(644,root,root,755) +%attr(755,root,root) %{_bindir}/rls + %files doc %defattr(644,root,root,755) %dir %{_docdir}/%{name} @@ -388,6 +479,7 @@ rm -rf $RPM_BUILD_ROOT %attr(755,root,root) %{_bindir}/cargo-fmt %attr(755,root,root) %{_bindir}/cargo-miri %attr(755,root,root) %{_bindir}/clippy-driver +%attr(755,root,root) %{_libexecdir}/cargo-credential-1password %{_mandir}/man1/cargo*.1* %dir %{_datadir}/cargo %dir %{_datadir}/cargo/registry