|
@@ -1,29 +1,32 @@
|
|
|
%bcond_with bootstrap
|
|
|
%bcond_with test
|
|
|
+%bcond_without clang
|
|
|
+%bcond_without bundled_libgit2
|
|
|
+%bcond_without bundled_libssh2
|
|
|
|
|
|
# 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
|
|
|
+%global rustc_version 1.38.0
|
|
|
+%global cargo_version %{rustc_version}
|
|
|
+%global rustfmt_version %{rustc_version}
|
|
|
+%global rls_version %{rustc_version}
|
|
|
+%global clippy_version %{rustc_version}
|
|
|
|
|
|
-%define _unpackaged_files_terminate_build 1
|
|
|
+%global llvm_major 9
|
|
|
+
|
|
|
+# The channel can be stable, beta, or nightly
|
|
|
+%{!?channel: %global channel stable}
|
|
|
|
|
|
# Only x86_64 and i686 are Tier 1 platforms at this time.
|
|
|
# https://forge.rust-lang.org/platform-support.html
|
|
|
%global rust_arches x86_64 i686
|
|
|
|
|
|
-# The channel can be stable, beta, or nightly
|
|
|
-%{!?channel: %global channel stable}
|
|
|
-
|
|
|
# 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.30.1
|
|
|
-%global bootstrap_cargo 1.30.0
|
|
|
+%global bootstrap_rust 1.37.0
|
|
|
+%global bootstrap_cargo 1.37.0
|
|
|
%global bootstrap_channel %{bootstrap_rust}
|
|
|
|
|
|
# Only the specified arches will use bootstrap binaries.
|
|
@@ -52,7 +55,7 @@
|
|
|
%endif
|
|
|
|
|
|
Name: rust
|
|
|
-Version: 1.30.1
|
|
|
+Version: %{rustc_version}
|
|
|
Release: 1%{?_dist_release}
|
|
|
Summary: The Rust Programming Language
|
|
|
License: (ASL 2.0 or MIT) and (BSD and ISC and MIT)
|
|
@@ -120,19 +123,32 @@ BuildConflicts: %{name} > %{version}
|
|
|
|
|
|
BuildRequires: cmake
|
|
|
BuildRequires: make
|
|
|
+%if %{with clang}
|
|
|
+BuildRequires: clang
|
|
|
+BuildRequires: lld
|
|
|
+%else
|
|
|
BuildRequires: gcc
|
|
|
BuildRequires: gcc-c++
|
|
|
+%endif
|
|
|
+%if %{without bundled_libgit2}
|
|
|
BuildRequires: libgit2-devel
|
|
|
+%endif
|
|
|
+%if %{without bundled_libssh2}
|
|
|
BuildRequires: libssh2-devel
|
|
|
+%endif
|
|
|
BuildRequires: ncurses-devel
|
|
|
BuildRequires: openssl-devel
|
|
|
BuildRequires: zlib-devel
|
|
|
-BuildRequires: python
|
|
|
+BuildRequires: python3
|
|
|
+BuildRequires: python3-rpm-macros
|
|
|
BuildRequires: curl
|
|
|
+BuildRequires: curl-devel
|
|
|
+BuildRequires: xz-devel
|
|
|
|
|
|
%if %{with bundled_llvm}
|
|
|
BuildRequires: cmake
|
|
|
-Provides: bundled(llvm) = 4.0
|
|
|
+BuildRequires: git
|
|
|
+Provides: bundled(llvm) = 6.0
|
|
|
%else
|
|
|
%if %defined llvm
|
|
|
%global llvm_root %{_libdir}/%{llvm}
|
|
@@ -146,6 +162,7 @@ BuildRequires: %{llvm}-static
|
|
|
BuildRequires: libffi-devel
|
|
|
%else
|
|
|
# Make sure llvm-config doesn't see it.
|
|
|
+Requires: %{llvm}%{llvm_major}-libs
|
|
|
BuildConflicts: %{llvm}-static
|
|
|
%endif
|
|
|
%endif
|
|
@@ -158,7 +175,6 @@ BuildRequires: gdb
|
|
|
|
|
|
# TODO: work on unbundling these!
|
|
|
Provides: bundled(jquery) = 2.1.4
|
|
|
-Provides: bundled(libbacktrace) = 6.1.0
|
|
|
Provides: bundled(miniz) = 1.14
|
|
|
|
|
|
# Virtual provides for folks who attempt "dnf install rustc"
|
|
@@ -290,45 +306,41 @@ Requires: rust-doc = %{rustc_version}-%{release}
|
|
|
This package includes HTML documentation for Cargo.
|
|
|
|
|
|
|
|
|
-%package -n rustfmt-preview
|
|
|
+%package -n rustfmt
|
|
|
Summary: Tool to find and fix Rust formatting issues
|
|
|
Version: %{rustfmt_version}
|
|
|
Requires: cargo
|
|
|
+Obsoletes: rustfmt-preview < 1.0.0
|
|
|
|
|
|
-# 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
|
|
|
+%description -n rustfmt
|
|
|
A tool for formatting Rust code according to style guidelines.
|
|
|
|
|
|
|
|
|
-%package -n rls-preview
|
|
|
+%package -n rls
|
|
|
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}
|
|
|
+Obsoletes: rls-preview < 1.0.0
|
|
|
|
|
|
-%description -n rls-preview
|
|
|
+%description -n rls
|
|
|
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
|
|
|
+%package -n clippy
|
|
|
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}
|
|
|
+Obsoletes: clippy-preview < 1.0.0
|
|
|
|
|
|
-%description -n clippy-preview
|
|
|
+%description -n clippy
|
|
|
A collection of lints to catch common mistakes and improve your Rust code.
|
|
|
|
|
|
|
|
@@ -363,24 +375,37 @@ test -f '%{local_rust_root}/bin/rustc'
|
|
|
|
|
|
%setup -q -n %{rustc_package}
|
|
|
|
|
|
-# We're disabling jemalloc, but rust-src still wants it.
|
|
|
-# rm -rf src/jemalloc/
|
|
|
+%if "%{python}" == "python3"
|
|
|
+sed -i.try-py3 -e '/try python2.7/i try python3 "$@"' ./configure
|
|
|
+%endif
|
|
|
|
|
|
%if %without bundled_llvm
|
|
|
-rm -rf src/llvm/
|
|
|
+rm -rf src/llvm-project/
|
|
|
%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
|
|
|
+# Remove other unused vendored libraries
|
|
|
+#rm -rf vendor/curl-sys/curl/
|
|
|
+rm -rf vendor/jemalloc-sys/jemalloc/
|
|
|
+rm -rf vendor/libz-sys/src/zlib/
|
|
|
+rm -rf vendor/lzma-sys/xz-*/
|
|
|
+rm -rf vendor/openssl-src/openssl/
|
|
|
+%if %{without bundled_libgit2}
|
|
|
+rm -rf vendor/libgit2-sys/libgit2/
|
|
|
+%endif
|
|
|
+%if %{without bundled_libssh2}
|
|
|
+rm -rf vendor/libssh2-sys/libssh2/
|
|
|
+%endif
|
|
|
+
|
|
|
+# This only affects the transient rust-installer, but let it use our dynamic xz-libs
|
|
|
+sed -i.lzma -e '/LZMA_API_STATIC/d' src/bootstrap/tool.rs
|
|
|
|
|
|
-# extract bundled licenses for packaging
|
|
|
-sed -e '/*\//q' src/libbacktrace/backtrace.h \
|
|
|
- >src/libbacktrace/LICENSE-libbacktrace
|
|
|
+# rename bundled license for packaging
|
|
|
+if [ -e vendor/backtrace-sys/src/libbacktrace/LICENSE ]; then
|
|
|
+ cp -a vendor/backtrace-sys/src/libbacktrace/LICENSE{,-libbacktrace}
|
|
|
+fi
|
|
|
|
|
|
%if %{with bundled_llvm} && 0%{?epel}
|
|
|
mkdir -p cmake-bin
|
|
@@ -398,13 +423,18 @@ sed -i.ffi -e '$a #[link(name = "ffi")] extern {}' \
|
|
|
# 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
|
|
|
|
|
|
+%if %{without bundled_libgit2}
|
|
|
export LIBGIT2_SYS_USE_PKG_CONFIG=1
|
|
|
+%endif
|
|
|
+%if %{without bundled_libssh2}
|
|
|
export LIBSSH2_SYS_USE_PKG_CONFIG=1
|
|
|
+%endif
|
|
|
|
|
|
%{?cmake_path:export PATH=%{cmake_path}:$PATH}
|
|
|
%{?library_path:export LIBRARY_PATH="%{library_path}"}
|
|
@@ -415,11 +445,18 @@ export LIBSSH2_SYS_USE_PKG_CONFIG=1
|
|
|
%global common_libdir %{_prefix}/lib
|
|
|
%global rustlibdir %{common_libdir}/rustlib
|
|
|
|
|
|
-#%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
|
|
|
+%ifarch x86_64
|
|
|
+%define enable_debuginfo --debuginfo-level=0 --debuginfo-level-std=2
|
|
|
+%else
|
|
|
+%define enable_debuginfo --debuginfo-level=0
|
|
|
+%endif
|
|
|
+
|
|
|
+%if %{with clang}
|
|
|
+export CC=clang
|
|
|
+export CXX=clang++
|
|
|
+export LDFLAGS="$LDFLAGS -fuse-ld=lld"
|
|
|
+export RUSTFLAGS="$RUSTFLAGS -C linker=clang -C link-arg=-fuse-ld=lld"
|
|
|
+%endif
|
|
|
|
|
|
%configure \
|
|
|
--disable-option-checking \
|
|
@@ -428,16 +465,16 @@ export LIBSSH2_SYS_USE_PKG_CONFIG=1
|
|
|
--enable-local-rust --local-rust-root=%{local_rust_root} \
|
|
|
%{!?with_bundled_llvm: --llvm-root=%{llvm_root} --disable-codegen-tests \
|
|
|
%{!?with_llvm_static: --enable-llvm-link-shared } } \
|
|
|
- --disable-jemalloc \
|
|
|
--disable-rpath \
|
|
|
%{enable_debuginfo} \
|
|
|
--enable-extended \
|
|
|
--enable-vendor \
|
|
|
--enable-verbose-tests \
|
|
|
+ --set rust.codegen-units-std=1 \
|
|
|
--release-channel=%{channel}
|
|
|
|
|
|
-RUST_BACKTRACE=1 ./x.py build
|
|
|
-./x.py doc
|
|
|
+RUST_BACKTRACE=1 %{__python3} ./x.py build
|
|
|
+%{__python3} ./x.py doc
|
|
|
|
|
|
|
|
|
%install
|
|
@@ -446,6 +483,11 @@ rm -rf %{buildroot}
|
|
|
%{?cmake_path:export PATH=%{cmake_path}:$PATH}
|
|
|
%{?library_path:export LIBRARY_PATH="%{library_path}"}
|
|
|
%{?rustflags:export RUSTFLAGS="%{rustflags}"}
|
|
|
+%if %{with clang}
|
|
|
+export CC=clang
|
|
|
+export CXX=clang++
|
|
|
+export RUSTFLAGS="$RUSTFLAGS -C linker=clang -C link-arg=-fuse-ld=lld"
|
|
|
+%endif
|
|
|
|
|
|
DESTDIR=%{buildroot} ./x.py install
|
|
|
#DESTDIR=%{buildroot} ./x.py install src
|
|
@@ -514,12 +556,22 @@ rm -f %{buildroot}%{_bindir}/rust-lldb
|
|
|
rm -f %{buildroot}%{rustlibdir}/etc/lldb_*.py*
|
|
|
%endif
|
|
|
|
|
|
+%if %{with bundled_llvm}
|
|
|
+rm -rf %{buildroot}/home
|
|
|
+%endif
|
|
|
+
|
|
|
|
|
|
%check
|
|
|
%if %{with test}
|
|
|
%{?cmake_path:export PATH=%{cmake_path}:$PATH}
|
|
|
%{?library_path:export LIBRARY_PATH="%{library_path}"}
|
|
|
%{?rustflags:export RUSTFLAGS="%{rustflags}"}
|
|
|
+%if %{with clang}
|
|
|
+export CC=clang
|
|
|
+export CXX=clang++
|
|
|
+export LD=ld.lld
|
|
|
+export RUSTFLAGS="$RUSTFLAGS -C linker=ld.lld -C link-arg=-fuse-ld=lld"
|
|
|
+%endif
|
|
|
|
|
|
# The results are not stable on koji, so mask errors and just log it.
|
|
|
%{__python} ./x.py test --no-fail-fast || :
|
|
@@ -536,7 +588,7 @@ rm -f %{buildroot}%{rustlibdir}/etc/lldb_*.py*
|
|
|
|
|
|
%files
|
|
|
%license COPYRIGHT LICENSE-APACHE LICENSE-MIT
|
|
|
-%license src/libbacktrace/LICENSE-libbacktrace
|
|
|
+#license src/libbacktrace/LICENSE-libbacktrace
|
|
|
%doc README.md
|
|
|
%{_bindir}/rustc
|
|
|
%{_bindir}/rustdoc
|
|
@@ -548,6 +600,7 @@ rm -f %{buildroot}%{rustlibdir}/etc/lldb_*.py*
|
|
|
%dir %{rustlibdir}/%{rust_triple}/lib
|
|
|
%{rustlibdir}/%{rust_triple}/lib/*.so
|
|
|
%{rustlibdir}/%{rust_triple}/codegen-backends/
|
|
|
+%exclude %{_bindir}/*miri
|
|
|
|
|
|
|
|
|
%files std-static
|
|
@@ -566,6 +619,7 @@ rm -f %{buildroot}%{rustlibdir}/etc/lldb_*.py*
|
|
|
%files gdb
|
|
|
%{_bindir}/rust-gdb
|
|
|
%{rustlibdir}/etc/gdb_*.py*
|
|
|
+%exclude %{_bindir}/rust-gdbgui
|
|
|
|
|
|
|
|
|
%if %with lldb
|
|
@@ -582,10 +636,14 @@ rm -f %{buildroot}%{rustlibdir}/etc/lldb_*.py*
|
|
|
%{_docdir}/%{name}/html/*/
|
|
|
%{_docdir}/%{name}/html/*.html
|
|
|
%{_docdir}/%{name}/html/*.css
|
|
|
+%{_docdir}/%{name}/html/*.ico
|
|
|
%{_docdir}/%{name}/html/*.js
|
|
|
+%{_docdir}/%{name}/html/*.png
|
|
|
%{_docdir}/%{name}/html/*.svg
|
|
|
%{_docdir}/%{name}/html/*.woff
|
|
|
+%{_docdir}/%{name}/html/SourceSerifPro-LICENSE.md
|
|
|
%license %{_docdir}/%{name}/html/*.txt
|
|
|
+%license %{_docdir}/%{name}/html/*.md
|
|
|
|
|
|
|
|
|
%files -n cargo
|
|
@@ -608,24 +666,24 @@ rm -f %{buildroot}%{rustlibdir}/etc/lldb_*.py*
|
|
|
%{_docdir}/cargo/html
|
|
|
|
|
|
|
|
|
-%files -n rustfmt-preview
|
|
|
+%files -n rustfmt
|
|
|
%{_bindir}/rustfmt
|
|
|
%{_bindir}/cargo-fmt
|
|
|
%doc src/tools/rustfmt/{README,CHANGELOG,Configurations}.md
|
|
|
%license src/tools/rustfmt/LICENSE-{APACHE,MIT}
|
|
|
|
|
|
|
|
|
-%files -n rls-preview
|
|
|
+%files -n rls
|
|
|
%{_bindir}/rls
|
|
|
%doc src/tools/rls/{README.md,COPYRIGHT,debugging.md}
|
|
|
%license src/tools/rls/LICENSE-{APACHE,MIT}
|
|
|
|
|
|
|
|
|
-%files -n clippy-preview
|
|
|
+%files -n clippy
|
|
|
%{_bindir}/cargo-clippy
|
|
|
%{_bindir}/clippy-driver
|
|
|
%doc src/tools/clippy/{README.md,CHANGELOG.md}
|
|
|
-%license src/tools/clippy/LICENSE
|
|
|
+%license src/tools/clippy/LICENSE*
|
|
|
|
|
|
|
|
|
%files src
|
|
@@ -637,6 +695,10 @@ rm -f %{buildroot}%{rustlibdir}/etc/lldb_*.py*
|
|
|
%{rustlibdir}/%{rust_triple}/analysis/
|
|
|
|
|
|
%changelog
|
|
|
+* Sat Sep 28 2019 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> - 1.38.0-1
|
|
|
+- new upstream release.
|
|
|
+- erased "-preview" from the name of subpackages.
|
|
|
+
|
|
|
* Wed Dec 05 2018 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> - 1.30.1-1
|
|
|
- new upstream release.
|
|
|
- dropped Patch1.
|