]> git.pld-linux.org Git - packages/rpm-pld-macros.git/blame - macros.rust
pass c/cxx/ld flags in rust macros; rel 4
[packages/rpm-pld-macros.git] / macros.rust
CommitLineData
da3d1dd6 1%debuginforustflags -C debuginfo=%{expand:%%define __dic_%{?_enable_debug_packages} 1}%{?__dic_1:2}%{!?__dic_1:0}%{expand:%%undefine __dic_%{?_enable_debug_packages}}
2e9c5710 2%rpmrustflags %debuginforustflags
f62a5c22 3%rust_arches %{x8664} %{ix86} x32 aarch64 armv6hl armv7hl armv7hnl
2e9c5710 4
a26c87f4
JP
5%cargo_target \\\
6%ifarch i586\
7i586-unknown-linux-gnu\\\
8%endif\
9%ifarch i686 pentium3 pentium4 athlon\
10i686-unknown-linux-gnu\\\
11%endif\
12%ifarch %{x8664}\
13x86_64-unknown-linux-gnu\\\
14%endif\
15%ifarch x32\
16x86_64-unknown-linux-gnux32\\\
17%endif\
18%ifarch aarch64\
19aarch64-unknown-linux-gnu\\\
20%endif\
21%ifarch armv6hl\
22arm-unknown-linux-gnueabihf\\\
23%endif\
7a8ea05c 24%ifarch armv7hl \
a26c87f4
JP
25armv7-unknown-linux-gnueabihf\\\
26%endif\
7a8ea05c
JP
27%ifarch armv7hnl\
28thumbv7neon-unknown-linux-gnueabihf\\\
29%endif\
a26c87f4
JP
30%{nil}
31
32%cargo_targetdir target
33%cargo_objdir %{?buildsubdir:%{_builddir}/%{buildsubdir}/}%{cargo_targetdir}/%{cargo_target}/%{!?debug:release}%{?debug:debug}
34
2e9c5710
JP
35%__cargo /usr/bin/cargo
36%__cargo_common_opts -v --offline
c0244625 37%cargo_build \\\
733059e0
JP
38 CC="%{__cc}" \\\
39 CXX="%{__cxx}" \\\
fa87bfb7
JP
40 CFLAGS="%{rpmcppflags} %{rpmcflags}" \\\
41 CXXFLAGS="%{rpmcppflags} %{rpmcxxflags}" \\\
42 LDFLAGS="%{rpmldflags}" \\\
11d6d3bc 43 PKG_CONFIG_ALLOW_CROSS=1 \\\
c0244625
JP
44 RUSTFLAGS="${RUSTFLAGS:-%rpmrustflags}" \\\
45 %{?__jobs:CARGO_BUILD_JOBS="${CARGO_BUILD_JOBS:-%{__jobs}}"} \\\
46 %{__cargo} %{__cargo_common_opts} build %{!?debug:--release} \\\
a26c87f4
JP
47 --target %{cargo_target} \\\
48 --target-dir %{cargo_targetdir} \\\
c0244625
JP
49%{nil}
50
51%cargo_install \\\
733059e0
JP
52 CC="%{__cc}" \\\
53 CXX="%{__cxx}" \\\
fa87bfb7
JP
54 CFLAGS="%{rpmcppflags} %{rpmcflags}" \\\
55 CXXFLAGS="%{rpmcppflags} %{rpmcxxflags}" \\\
56 LDFLAGS="%{rpmldflags}" \\\
11d6d3bc 57 PKG_CONFIG_ALLOW_CROSS=1 \\\
c0244625
JP
58 RUSTFLAGS="${RUSTFLAGS:-%rpmrustflags}" \\\
59 %{?__jobs:CARGO_BUILD_JOBS="${CARGO_BUILD_JOBS:-%{__jobs}}"} \\\
60 %{__cargo} %{__cargo_common_opts} install \\\
61%ifarch x32 \
62 --target x86_64-unknown-linux-gnux32 \\\
63%endif \
64%{nil}
This page took 0.040482 seconds and 4 git commands to generate.