]> TLD Linux GIT Repositories - packages/rpm-tld-macros.git/blob - macros.rust
e8992926669874bf164e770ab03767c392e0986c
[packages/rpm-tld-macros.git] / macros.rust
1 %debuginforustflags     -C debuginfo=%{expand:%%define __dic_%{?_enable_debug_packages} 1}%{?__dic_1:2}%{!?__dic_1:0}%{expand:%%undefine __dic_%{?_enable_debug_packages}}
2 %rpmrustflags   %debuginforustflags
3 %rust_arches    %{x8664} %{ix86} x32 aarch64 armv6hl armv7hl armv7hnl
4
5 %__cargo        /usr/bin/cargo
6 %__cargo_common_opts    -v --offline
7 %cargo_build \\\
8         RUSTFLAGS="${RUSTFLAGS:-%rpmrustflags}" \\\
9         %{?__jobs:CARGO_BUILD_JOBS="${CARGO_BUILD_JOBS:-%{__jobs}}"} \\\
10         %{__cargo} %{__cargo_common_opts} build %{!?debug:--release} \\\
11 %ifarch x32 \
12         --target x86_64-unknown-linux-gnux32 \\\
13 %endif \
14 %{nil}
15
16 %cargo_install \\\
17         RUSTFLAGS="${RUSTFLAGS:-%rpmrustflags}" \\\
18         %{?__jobs:CARGO_BUILD_JOBS="${CARGO_BUILD_JOBS:-%{__jobs}}"} \\\
19         %{__cargo} %{__cargo_common_opts} install \\\
20 %ifarch x32 \
21         --target x86_64-unknown-linux-gnux32 \\\
22 %endif \
23 %{nil}