Browse Source

rust-1.30.1-1

git-svn-id: http://trac.vinelinux.org/repos/projects/specs@11972 ec354946-7b23-47d6-9f5a-488ba84defc7
tomop 6 years ago
parent
commit
257bdf6c2c
1 changed files with 203 additions and 37 deletions
  1. 203 37
      r/rust/rust-vl.spec

+ 203 - 37
r/rust/rust-vl.spec

@@ -1,4 +1,14 @@
 %bcond_with bootstrap
+%bcond_with test
+
+# 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.30.1
+%global cargo_version 1.30.0
+%global rustfmt_version 0.99.4
+%global rls_version 0.130.5
+%global clippy_version 0.0.212
 
 %define _unpackaged_files_terminate_build 1
 
@@ -12,10 +22,9 @@
 # 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
-%global bootstrap_rust 1.22.1
-%global bootstrap_cargo 0.23.0
+%global bootstrap_rust 1.30.1
+%global bootstrap_cargo 1.30.0
 %global bootstrap_channel %{bootstrap_rust}
-%global bootstrap_date 2017-10-12
 
 # Only the specified arches will use bootstrap binaries.
 %if %{with bootstrap}
@@ -43,7 +52,7 @@
 %endif
 
 Name:           rust
-Version:        1.23.0
+Version:        1.30.1
 Release:        1%{?_dist_release}
 Summary:        The Rust Programming Language
 License:        (ASL 2.0 or MIT) and (BSD and ISC and MIT)
@@ -51,6 +60,9 @@ License:        (ASL 2.0 or MIT) and (BSD and ISC and MIT)
 URL:            https://www.rust-lang.org
 ExclusiveArch:  %{rust_arches}
 
+Vendor:         Project Vine
+Distribution:   Vine Linux
+
 %if "%{channel}" == "stable"
 %global rustc_package rustc-%{version}-src
 %else
@@ -58,8 +70,6 @@ ExclusiveArch:  %{rust_arches}
 %endif
 Source0:        https://static.rust-lang.org/dist/%{rustc_package}.tar.gz
 
-Patch1:         rust-1.22.0-45566-option-checking.patch
-
 # Get the Rust triple for any arch.
 %{lua: function rust_triple(arch)
   local abi = "gnu"
@@ -84,7 +94,7 @@ end}
   for arch in string.gmatch(rpm.expand("%{bootstrap_arches}"), "%S+") do
     table.insert(bootstrap_arches, arch)
   end
-  local base = rpm.expand("https://static.rust-lang.org/dist/%{bootstrap_date}"
+  local base = rpm.expand("https://static.rust-lang.org/dist"
                           .."/rust-%{bootstrap_channel}")
   local target_arch = rpm.expand("%{_target_cpu}")
   for i, arch in ipairs(bootstrap_arches) do
@@ -112,7 +122,10 @@ BuildRequires:  cmake
 BuildRequires:  make
 BuildRequires:  gcc
 BuildRequires:  gcc-c++
+BuildRequires:  libgit2-devel
+BuildRequires:  libssh2-devel
 BuildRequires:  ncurses-devel
+BuildRequires:  openssl-devel
 BuildRequires:  zlib-devel
 BuildRequires:  python
 BuildRequires:  curl
@@ -127,7 +140,7 @@ Provides:       bundled(llvm) = 4.0
 %global llvm llvm
 %global llvm_root %{_prefix}
 %endif
-BuildRequires:  %{llvm}-devel >= 3.7
+BuildRequires:  %{llvm}-devel >= 7.0.0
 %if %{with llvm_static}
 BuildRequires:  %{llvm}-static
 BuildRequires:  libffi-devel
@@ -144,7 +157,6 @@ BuildRequires:  procps
 BuildRequires:  gdb
 
 # TODO: work on unbundling these!
-Provides:       bundled(hoedown) = 3.0.5
 Provides:       bundled(jquery) = 2.1.4
 Provides:       bundled(libbacktrace) = 6.1.0
 Provides:       bundled(miniz) = 1.14
@@ -253,6 +265,73 @@ This package includes HTML documentation for the Rust programming language and
 its standard library.
 
 
+%package -n cargo
+Summary:        Rust's package manager and build tool
+Version:        %{cargo_version}
+# For tests:
+BuildRequires:  git
+# Cargo is not much use without Rust
+Requires:       rust
+
+%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.
+
+
+%package -n cargo-doc
+Summary:        Documentation for Cargo
+Version:        %{cargo_version}
+BuildArch:      noarch
+# Cargo no longer builds its own documentation
+# https://github.com/rust-lang/cargo/pull/4904
+Requires:       rust-doc = %{rustc_version}-%{release}
+
+%description -n cargo-doc
+This package includes HTML documentation for Cargo.
+
+
+%package -n rustfmt-preview
+Summary:        Tool to find and fix Rust formatting issues
+Version:        %{rustfmt_version}
+Requires:       cargo
+
+# Despite the lower version, our rustfmt-preview is newer than rustfmt-0.9.
+# It's expected to stay "preview" until it's released as 1.0.
+Obsoletes:      rustfmt <= 0.9.0
+Provides:       rustfmt = %{rustfmt_version}
+
+%description -n rustfmt-preview
+A tool for formatting Rust code according to style guidelines.
+
+
+%package -n rls-preview
+Summary:        Rust Language Server for IDE integration
+Version:        %{rls_version}
+Provides:       rls = %{rls_version}
+Requires:       rust-analysis
+# /usr/bin/rls is dynamically linked against internal rustc libs
+Requires:       %{name} = %{rustc_version}-%{release}
+
+%description -n rls-preview
+The Rust Language Server provides a server that runs in the background,
+providing IDEs, editors, and other tools with information about Rust programs.
+It supports functionality such as 'goto definition', symbol search,
+reformatting, and code completion, and enables renaming and refactorings.
+
+
+%package -n clippy-preview
+Summary:        Lints to catch common mistakes and improve your Rust code
+Version:        %{clippy_version}
+License:        MPLv2.0
+Provides:       clippy = %{clippy_version}
+Requires:       cargo
+# /usr/bin/clippy-driver is dynamically linked against internal rustc libs
+Requires:       %{name} = %{rustc_version}-%{release}
+
+%description -n clippy-preview
+A collection of lints to catch common mistakes and improve your Rust code.
+
+
 %package src
 Summary:        Sources for the Rust standard library
 BuildArch:      noarch
@@ -262,6 +341,16 @@ This package includes source files for the Rust standard library.  It may be
 useful as a reference for code completion tools in various editors.
 
 
+%package analysis
+Summary:        Compiler analysis data for the Rust standard library
+Requires:       rust-std-static = %{rustc_version}-%{release}
+
+%description analysis
+This package contains analysis data files produced with rustc's -Zsave-analysis
+feature for the Rust standard library. The RLS (Rust Language Server) uses this
+data to provide information about the Rust standard library.
+
+
 %prep
 
 %ifarch %{bootstrap_arches}
@@ -281,16 +370,18 @@ test -f '%{local_rust_root}/bin/rustc'
 rm -rf src/llvm/
 %endif
 
+# We never enable emscripten.
+rm -rf src/llvm-emscripten/
+
+# We never enable other LLVM tools.
+rm -rf src/tools/clang
+rm -rf src/tools/lld
+rm -rf src/tools/lldb
+
 # extract bundled licenses for packaging
-cp src/rt/hoedown/LICENSE src/rt/hoedown/LICENSE-hoedown
 sed -e '/*\//q' src/libbacktrace/backtrace.h \
   >src/libbacktrace/LICENSE-libbacktrace
 
-# This tests a problem of exponential growth, which seems to be less-reliably
-# fixed when running on older LLVM and/or some arches.  Just skip it for now.
-sed -i.ignore -e '1i // ignore-test may still be exponential...' \
-  src/test/run-pass/issue-41696.rs
-
 %if %{with bundled_llvm} && 0%{?epel}
 mkdir -p cmake-bin
 ln -s /usr/bin/cmake cmake-bin/cmake
@@ -304,18 +395,17 @@ sed -i.ffi -e '$a #[link(name = "ffi")] extern {}' \
   src/librustc_llvm/lib.rs
 %endif
 
-%global _default_patch_fuzz 1
-#%patch1 -p1 -b .option-checking
-
 # 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 \
   -exec sed -i.uncheck -e 's/"files":{[^}]*}/"files":{ }/' '{}' '+'
 
-
 %build
 
+export LIBGIT2_SYS_USE_PKG_CONFIG=1
+export LIBSSH2_SYS_USE_PKG_CONFIG=1
+
 %{?cmake_path:export PATH=%{cmake_path}:$PATH}
 %{?library_path:export LIBRARY_PATH="%{library_path}"}
 %{?rustflags:export RUSTFLAGS="%{rustflags}"}
@@ -325,16 +415,13 @@ find src/vendor -name .cargo-checksum.json \
 %global common_libdir %{_prefix}/lib
 %global rustlibdir %{common_libdir}/rustlib
 
-%ifarch %{arm}
-# full debuginfo is exhausting memory; just do libstd for now
-# https://github.com/rust-lang/rust/issues/45854
-%define enable_debuginfo --enable-debuginfo --enable-debuginfo-only-std --disable-debuginfo-lines
-%else
-%define enable_debuginfo --enable-debuginfo --disable-debuginfo-only-std --disable-debuginfo-lines
-%endif
+#%ifarch x86_64
+%define enable_debuginfo --enable-debuginfo --enable-debuginfo-only-std --disable-debuginfo-tools --disable-debuginfo-lines
+#%else
+#%define enable_debuginfo --disable-debuginfo --disable-debuginfo-only-std --disable-debuginfo-tools --disable-debuginfo-lines
+#%endif
 
 %configure \
-  --enable-full-bootstrap \
   --disable-option-checking \
   --libdir=%{common_libdir} \
   --build=%{rust_triple} --host=%{rust_triple} --target=%{rust_triple} \
@@ -344,24 +431,24 @@ find src/vendor -name .cargo-checksum.json \
   --disable-jemalloc \
   --disable-rpath \
   %{enable_debuginfo} \
+  --enable-extended \
   --enable-vendor \
+  --enable-verbose-tests \
   --release-channel=%{channel}
 
-%ifarch x86_64
 RUST_BACKTRACE=1 ./x.py build
-%else
-RUST_BACKTRACE=1 ./x.py build -i
-%endif
 ./x.py doc
 
 
 %install
+rm -rf %{buildroot}
+
 %{?cmake_path:export PATH=%{cmake_path}:$PATH}
 %{?library_path:export LIBRARY_PATH="%{library_path}"}
 %{?rustflags:export RUSTFLAGS="%{rustflags}"}
 
 DESTDIR=%{buildroot} ./x.py install
-DESTDIR=%{buildroot} ./x.py install src
+#DESTDIR=%{buildroot} ./x.py install src
 
 
 # Make sure the shared libraries are in the proper libdir
@@ -379,25 +466,49 @@ find %{buildroot}%{_libdir} -maxdepth 1 -type f -name '*.so' \
 # library loading if we keep them in libdir, but we do need them in rustlib/
 # to support dynamic linking for compiler plugins, so we'll symlink.
 (cd "%{buildroot}%{rustlibdir}/%{rust_triple}/lib" &&
- find ../../../../%{_lib} -maxdepth 1 -name '*.so' \
-   -exec ln -v -f -s -t . '{}' '+')
-
+ find ../../../../%{_lib} -maxdepth 1 -name '*.so' |
+ while read lib; do
+   # make sure they're actually identical!
+   cmp "$lib" "${lib##*/}"
+   ln -v -f -s -t . "$lib"
+ done)
+ 
 # Remove installer artifacts (manifests, uninstall scripts, etc.)
 find %{buildroot}%{rustlibdir} -maxdepth 1 -type f -exec rm -v '{}' '+'
 
+# Remove backup files from %%configure munging
+find %{buildroot}%{rustlibdir} -type f -name '*.orig' -exec rm -v '{}' '+'
+
+# https://fedoraproject.org/wiki/Changes/Make_ambiguous_python_shebangs_error
+# We don't actually need to ship any of those python scripts in rust-src anyway.
+
+find %{buildroot}%{rustlibdir}/src -type f -name '*.py' -exec rm -v '{}' '+'
+
 # FIXME: __os_install_post will strip the rlibs
 # -- should we find a way to preserve debuginfo?
 
+# Remove unwanted documentation files (we already package them)
 # Remove unwanted documentation files (we already package them)
 rm -f %{buildroot}%{_docdir}/%{name}/README.md
 rm -f %{buildroot}%{_docdir}/%{name}/COPYRIGHT
+rm -f %{buildroot}%{_docdir}/%{name}/LICENSE
 rm -f %{buildroot}%{_docdir}/%{name}/LICENSE-APACHE
 rm -f %{buildroot}%{_docdir}/%{name}/LICENSE-MIT
+rm -f %{buildroot}%{_docdir}/%{name}/LICENSE-THIRD-PARTY
+rm -f %{buildroot}%{_docdir}/%{name}/*.old
 
 # Sanitize the HTML documentation
 find %{buildroot}%{_docdir}/%{name}/html -empty -delete
 find %{buildroot}%{_docdir}/%{name}/html -type f -exec chmod -x '{}' '+'
 
+# Create the path for crate-devel packages
+mkdir -p %{buildroot}%{_datadir}/cargo/registry
+
+# Cargo no longer builds its own documentation
+# https://github.com/rust-lang/cargo/pull/4904
+mkdir -p %{buildroot}%{_docdir}/cargo
+ln -sT ../rust/html/cargo/ %{buildroot}%{_docdir}/cargo/html
+
 %if %{without lldb}
 rm -f %{buildroot}%{_bindir}/rust-lldb
 rm -f %{buildroot}%{rustlibdir}/etc/lldb_*.py*
@@ -405,12 +516,18 @@ rm -f %{buildroot}%{rustlibdir}/etc/lldb_*.py*
 
 
 %check
+%if %{with test}
 %{?cmake_path:export PATH=%{cmake_path}:$PATH}
 %{?library_path:export LIBRARY_PATH="%{library_path}"}
 %{?rustflags:export RUSTFLAGS="%{rustflags}"}
 
 # The results are not stable on koji, so mask errors and just log it.
-./x.py test --no-fail-fast || :
+%{__python} ./x.py test --no-fail-fast || :
+%{__python} ./x.py test --no-fail-fast cargo || :
+%{__python} ./x.py test --no-fail-fast clippy || :
+%{__python} ./x.py test --no-fail-fast rls || :
+%{__python} ./x.py test --no-fail-fast rustfmt || :
+%endif
 
 
 %post -p /sbin/ldconfig
@@ -420,7 +537,6 @@ rm -f %{buildroot}%{rustlibdir}/etc/lldb_*.py*
 %files
 %license COPYRIGHT LICENSE-APACHE LICENSE-MIT
 %license src/libbacktrace/LICENSE-libbacktrace
-%license src/rt/hoedown/LICENSE-hoedown
 %doc README.md
 %{_bindir}/rustc
 %{_bindir}/rustdoc
@@ -431,6 +547,7 @@ rm -f %{buildroot}%{rustlibdir}/etc/lldb_*.py*
 %dir %{rustlibdir}/%{rust_triple}
 %dir %{rustlibdir}/%{rust_triple}/lib
 %{rustlibdir}/%{rust_triple}/lib/*.so
+%{rustlibdir}/%{rust_triple}/codegen-backends/
 
 
 %files std-static
@@ -466,16 +583,65 @@ rm -f %{buildroot}%{rustlibdir}/etc/lldb_*.py*
 %{_docdir}/%{name}/html/*.html
 %{_docdir}/%{name}/html/*.css
 %{_docdir}/%{name}/html/*.js
+%{_docdir}/%{name}/html/*.svg
 %{_docdir}/%{name}/html/*.woff
 %license %{_docdir}/%{name}/html/*.txt
 
 
+%files -n cargo
+%license src/tools/cargo/LICENSE-APACHE src/tools/cargo/LICENSE-MIT src/tools/cargo/LICENSE-THIRD-PARTY
+%doc src/tools/cargo/README.md
+%{_bindir}/cargo
+%{_mandir}/man1/cargo*.1*
+%dir %{_sysconfdir}/bash_completion.d
+%{_sysconfdir}/bash_completion.d/cargo
+%dir %{_datadir}/zsh
+%dir %{_datadir}/zsh/site-functions
+%{_datadir}/zsh/site-functions/_cargo
+%dir %{_datadir}/cargo
+%dir %{_datadir}/cargo/registry
+
+
+%files -n cargo-doc
+%docdir %{_docdir}/cargo
+%dir %{_docdir}/cargo
+%{_docdir}/cargo/html
+
+
+%files -n rustfmt-preview
+%{_bindir}/rustfmt
+%{_bindir}/cargo-fmt
+%doc src/tools/rustfmt/{README,CHANGELOG,Configurations}.md
+%license src/tools/rustfmt/LICENSE-{APACHE,MIT}
+
+
+%files -n rls-preview
+%{_bindir}/rls
+%doc src/tools/rls/{README.md,COPYRIGHT,debugging.md}
+%license src/tools/rls/LICENSE-{APACHE,MIT}
+
+
+%files -n clippy-preview
+%{_bindir}/cargo-clippy
+%{_bindir}/clippy-driver
+%doc src/tools/clippy/{README.md,CHANGELOG.md}
+%license src/tools/clippy/LICENSE
+
+
 %files src
 %dir %{rustlibdir}
 %{rustlibdir}/src
 
 
+%files analysis
+%{rustlibdir}/%{rust_triple}/analysis/
+
 %changelog
+* Wed Dec 05 2018 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> - 1.30.1-1
+- new upstream release.
+- dropped Patch1.
+- added subpackages cargo, cargo-doc, rustformat-preview, rls-preview, clippy-preview and rust-analysis.
+
 * Fri Jan 05 2018 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> - 1.23.0-1
 - Update to 1.23.0 (stable).