-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmacros.rust
70 lines (66 loc) · 2.09 KB
/
macros.rust
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
%debuginforustflags -C debuginfo=%{expand:%%define __dic_%{?_enable_debug_packages} 1}%{?__dic_1:2}%{!?__dic_1:0}%{expand:%%undefine __dic_%{?_enable_debug_packages}} -C strip=none
%rpmrustflags %debuginforustflags
%rust_arches %{x8664} %{ix86} x32 aarch64 armv6hl armv7hl armv7hnl
%rust_target \\\
%ifarch i586\
i586-unknown-linux-gnu\\\
%endif\
%ifarch i686 pentium3 pentium4 athlon\
i686-unknown-linux-gnu\\\
%endif\
%ifarch %{x8664}\
x86_64-unknown-linux-gnu\\\
%endif\
%ifarch x32\
x86_64-unknown-linux-gnux32\\\
%endif\
%ifarch aarch64\
aarch64-unknown-linux-gnu\\\
%endif\
%ifarch armv6hl\
arm-unknown-linux-gnueabihf\\\
%endif\
%ifarch armv7hl \
armv7-unknown-linux-gnueabihf\\\
%endif\
%ifarch armv7hnl\
thumbv7neon-unknown-linux-gnueabihf\\\
%endif\
%{nil}
%cargo_target %rust_target
%cargo_targetdir target
%cargo_objdir %{?buildsubdir:%{_builddir}/%{buildsubdir}/}%{cargo_targetdir}/%{rust_target}/%{!?debug:release}%{?debug:debug}
%__rustc /usr/bin/rustc
%__cargo /usr/bin/cargo
%__cargo_common_opts -v --offline
%cargo_build \\\
CC="%{__cc}" \\\
CXX="%{__cxx}" \\\
CFLAGS="%{rpmcppflags} %{rpmcflags}" \\\
CXXFLAGS="%{rpmcppflags} %{rpmcxxflags}" \\\
LDFLAGS="%{rpmldflags}" \\\
PKG_CONFIG_ALLOW_CROSS=1 \\\
RUSTC="${RUSTC:-%__rustc}" \\\
%{?rustc_wrapper:RUSTC_WRAPPER="${RUSTC_WRAPPER:-%rustc_wrapper}"} \\\
RUSTFLAGS="${RUSTFLAGS:-%rpmrustflags}" \\\
%{?__jobs:CARGO_BUILD_JOBS="${CARGO_BUILD_JOBS:-%{__jobs}}"} \\\
%{__cargo} %{__cargo_common_opts} build %{!?debug:--release} \\\
--target %rust_target \\\
--target-dir %{cargo_targetdir} \\\
%{nil}
%cargo_install \\\
CC="%{__cc}" \\\
CXX="%{__cxx}" \\\
CFLAGS="%{rpmcppflags} %{rpmcflags}" \\\
CXXFLAGS="%{rpmcppflags} %{rpmcxxflags}" \\\
LDFLAGS="%{rpmldflags}" \\\
PKG_CONFIG_ALLOW_CROSS=1 \\\
RUSTC="${RUSTC:-%__rustc}" \\\
%{?rustc_wrapper:RUSTC_WRAPPER="${RUSTC_WRAPPER:-%rustc_wrapper}"} \\\
RUSTFLAGS="${RUSTFLAGS:-%rpmrustflags}" \\\
%{?__jobs:CARGO_BUILD_JOBS="${CARGO_BUILD_JOBS:-%{__jobs}}"} \\\
%{__cargo} %{__cargo_common_opts} install \\\
--target %rust_target \\\
--target-dir %{cargo_targetdir} \\\
--no-track \\\
%{nil}