]> TLD Linux GIT Repositories - packages/rpm-tld-macros.git/blob - macros.rust
- merged 2.030 from PLD, re-enabled PHP dependency generators
[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}} -C strip=none
2 %rpmrustflags   %debuginforustflags
3 %rust_arches    %{x8664} %{ix86} x32 aarch64 armv6hl armv7hl armv7hnl
4
5 %rust_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 \
25 armv7-unknown-linux-gnueabihf\\\
26 %endif\
27 %ifarch armv7hnl\
28 thumbv7neon-unknown-linux-gnueabihf\\\
29 %endif\
30 %{nil}
31
32 %cargo_target   %rust_target
33 %cargo_targetdir        target
34 %cargo_objdir           %{?buildsubdir:%{_builddir}/%{buildsubdir}/}%{cargo_targetdir}/%{rust_target}/%{!?debug:release}%{?debug:debug}
35
36 %__rustc        /usr/bin/rustc
37 %__cargo        /usr/bin/cargo
38 %__cargo_common_opts    -v --offline
39 %cargo_build \\\
40         CC="%{__cc}" \\\
41         CXX="%{__cxx}" \\\
42         CFLAGS="%{rpmcppflags} %{rpmcflags}" \\\
43         CXXFLAGS="%{rpmcppflags} %{rpmcxxflags}" \\\
44         LDFLAGS="%{rpmldflags}" \\\
45         PKG_CONFIG_ALLOW_CROSS=1 \\\
46         RUSTC="${RUSTC:-%__rustc}" \\\
47         %{?rustc_wrapper:RUSTC_WRAPPER="${RUSTC_WRAPPER:-%rustc_wrapper}"} \\\
48         RUSTFLAGS="${RUSTFLAGS:-%rpmrustflags}" \\\
49         %{?__jobs:CARGO_BUILD_JOBS="${CARGO_BUILD_JOBS:-%{__jobs}}"} \\\
50         %{__cargo} %{__cargo_common_opts} build %{!?debug:--release} \\\
51         --target %rust_target \\\
52         --target-dir %{cargo_targetdir} \\\
53 %{nil}
54
55 %cargo_install \\\
56         CC="%{__cc}" \\\
57         CXX="%{__cxx}" \\\
58         CFLAGS="%{rpmcppflags} %{rpmcflags}" \\\
59         CXXFLAGS="%{rpmcppflags} %{rpmcxxflags}" \\\
60         LDFLAGS="%{rpmldflags}" \\\
61         PKG_CONFIG_ALLOW_CROSS=1 \\\
62         RUSTC="${RUSTC:-%__rustc}" \\\
63         %{?rustc_wrapper:RUSTC_WRAPPER="${RUSTC_WRAPPER:-%rustc_wrapper}"} \\\
64         RUSTFLAGS="${RUSTFLAGS:-%rpmrustflags}" \\\
65         %{?__jobs:CARGO_BUILD_JOBS="${CARGO_BUILD_JOBS:-%{__jobs}}"} \\\
66         %{__cargo} %{__cargo_common_opts} install \\\
67         --target %rust_target \\\
68         --target-dir %{cargo_targetdir} \\\
69 %{nil}