]> git.pld-linux.org Git - packages/rust-cbindgen.git/blob - rust-cbindgen.spec
BRs for tar.xz source
[packages/rust-cbindgen.git] / rust-cbindgen.spec
1 # TODO: use shared crates?
2 %define         crates_ver      0.17.0
3
4 Summary:        Tool for generating C bindings to Rust code
5 Summary(pl.UTF-8):      Narzędzie do generowania wiązań C do kodu w języku Rust
6 Name:           rust-cbindgen
7 Version:        0.17.0
8 Release:        1
9 License:        MPL v2.0
10 Group:          Development/Tools
11 #Source0Download: https://github.com/eqrion/cbindgen/releases
12 Source0:        https://github.com/eqrion/cbindgen/archive/v%{version}/cbindgen-%{version}.tar.gz
13 # Source0-md5:  319023d51257da454f9a30aa3a358429
14 # cd cbindgen-%{version}
15 # cargo vendor
16 # cd ..
17 # tar cJf cbindgen-crates-%{version}.tar.xz cbindgen-%{version}/{vendor,Cargo.lock}
18 Source1:        cbindgen-crates-%{crates_ver}.tar.xz
19 # Source1-md5:  591b55e08ff5221aa86ab761b5a73ef6
20 URL:            https://github.com/eqrion/cbindgen
21 BuildRequires:  cargo
22 BuildRequires:  rust
23 BuildRequires:  tar >= 1:1.22
24 BuildRequires:  xz
25 ExclusiveArch:  %{x8664} %{ix86} aarch64
26 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
27
28 %description
29 This project can be used to generate C bindings for Rust code.
30
31 %description -l pl.UTF-8
32 Ten projekt służy do generowania wiązań C do kodu w języku Rust.
33
34 %prep
35 %setup -q -n cbindgen-%{version} -a1
36
37 %{__mv} cbindgen-%{crates_ver}/* .
38 sed -i -e 's/@@VERSION@@/%{version}/' Cargo.lock
39
40 # use our offline registry
41 export CARGO_HOME="$(pwd)/.cargo"
42
43 mkdir -p "$CARGO_HOME"
44 cat >.cargo/config <<EOF
45 [source.crates-io]
46 registry = 'https://github.com/rust-lang/crates.io-index'
47 replace-with = 'vendored-sources'
48
49 [source.vendored-sources]
50 directory = '$PWD/vendor'
51 EOF
52
53 %build
54 export CARGO_HOME="$(pwd)/.cargo"
55
56 cargo -v build --release --frozen
57
58 %install
59 rm -rf $RPM_BUILD_ROOT
60 export CARGO_HOME="$(pwd)/.cargo"
61
62 cargo -v install --frozen --root $RPM_BUILD_ROOT%{_prefix} --path $PWD
63 %{__rm} $RPM_BUILD_ROOT%{_prefix}/.crates*
64
65 %clean
66 rm -rf $RPM_BUILD_ROOT
67
68 %files
69 %defattr(644,root,root,755)
70 %doc README.md CHANGES contributing.md docs.md internals.md
71 %attr(755,root,root) %{_bindir}/cbindgen
This page took 0.158006 seconds and 3 git commands to generate.