X-Git-Url: https://git.pld-linux.org/?p=packages%2Frust.git;a=blobdiff_plain;f=rust.spec;h=0a6380dbeb7d41a50c8eb263d64915cd876f2f4b;hp=57b738fd8b2a1871f9735269416b6d1211137a1b;hb=7da6653;hpb=1dd261609df2d3695385fdeeb35a7a08bf26937b diff --git a/rust.spec b/rust.spec index 57b738f..0a6380d 100644 --- a/rust.spec +++ b/rust.spec @@ -5,8 +5,10 @@ # # Conditional build: %bcond_with bootstrap # bootstrap using precompiled binaries -%bcond_without full_debuginfo # full debuginfo vs only std debuginfo (full takes gigabytes of memory to build) +%bcond_with full_debuginfo # full debuginfo vs only std debuginfo (full takes gigabytes of memory to build) %bcond_without system_llvm # system LLVM +%bcond_without rustc # rustc building +%bcond_without cargo # cargo building %bcond_with tests # build without tests # The channel can be stable, beta, or nightly @@ -21,32 +23,37 @@ # 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.28.0 -%define bootstrap_cargo 0.29.0 -%define bootstrap_date 2018-08-02 +%define bootstrap_rust 1.40.0 +%define bootstrap_cargo 1.40.0 +%define bootstrap_date 2019-12-19 +%ifarch x32 +%undefine with_cargo +%undefine with_rustc +%endif Summary: The Rust Programming Language Summary(pl.UTF-8): Język programowania Rust Name: rust -Version: 1.29.0 +Version: 1.41.0 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: 54c3f0ffb826bdcc2a7395468828a94c -Source1: https://static.rust-lang.org/dist/%{bootstrap_date}/rust-%{bootstrap_rust}-x86_64-unknown-linux-gnu.tar.gz -# Source1-md5: b2fd4b6300018239e61b35aa80a5a9ee -Source2: https://static.rust-lang.org/dist/%{bootstrap_date}/rust-%{bootstrap_rust}-i686-unknown-linux-gnu.tar.gz -# Source2-md5: d70f6d58f7de41672a27c3b37f1dcbb6 -Patch0: x32.patch +Source0: https://static.rust-lang.org/dist/%{rustc_package}.tar.xz +# Source0-md5: e8c9d1d39ceb0dd43ee0100d0f019da4 +Source1: https://static.rust-lang.org/dist/%{bootstrap_date}/rust-%{bootstrap_rust}-x86_64-unknown-linux-gnu.tar.xz +# Source1-md5: db6b86d8f11fcc95a204e0e8bac5f2a0 +Source2: https://static.rust-lang.org/dist/%{bootstrap_date}/rust-%{bootstrap_rust}-i686-unknown-linux-gnu.tar.xz +# Source2-md5: 6adca51ae634e6bcd6b403fd554c4cb2 +Source3: https://static.rust-lang.org/dist/%{bootstrap_date}/rust-std-%{bootstrap_rust}-x86_64-unknown-linux-gnux32.tar.xz +# Source3-md5: d0183d3eb143de574fa349d10e821730 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 +%{?with_system_llvm:BuildRequires: llvm-devel >= 7.0} +BuildRequires: openssl-devel >= 1.0.1 BuildRequires: python >= 1:2.7 BuildRequires: zlib-devel %if %{without bootstrap} @@ -60,21 +67,24 @@ BuildRequires: procps # invoke the linker directly, and then we'll only need binutils. # https://github.com/rust-lang/rust/issues/11937 Requires: gcc -BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) # Only x86_64 and i686 are Tier 1 platforms at this time. +# x32 is Tier 2, only rust-std is available (no rustc or cargo). # https://doc.rust-lang.org/stable/book/getting-started.html#tier-1 ExclusiveArch: %{x8664} %{ix86} x32 +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_bootstrap_triple x86_64-unknown-linux-gnu %else -%define rust_triple %{_target_cpu}-unknown-linux-gnu +%define rust_triple %{_target_cpu}-unknown-linux-gnu +%define rust_bootstrap_triple %{_target_cpu}-unknown-linux-gnu %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 @@ -163,19 +173,6 @@ language and its standard library. Ten pakiet zawiera dokumentację w formacie HTML do języka programowania Rust i jego biblioteki standardowej. -%package -n bash-completion-cargo -Summary: Bash completion for cargo command -Summary(pl.UTF-8): Bashowe dopełnianie parametrów polecenia cargo -Group: Applications/Shells -Requires: %{name} = %{version}-%{release} -Requires: bash-completion - -%description -n bash-completion-cargo -Bash completion for cargo command. - -%description -n bash-completion-cargo -l pl.UTF-8 -Bashowe dopełnianie parametrów polecenia cargo. - %package -n cargo Summary: Rust's package manager and build tool Summary(pl.UTF-8): Zarządca pakietów i narzędzie do budowania @@ -190,12 +187,25 @@ dependencies and ensure that you'll always get a repeatable build. Cargo to narzędzie pozwalające projektom w języku Rust deklarować ich zależności i zapewniające powtarzalność procesu budowania. +%package -n bash-completion-cargo +Summary: Bash completion for cargo command +Summary(pl.UTF-8): Bashowe dopełnianie parametrów polecenia cargo +Group: Applications/Shells +Requires: %{name} = %{version}-%{release} +Requires: bash-completion + +%description -n bash-completion-cargo +Bash completion for cargo command. + +%description -n bash-completion-cargo -l pl.UTF-8 +Bashowe dopełnianie parametrów polecenia cargo. + %package -n zsh-completion-cargo Summary: Zsh completion for cargo command Summary(pl.UTF-8): Dopełnianie parametrów polecenia cargo w powłoce Zsh Group: Applications/Shells Requires: %{name} = %{version}-%{release} -Requires: bash-completion +Requires: zsh %description -n zsh-completion-cargo Zsh completion for cargo command. @@ -205,9 +215,6 @@ Dopełnianie parametrów polecenia cargo w powłoce Zsh. %prep %setup -q -n %{rustc_package} -%ifarch x32 -%patch0 -p1 -%endif %if %{with bootstrap} %ifarch %{x8664} @@ -216,23 +223,36 @@ tar xf %{SOURCE1} %ifarch %{ix86} tar xf %{SOURCE2} %endif +%ifarch x32 +tar xf %{SOURCE1} +cd %{bootstrap_root} +tar xf %{SOURCE3} +%{__mv} rust-std-%{bootstrap_rust}-%{rust_triple} rust-std-%{rust_triple} +cd .. +%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 test -f %{local_rust_root}/bin/rustc +%ifarch x32 +%{bootstrap_root}-root/rust-std-%{rust_triple}/install.sh \ + --components=rust-std-%{rust_triple} \ + --prefix=%{local_rust_root} \ + --disable-ldconfig +%endif %endif # unbundle # We're disabling jemalloc, but rust-src still wants it. #%{__rm} -r src/jemalloc -%{?with_system_llvm:%{__rm} -r src/llvm} +%{?with_system_llvm:%{__rm} -r src/llvm-project} # extract bundled licenses for packaging -sed -e '/*\//q' src/libbacktrace/backtrace.h \ - >src/libbacktrace/LICENSE-libbacktrace +sed -e '/*\//q' vendor/backtrace-sys/src/libbacktrace/backtrace.h \ + >vendor/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"#' \ @@ -241,7 +261,7 @@ sed -i -e 's#DIRECTORY=".*"#DIRECTORY="%{_datadir}/%{name}/etc"#' \ # The configure macro will modify some autoconf-related files, which upsets # cargo when it tries to verify checksums in those files. If we just truncate # that file list, cargo won't have anything to complain about. -find src/vendor -name .cargo-checksum.json \ +find vendor -name .cargo-checksum.json \ -exec sed -i.uncheck -e 's/"files":{[^}]*}/"files":{ }/' '{}' '+' %build @@ -251,9 +271,6 @@ find src/vendor -name .cargo-checksum.json \ --target=%{rust_triple} \ --libdir=%{common_libdir} \ --disable-codegen-tests \ - --disable-jemalloc \ - --disable-option-checking \ - --disable-rpath \ --disable-debuginfo-lines \ %if %{with full_debuginfo} --disable-debuginfo-only-std \ @@ -262,15 +279,18 @@ find src/vendor -name .cargo-checksum.json \ --enable-debuginfo-only-std \ --disable-debuginfo \ %endif + --disable-jemalloc \ + --disable-option-checking \ + --disable-rpath \ --enable-extended \ --enable-llvm-link-shared \ - --local-rust-root=%{local_rust_root} \ --enable-vendor \ + --local-rust-root=%{local_rust_root} \ --llvm-root=%{_prefix} \ --release-channel=%{channel} RUST_BACKTRACE=full \ -./x.py dist +./x.py dist --verbose %{?with_tests:./x.py test} @@ -331,27 +351,20 @@ rm -rf $RPM_BUILD_ROOT %files %defattr(644,root,root,755) -%doc COPYRIGHT LICENSE-APACHE LICENSE-MIT README.md src/libbacktrace/LICENSE-libbacktrace +%doc COPYRIGHT LICENSE-APACHE LICENSE-MIT README.md vendor/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) %{_libdir}/libarena-*.so -%attr(755,root,root) %{_libdir}/libfmt_macros-*.so -%attr(755,root,root) %{_libdir}/libgraphviz-*.so -%attr(755,root,root) %{_libdir}/libproc_macro-*.so +%attr(755,root,root) %{_bindir}/rustfmt %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} -%dir %{rustlibdir}/%{rust_triple}/codegen-backends -%attr(755,root,root) %{rustlibdir}/%{rust_triple}/codegen-backends/*.so +%{rustlibdir}/%{rust_triple}/analysis %dir %{rustlibdir}/%{rust_triple}/lib %attr(755,root,root) %{rustlibdir}/%{rust_triple}/lib/*.so %{rustlibdir}/%{rust_triple}/lib/*.rlib @@ -370,6 +383,7 @@ rm -rf $RPM_BUILD_ROOT %files gdb %defattr(644,root,root,755) %attr(755,root,root) %{_bindir}/rust-gdb +%attr(755,root,root) %{_bindir}/rust-gdbgui %{_datadir}/%{name}/etc/gdb_*.py* %files doc @@ -380,6 +394,10 @@ rm -rf $RPM_BUILD_ROOT %files -n cargo %defattr(644,root,root,755) %attr(755,root,root) %{_bindir}/cargo +%attr(755,root,root) %{_bindir}/cargo-clippy +%attr(755,root,root) %{_bindir}/cargo-fmt +%attr(755,root,root) %{_bindir}/cargo-miri +%attr(755,root,root) %{_bindir}/clippy-driver %{_mandir}/man1/cargo*.1* %dir %{_datadir}/cargo %dir %{_datadir}/cargo/registry