]> git.pld-linux.org Git - packages/rpm-pld-macros.git/blob - macros.rust
set CC/CXX in %cargo_{build,install}; rel 2
[packages/rpm-pld-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_target   \\\
6 %ifarch i586\
7 i586-unknown-linux-gnu\\\
8 %endif\
9 %ifarch i686 pentium3 pentium4 athlon\
10 i686-unknown-linux-gnu\\\
11 %endif\
12 %ifarch %{x8664}\
13 x86_64-unknown-linux-gnu\\\
14 %endif\
15 %ifarch x32\
16 x86_64-unknown-linux-gnux32\\\
17 %endif\
18 %ifarch aarch64\
19 aarch64-unknown-linux-gnu\\\
20 %endif\
21 %ifarch armv6hl\
22 arm-unknown-linux-gnueabihf\\\
23 %endif\
24 %ifarch armv7hl armv7hnl\
25 armv7-unknown-linux-gnueabihf\\\
26 %endif\
27 %{nil}
28
29 %cargo_targetdir        target
30 %cargo_objdir           %{?buildsubdir:%{_builddir}/%{buildsubdir}/}%{cargo_targetdir}/%{cargo_target}/%{!?debug:release}%{?debug:debug}
31
32 %__cargo        /usr/bin/cargo
33 %__cargo_common_opts    -v --offline
34 %cargo_build \\\
35         CC="%{__cc}" \\\
36         CXX="%{__cxx}" \\\
37         PKG_CONFIG_ALLOW_CROSS=1 \\\
38         RUSTFLAGS="${RUSTFLAGS:-%rpmrustflags}" \\\
39         %{?__jobs:CARGO_BUILD_JOBS="${CARGO_BUILD_JOBS:-%{__jobs}}"} \\\
40         %{__cargo} %{__cargo_common_opts} build %{!?debug:--release} \\\
41         --target %{cargo_target} \\\
42         --target-dir %{cargo_targetdir} \\\
43 %{nil}
44
45 %cargo_install \\\
46         CC="%{__cc}" \\\
47         CXX="%{__cxx}" \\\
48         PKG_CONFIG_ALLOW_CROSS=1 \\\
49         RUSTFLAGS="${RUSTFLAGS:-%rpmrustflags}" \\\
50         %{?__jobs:CARGO_BUILD_JOBS="${CARGO_BUILD_JOBS:-%{__jobs}}"} \\\
51         %{__cargo} %{__cargo_common_opts} install \\\
52 %ifarch x32 \
53         --target x86_64-unknown-linux-gnux32 \\\
54 %endif \
55 %{nil}
This page took 0.03916 seconds and 3 git commands to generate.