diff --git a/rust.spec b/rust.spec index c7593e8c7433c0d2402e2571a7c8c06c855e69b0..8e53a21af4dcc8df56144bcee7cc6aff04faa992 100644 --- a/rust.spec +++ b/rust.spec @@ -16,9 +16,13 @@ %bcond_with rust_lld %endif +%ifnarch riscv64 loongarch64 +%bcond_without musl_target +%endif + Name: rust Version: 1.82.0 -Release: 4 +Release: 5 Summary: The Rust Programming Language License: Apache-2.0 OR MIT URL: https://www.rust-lang.org @@ -99,10 +103,10 @@ BuildRequires: cargo >= %{bootstrap_cargo} BuildRequires: (%{name} >= %{bootstrap_rust} with %{name} <= %{version}) %global local_rust_root %{_prefix} %endif -%ifarch loongarch64 -BuildRequires: make gcc gcc-c++ ncurses-devel curl curl-devel pkgconfig(libcurl) pkgconfig(liblzma) -%else +%if %{with_musl_target} BuildRequires: make gcc gcc-c++ ncurses-devel curl curl-devel musl-libc-static musl-gcc pkgconfig(libcurl) pkgconfig(liblzma) +%else +BuildRequires: make gcc gcc-c++ ncurses-devel curl curl-devel pkgconfig(libcurl) pkgconfig(liblzma) %endif BuildRequires: pkgconfig(openssl) pkgconfig(zlib) pkgconfig(libssh2) >= 1.6.0 gnupg2 wget %global python python3 @@ -355,12 +359,8 @@ test -r "%{profiler}" %configure --disable-option-checking \ --docdir=%{_pkgdocdir} \ --libdir=%{common_libdir} \ -%ifarch loongarch64 - --build=%{rust_triple} --host=%{rust_triple} --target=%{rust_triple} \ -%else - %{rust_musl_root}=%{musl_root} \ - --build=%{rust_triple} --host=%{rust_triple} --target=%{rust_triple},%{rust_musl_triple} \ -%endif + %{?with_musl_target:%{rust_musl_root}=%{musl_root}} \ + --build=%{rust_triple} --host=%{rust_triple} --target=%{rust_triple}%{?with_musl_target:,%{rust_musl_triple}} \ --set target.%{rust_triple}.profiler="%{profiler}" \ %{!?with_rust_lld: --set rust.lld=false} \ --python=%{python} \ @@ -463,7 +463,7 @@ export %{rust_env} %{_libexecdir}/rust-analyzer-proc-macro-srv %endif %{rustlibdir}/%{rust_triple}/lib/*.so -%ifnarch loongarch64 +%if %{with_musl_target} %dir %{rustlibdir}/%{rust_musl_triple} %dir %{rustlibdir}/%{rust_musl_triple}/lib %endif @@ -473,7 +473,7 @@ export %{rust_env} %dir %{rustlibdir}/%{rust_triple} %dir %{rustlibdir}/%{rust_triple}/lib %{rustlibdir}/%{rust_triple}/lib/*.rlib -%ifnarch loongarch64 +%if %{with_musl_target} %dir %{rustlibdir}/%{rust_musl_triple} %dir %{rustlibdir}/%{rust_musl_triple}/lib %{rustlibdir}/%{rust_musl_triple}/lib/*.rlib @@ -545,6 +545,9 @@ export %{rust_env} %{_mandir}/man1/cargo*.1* %changelog +* Fri Dec 06 2024 jchzhou - 1.82.0-5 +- Add a switch for the musl target & disable it for loongarch64 & riscv64 + * Fri Nov 22 2024 Wenl4ng - 1.82.0-4 - use lfs-server