]> git.pld-linux.org Git - packages/rust.git/blobdiff - rust.spec
follow Fedora and package cargo shipped with rust
[packages/rust.git] / rust.spec
index bea4753b9a8dce3b5e92ce409044503677be58d9..6e14c54478050e654b5b4d73cd463b7590bf657b 100644 (file)
--- a/rust.spec
+++ b/rust.spec
@@ -1,9 +1,12 @@
 # TODO
 # - consider a rust-std package containing .../rustlib/$target
 #   This might allow multilib cross-compilation to work naturally.
+# - package additional tools
 #
 # 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_without system_llvm     # system LLVM
 %bcond_with    tests           # build without tests
 
 # The channel can be stable, beta, or nightly
 # 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.24.0
-%define                bootstrap_cargo 0.25.0
-%define                bootstrap_date  2018-02-15
+%define                bootstrap_rust  1.28.0
+%define                bootstrap_cargo 0.29.0
+%define                bootstrap_date  2018-08-02
 
 Summary:       The Rust Programming Language
 Summary(pl.UTF-8):     Język programowania Rust
 Name:          rust
-Version:       1.25.0
+Version:       1.29.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: d8d4d30c8d0b905f978bee3fdd618db5
+# Source0-md5: 54c3f0ffb826bdcc2a7395468828a94c
 Source1:       https://static.rust-lang.org/dist/%{bootstrap_date}/rust-%{bootstrap_rust}-x86_64-unknown-linux-gnu.tar.gz
-# Source1-md5: 61be17f80e1811211450e5b733624232
+# Source1-md5: b2fd4b6300018239e61b35aa80a5a9ee
 Source2:       https://static.rust-lang.org/dist/%{bootstrap_date}/rust-%{bootstrap_rust}-i686-unknown-linux-gnu.tar.gz
-# Source2-md5: 5568788cd5d96173a89bd0e82a2aa356
+# Source2-md5: d70f6d58f7de41672a27c3b37f1dcbb6
+Patch0:                x32.patch
 URL:           https://www.rust-lang.org/
 # for src/compiler-rt
 BuildRequires: cmake >= 3.4.3
 BuildRequires: curl
 BuildRequires: libstdc++-devel
-BuildRequires: llvm-devel
+%{?with_system_llvm:BuildRequires:     llvm-devel}
 BuildRequires: ncurses-devel
 BuildRequires: python >= 1:2.7
 BuildRequires: zlib-devel
@@ -59,9 +63,13 @@ Requires:    gcc
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 # 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}
+ExclusiveArch: %{x8664} %{ix86} x32
 
+%ifarch x32
+%define                rust_triple     x86_64-unknown-linux-gnux32
+%else
 %define                rust_triple     %{_target_cpu}-unknown-linux-gnu
+%endif
 
 %if %{without bootstrap}
 %define                local_rust_root %{_prefix}
@@ -72,13 +80,13 @@ ExclusiveArch:      %{x8664} %{ix86}
 
 # We're going to override --libdir when configuring to get rustlib into a
 # common path, but we'll fix the shared libraries during install.
-# Without this ugly hack, rust would not be able to buld itself
+# Without this ugly hack, rust would not be able to build itself
 # for non-bootstrap build, lib64 is just too complicated for it.
 %define                common_libdir   %{_prefix}/lib
 %define                rustlibdir      %{common_libdir}/rustlib
 
 # once_call/once_callable non-function libstdc++ symbols
-%define                skip_post_check_so      'librustc_llvm-.*\.so.*'
+%define                skip_post_check_so      'librustc.*llvm.*\.so.*'
 
 # ALL Rust libraries are private, because they don't keep an ABI.
 %define                _noautoreqfiles         lib.*-[[:xdigit:]]{8}[.]so.*
@@ -155,8 +163,51 @@ 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
+Group:         Development/Tools
+Requires:      %{name}
+
+%description -n cargo
+Cargo is a tool that allows Rust projects to declare their various
+dependencies and ensure that you'll always get a repeatable build.
+
+%description -n cargo -l pl.UTF-8
+Cargo to narzędzie pozwalające projektom w języku Rust deklarować ich
+zależności i zapewniające powtarzalność procesu budowania.
+
+%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
+
+%description -n zsh-completion-cargo
+Zsh completion for cargo command.
+
+%description -n zsh-completion-cargo -l pl.UTF-8
+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}
@@ -176,11 +227,10 @@ test -f %{local_rust_root}/bin/rustc
 
 # unbundle
 # We're disabling jemalloc, but rust-src still wants it.
-#%{__rm} -r src/jemalloc/
-%{__rm} -r src/llvm/
+#%{__rm} -r src/jemalloc
+%{?with_system_llvm:%{__rm} -r src/llvm}
 
 # extract bundled licenses for packaging
-cp -p src/rt/hoedown/LICENSE src/rt/hoedown/LICENSE-hoedown
 sed -e '/*\//q' src/libbacktrace/backtrace.h \
        >src/libbacktrace/LICENSE-libbacktrace
 
@@ -205,14 +255,21 @@ find src/vendor -name .cargo-checksum.json \
        --disable-option-checking \
        --disable-rpath \
        --disable-debuginfo-lines \
+%if %{with full_debuginfo}
        --disable-debuginfo-only-std \
        --enable-debuginfo \
+%else
+       --enable-debuginfo-only-std \
+       --disable-debuginfo \
+%endif
+       --enable-extended \
        --enable-llvm-link-shared \
        --local-rust-root=%{local_rust_root} \
        --enable-vendor \
        --llvm-root=%{_prefix} \
        --release-channel=%{channel}
 
+RUST_BACKTRACE=full \
 ./x.py dist
 
 %{?with_tests:./x.py test}
@@ -271,7 +328,7 @@ rm -rf $RPM_BUILD_ROOT
 
 %files
 %defattr(644,root,root,755)
-%doc COPYRIGHT LICENSE-APACHE LICENSE-MIT README.md src/libbacktrace/LICENSE-libbacktrace src/rt/hoedown/LICENSE-hoedown
+%doc COPYRIGHT LICENSE-APACHE LICENSE-MIT README.md src/libbacktrace/LICENSE-libbacktrace
 %attr(755,root,root) %{_bindir}/rustc
 %attr(755,root,root) %{_bindir}/rustdoc
 %attr(755,root,root) %{_libdir}/libarena-*.so
@@ -316,3 +373,18 @@ rm -rf $RPM_BUILD_ROOT
 %defattr(644,root,root,755)
 %dir %{_docdir}/%{name}
 %doc %{_docdir}/%{name}/html
+
+%files -n cargo
+%defattr(644,root,root,755)
+%attr(755,root,root) %{_bindir}/cargo
+%{_mandir}/man1/cargo*.1*
+%dir %{_datadir}/cargo
+%dir %{_datadir}/cargo/registry
+
+%files -n bash-completion-cargo
+%defattr(644,root,root,755)
+%{_sysconfdir}/bash_completion.d/cargo
+
+%files -n zsh-completion-cargo
+%defattr(644,root,root,755)
+%{zsh_compdir}/_cargo
This page took 0.089922 seconds and 4 git commands to generate.