]> git.pld-linux.org Git - packages/sccache.git/blob - sccache.spec
- allow cross compiling to fix build on x32
[packages/sccache.git] / sccache.spec
1 Summary:        sccache is ccache with cloud storage
2 Name:           sccache
3 Version:        0.2.15
4 Release:        1
5 License:        Apache v2.0
6 Group:          Development/Tools
7 Source0:        https://github.com/mozilla/sccache/archive/v%{version}/%{name}-%{version}.tar.gz
8 # Source0-md5:  dcb0cf6686c334df82f0a2b41eae19ab
9 # cd sccache-%{version}
10 # cargo vendor
11 # cd ..
12 # tar -cJf sccache-crates-%{version}.tar.xz sccache-%{version}/{vendor,Cargo.lock}
13 # ./dropin sccache-crates-%{version}.tar.xz
14 Source1:        %{name}-crates-%{version}.tar.xz
15 # Source1-md5:  cac0034c691ba28b575bb955fce1159d
16 Patch0:         openssl.patch
17 URL:            https://github.com/mozilla/sccache
18 BuildRequires:  openssl-devel
19 BuildRequires:  rust >= 1.43.0
20 BuildRequires:  cargo
21 BuildRequires:  rust
22 BuildRequires:  tar >= 1:1.22
23 BuildRequires:  xz
24 ExcludeArch:    s390 s390x ppc ppc64 ppc64le
25 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
26
27 # TODO: this should not be needed
28 %define         _debugsource_packages   0
29
30 %description
31 Sccache is a ccache-like tool. It is used as a compiler wrapper and
32 avoids compilation when possible, storing a cache in a remote storage
33 using the Amazon Simple Cloud Storage Service (S3) API, Redis or the
34 Google Cloud Storage (GCS) API.
35
36 %prep
37 %setup -q -b1
38 %patch0 -p1
39
40 install -d .cargo
41 cat >.cargo/config <<'EOF'
42
43 [source.crates-io]
44 replace-with = "vendored-sources"
45
46 [source."https://github.com/saresend/selenium-rs.git"]
47 git = "https://github.com/saresend/selenium-rs.git"
48 rev = "0314a2420da78cce7454a980d862995750771722"
49 replace-with = "vendored-sources"
50
51 [source.vendored-sources]
52 directory = "vendor"
53 EOF
54
55 %build
56 export CARGO_HOME="$(pwd)/.cargo"
57 export PKG_CONFIG_ALLOW_CROSS=1
58
59 cargo -v build \
60 %ifarch x32
61         --target x86_64-unknown-linux-gnux32 \
62 %endif
63         --release \
64         --offline
65
66 %clean
67 rm -rf $RPM_BUILD_ROOT
68
69 %install
70 rm -rf $RPM_BUILD_ROOT
71 export CARGO_HOME="$(pwd)/.cargo"
72
73 cargo -vv \
74         install \
75         --frozen \
76         --path . \
77         --root $RPM_BUILD_ROOT%{_prefix}
78
79 %{__rm} $RPM_BUILD_ROOT%{_prefix}/.crates.toml
80 %{__rm} $RPM_BUILD_ROOT%{_prefix}/.crates2.json
81
82 %files
83 %defattr(644,root,root,755)
84 %doc README.md LICENSE
85 %attr(755,root,root) %{_bindir}/sccache
This page took 0.067804 seconds and 3 git commands to generate.