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