Skip to content

Commit 3776565

Browse files
committed
respect configured number of parallel jobs
1 parent 3174211 commit 3776565

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

rust.spec

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,14 @@ BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
102102
%define _noautoreqfiles lib.*-[[:xdigit:]]{8}[.]so.*
103103
%define _noautoprovfiles lib.*-[[:xdigit:]]{8}[.]so.*
104104

105+
%define x_py { \
106+
x_py() { \
107+
local cmd="$1"; \
108+
shift; \
109+
%{?__jobs:CARGO_BUILD_JOBS=%__jobs }./x.py "$cmd" %{?__jobs:-j %__jobs} "$@"; \
110+
}; x_py }
111+
112+
105113
%description
106114
Rust is a systems programming language that runs blazingly fast,
107115
prevents segfaults, and guarantees thread safety.
@@ -289,16 +297,17 @@ find vendor -name .cargo-checksum.json \
289297
--llvm-root=%{_prefix} \
290298
--release-channel=%{channel}
291299

292-
RUST_BACKTRACE=full \
293-
./x.py dist --verbose
300+
export RUST_BACKTRACE=full
301+
%x_py dist --verbose
294302

295-
%{?with_tests:./x.py test}
303+
%{?with_tests:%x_py test}
296304

297305
%install
298306
rm -rf $RPM_BUILD_ROOT
299307

300-
DESTDIR=$RPM_BUILD_ROOT ./x.py install
301-
DESTDIR=$RPM_BUILD_ROOT ./x.py install src
308+
export DESTDIR=$RPM_BUILD_ROOT
309+
%x_py install
310+
%x_py install src
302311

303312
# Make sure the shared libraries are in the proper libdir
304313
%if "%{_libdir}" != "%{common_libdir}"

0 commit comments

Comments
 (0)