]> git.pld-linux.org Git - packages/rav1e.git/blob - rav1e.spec
- updated to 0.6.3
[packages/rav1e.git] / rav1e.spec
1 #
2 # Conditional build:
3 %bcond_without  clib    # C library
4
5 # no working cargo-c on x32 currently
6 %ifarch x32
7 %undefine       with_clib
8 %endif
9 Summary:        The fastest and safest AV1 encoder
10 Summary(pl.UTF-8):      Najszybszy i najbezpieczniejszy koder AV1
11 Name:           rav1e
12 Version:        0.6.3
13 Release:        1
14 License:        BSD
15 Group:          Libraries
16 #Source0Download: https://github.com/xiph/rav1e/releases
17 Source0:        https://github.com/xiph/rav1e/archive/v%{version}/%{name}-%{version}.tar.gz
18 # Source0-md5:  9a20e7b39ed1033c0266948454adf425
19 # cd %{name}-%{version}
20 # cargo vendor
21 # cd ..
22 # tar cJf rav1e-crates-%{version}.tar.xz %{name}-%{version}/{vendor,Cargo.lock}
23 Source1:        %{name}-crates-%{version}.tar.xz
24 # Source1-md5:  52ac263ee653ce41f05bf7c7b58df6b0
25 URL:            https://github.com/xiph/rav1e
26 BuildRequires:  cargo
27 %{?with_clib:BuildRequires:     cargo-c}
28 %ifarch %{x8664}
29 BuildRequires:  nasm >= 2.14
30 %endif
31 BuildRequires:  rust >= 1.51.0
32 # for tests only?
33 #BuildRequires: aom-devel
34 #BuildRequires: dav1d-devel
35 ExclusiveArch:  %{ix86} %{x8664} x32 aarch64
36 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
37
38 %ifarch x32
39 %define         target_opt      --target x86_64-unknown-linux-gnux32
40 %define         features        --no-default-features --features "binaries signal_support"
41 %else
42 %define         target_opt      %{nil}
43 %define         features        %{nil}
44 %endif
45
46 %description
47 rav1e is an AV1 video encoder. It is designed to eventually cover all
48 use cases, though in its current form it is most suitable for cases
49 where libaom (the reference encoder) is too slow.
50
51 %description -l pl.UTF-8
52 rav1e to koder obrazu AV1. Jest projektowany, aby ewentualnie pokrywać
53 wszystkie przypadki użycia, ale w obecnej postaci nadaje się najlepiej
54 tam, gdzie libaom (koder referencyjny) jest zbyt wolny.
55
56 %package libs
57 Summary:        Shared rav1e library
58 Summary(pl.UTF-8):      Biblioteka współdzielona rav1e
59 Group:          Libraries
60
61 %description libs
62 Shared rav1e library.
63
64 %description libs -l pl.UTF-8
65 Biblioteka współdzielona rav1e.
66
67 %package devel
68 Summary:        Header files for rav1e library
69 Summary(pl.UTF-8):      Pliki nagłówkowe biblioteki rav1e
70 Group:          Development/Libraries
71 Requires:       %{name}-libs = %{version}-%{release}
72
73 %description devel
74 Header files for rav1e library.
75
76 %description devel -l pl.UTF-8
77 Pliki nagłówkowe biblioteki rav1e.
78
79 %package static
80 Summary:        Static rav1e library
81 Summary(pl.UTF-8):      Statyczna biblioteka rav1e
82 Group:          Development/Libraries
83 Requires:       %{name}-devel = %{version}-%{release}
84
85 %description static
86 Static rav1e library.
87
88 %description static -l pl.UTF-8
89 Statyczna biblioteka rav1e.
90
91 %prep
92 %setup -q -b1
93
94 # use our offline registry
95 export CARGO_HOME="$(pwd)/.cargo"
96
97 mkdir -p "$CARGO_HOME"
98 cat >.cargo/config <<EOF
99 [source.crates-io]
100 replace-with = 'vendored-sources'
101
102 [source.vendored-sources]
103 directory = '$PWD/vendor'
104 EOF
105
106 %build
107 export CARGO_HOME="$(pwd)/.cargo"
108
109 cargo -v build --release --frozen %{target_opt} %{features}
110
111 %if %{with clib}
112 cargo -v cbuild --release --frozen %{target_opt} \
113         --prefix %{_prefix} \
114         --libdir %{_libdir}
115 %endif
116
117 %install
118 rm -rf $RPM_BUILD_ROOT
119
120 cargo -v install --frozen %{target_opt} %{features} \
121         --path . \
122         --root $RPM_BUILD_ROOT%{_prefix}
123
124 %if %{with clib}
125 cargo -v cinstall --frozen --release %{target_opt} \
126         --destdir $RPM_BUILD_ROOT \
127         --prefix %{_prefix} \
128         --bindir %{_bindir} \
129         --includedir %{_includedir} \
130         --libdir %{_libdir}
131 %endif
132
133 %{__rm} $RPM_BUILD_ROOT%{_prefix}/.crates*
134
135 %clean
136 rm -rf $RPM_BUILD_ROOT
137
138 %post   libs -p /sbin/ldconfig
139 %postun libs -p /sbin/ldconfig
140
141 %files
142 %defattr(644,root,root,755)
143 %doc LICENSE PATENTS README.md
144 %attr(755,root,root) %{_bindir}/rav1e
145
146 %if %{with clib}
147 %files libs
148 %defattr(644,root,root,755)
149 %doc LICENSE PATENTS README.md doc/GLOSSARY.md
150 %attr(755,root,root) %{_libdir}/librav1e.so.*.*.*
151 %attr(755,root,root) %ghost %{_libdir}/librav1e.so.0
152
153 %files devel
154 %defattr(644,root,root,755)
155 %attr(755,root,root) %{_libdir}/librav1e.so
156 %{_includedir}/rav1e
157 %{_pkgconfigdir}/rav1e.pc
158
159 %files static
160 %defattr(644,root,root,755)
161 %{_libdir}/librav1e.a
162 %endif
This page took 0.097743 seconds and 3 git commands to generate.