]>
Commit | Line | Data |
---|---|---|
42fe2c06 JB |
1 | # TODO: use shared crates? |
2 | Summary: Tool for generating C bindings to Rust code | |
3 | Summary(pl.UTF-8): Narzędzie do generowania wiązań C do kodu w języku Rust | |
4 | Name: rust-cbindgen | |
5 | Version: 0.8.7 | |
6 | Release: 1 | |
7 | License: MPL v2.0 | |
8 | Group: Development/Tools | |
9 | #Source0Download: https://github.com/eqrion/cbindgen/releases | |
10 | Source0: https://github.com/eqrion/cbindgen/archive/v%{version}/cbindgen-%{version}.tar.gz | |
11 | # Source0-md5: e80be8ee57b32d8424677082d079cb43 | |
12 | # cd cbindgen-%{version} | |
13 | # cargo vendor | |
14 | # cd .. | |
15 | # tar cJf cbindgen-crates-%{version}.tar.xz cbindgen-%{version}/{vendor,Cargo.lock} | |
16 | Source1: cbindgen-crates-%{version}.tar.xz | |
17 | # Source1-md5: 531d544bab4383baf6ff3008cae4d6e1 | |
18 | URL: https://github.com/eqrion/cbindgen | |
19 | BuildRequires: cargo | |
20 | BuildRequires: rust | |
21 | ExclusiveArch: %{x8664} %{ix86} | |
22 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
23 | ||
24 | %description | |
25 | This project can be used to generate C bindings for Rust code. | |
26 | ||
27 | %description -l pl.UTF-8 | |
28 | Ten projekt służy do generowania wiązań C do kodu w języku Rust. | |
29 | ||
30 | %prep | |
31 | %setup -q -n cbindgen-%{version} -b1 | |
32 | ||
33 | # use our offline registry | |
34 | export CARGO_HOME="$(pwd)/.cargo" | |
35 | ||
36 | mkdir -p "$CARGO_HOME" | |
37 | cat >.cargo/config <<EOF | |
38 | [source.crates-io] | |
39 | registry = 'https://github.com/rust-lang/crates.io-index' | |
40 | replace-with = 'vendored-sources' | |
41 | ||
42 | [source.vendored-sources] | |
43 | directory = '$PWD/vendor' | |
44 | EOF | |
45 | ||
46 | %build | |
47 | export CARGO_HOME="$(pwd)/.cargo" | |
48 | ||
49 | cargo -v build --release --frozen | |
50 | ||
51 | %install | |
52 | rm -rf $RPM_BUILD_ROOT | |
53 | export CARGO_HOME="$(pwd)/.cargo" | |
54 | ||
55 | cargo -v install --frozen --root $RPM_BUILD_ROOT%{_prefix} | |
56 | %{__rm} $RPM_BUILD_ROOT%{_prefix}/.crates.toml | |
57 | ||
58 | %clean | |
59 | rm -rf $RPM_BUILD_ROOT | |
60 | ||
61 | %files | |
62 | %defattr(644,root,root,755) | |
63 | %doc ARCHITECTURE.md README.md | |
64 | %attr(755,root,root) %{_bindir}/cbindgen |