]>
Commit | Line | Data |
---|---|---|
a15f1265 JB |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without apidocs # API documentation | |
96fad748 | 4 | %bcond_with sse2 # SSE2 instructions on x86/x32 |
8390db53 | 5 | %bcond_without tests # don't build tests |
a15f1265 JB |
6 | # |
7 | Summary: Efficient and performance-portable SIMD | |
8 | Summary(pl.UTF-8): Wydajne i przenośne operacje SIMD | |
9 | Name: highway | |
383afe8f JB |
10 | Version: 1.1.0 |
11 | Release: 1 | |
a15f1265 JB |
12 | License: Apache v2.0 |
13 | Group: Libraries | |
14 | #Source0Download: https://github.com/google/highway/releases | |
15 | Source0: https://github.com/google/highway/archive/%{version}/%{name}-%{version}.tar.gz | |
383afe8f JB |
16 | # Source0-md5: 6a5d433b66626afbd3fcc5884d2f270a |
17 | Patch0: %{name}-no-avx.patch | |
a15f1265 JB |
18 | URL: https://github.com/google/highway |
19 | BuildRequires: cmake >= 3.10 | |
8390db53 | 20 | %{?with_tests:BuildRequires: gtest-devel} |
a15f1265 JB |
21 | BuildRequires: libstdc++-devel >= 6:4.7 |
22 | BuildRequires: rpm-build >= 4.6 | |
8390db53 | 23 | BuildRequires: rpmbuild(macros) >= 1.742 |
96fad748 | 24 | %{?with_sse2:Requires: cpuinfo(sse2)} |
a15f1265 JB |
25 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
26 | ||
27 | %description | |
28 | Highway is a C++ library for SIMD (Single Instruction, Multiple Data), | |
29 | i.e. applying the same operation to multiple 'lanes' using a single | |
30 | CPU instruction. | |
31 | ||
32 | %description -l pl.UTF-8 | |
33 | Highway to biblioteka C++ do operacji SIMD (Single Instruction, | |
34 | Multiple Data), czyli wykonywania tej samej operacji na wielu "pasach" | |
35 | przy użyciu pojedynczej instrukcji procesora. | |
36 | ||
37 | %package devel | |
27467171 JB |
38 | Summary: Header files for Highway library |
39 | Summary(pl.UTF-8): Pliki nagłówkowe biblioteki Highway | |
a15f1265 | 40 | Group: Development/Libraries |
27467171 | 41 | Requires: %{name} = %{version}-%{release} |
a15f1265 JB |
42 | |
43 | %description devel | |
27467171 | 44 | Header files for Highway library. |
a15f1265 JB |
45 | |
46 | %description devel -l pl.UTF-8 | |
27467171 JB |
47 | Pliki nagłówkowe biblioteki Highway. |
48 | ||
49 | %package test | |
50 | Summary: Highway test helper library | |
51 | Summary(pl.UTF-8): Biblioteka pomocnicza testów z użyciem biblioteki Highway | |
52 | Group: Libraries | |
53 | Requires: %{name} = %{version}-%{release} | |
54 | ||
55 | %description test | |
56 | Highway test helper library. | |
57 | ||
58 | %description test -l pl.UTF-8 | |
59 | Biblioteka pomocnicza testów z użyciem biblioteki Highway. | |
60 | ||
61 | %package test-devel | |
62 | Summary: Header files for Highway test library | |
63 | Summary(pl.UTF-8): Pliki nagłówkowe biblioteki Highway test | |
64 | Group: Development/Libraries | |
65 | Requires: %{name}-devel = %{version}-%{release} | |
66 | Requires: %{name}-test = %{version}-%{release} | |
67 | Requires: gtest-devel | |
68 | ||
69 | %description test-devel | |
70 | Header files for Highway test library. | |
71 | ||
72 | %description test-devel -l pl.UTF-8 | |
73 | Pliki nagłówkowe biblioteki Highway test. | |
a15f1265 JB |
74 | |
75 | %package apidocs | |
76 | Summary: API documentation for Highway library | |
77 | Summary(pl.UTF-8): Dokumentacja API biblioteki Highway | |
78 | Group: Documentation | |
79 | BuildArch: noarch | |
80 | ||
81 | %description apidocs | |
82 | API documentation for Highway library. | |
83 | ||
84 | %description apidocs -l pl.UTF-8 | |
85 | Dokumentacja API biblioteki Highway. | |
86 | ||
87 | %prep | |
88 | %setup -q | |
96fad748 | 89 | %patch0 -p1 |
a15f1265 | 90 | |
16afce94 JB |
91 | %ifarch x32 |
92 | # gcc 13.2 fails with allocation error | |
93 | %{__sed} -i -e '/hwy\/tests\/arithmetic_test.cc/d' CMakeLists.txt | |
94 | %endif | |
95 | ||
a15f1265 JB |
96 | %build |
97 | install -d build | |
98 | cd build | |
96fad748 JB |
99 | %if %{with sse2} |
100 | CXXFLAGS="%{rpmcxxflags} -msse2" | |
101 | %endif | |
a15f1265 | 102 | %cmake .. \ |
8390db53 | 103 | %{cmake_on_off tests BUILD_TESTING} \ |
a15f1265 | 104 | -DCMAKE_INSTALL_INCLUDEDIR=include \ |
8564459d JB |
105 | -DCMAKE_INSTALL_LIBDIR=%{_lib} \ |
106 | -DHWY_SYSTEM_GTEST=ON | |
a15f1265 JB |
107 | |
108 | %{__make} | |
109 | ||
110 | %install | |
111 | rm -rf $RPM_BUILD_ROOT | |
112 | ||
113 | %{__make} -C build install \ | |
114 | DESTDIR=$RPM_BUILD_ROOT | |
115 | ||
116 | %clean | |
117 | rm -rf $RPM_BUILD_ROOT | |
118 | ||
27467171 JB |
119 | %post -p /sbin/ldconfig |
120 | %postun -p /sbin/ldconfig | |
121 | ||
122 | %post test -p /sbin/ldconfig | |
123 | %postun test -p /sbin/ldconfig | |
124 | ||
125 | %files | |
a15f1265 JB |
126 | %defattr(644,root,root,755) |
127 | %doc README.md | |
27467171 | 128 | %attr(755,root,root) %{_libdir}/libhwy.so.*.*.* |
782104e1 | 129 | %attr(755,root,root) %ghost %{_libdir}/libhwy.so.1 |
27467171 | 130 | %attr(755,root,root) %{_libdir}/libhwy_contrib.so.*.*.* |
782104e1 | 131 | %attr(755,root,root) %ghost %{_libdir}/libhwy_contrib.so.1 |
27467171 JB |
132 | |
133 | %files devel | |
134 | %defattr(644,root,root,755) | |
135 | %attr(755,root,root) %{_libdir}/libhwy.so | |
136 | %attr(755,root,root) %{_libdir}/libhwy_contrib.so | |
137 | %dir %{_includedir}/hwy | |
138 | %{_includedir}/hwy/contrib | |
139 | %{_includedir}/hwy/ops | |
140 | %{_includedir}/hwy/*.h | |
a15f1265 JB |
141 | %{_pkgconfigdir}/libhwy.pc |
142 | %{_pkgconfigdir}/libhwy-contrib.pc | |
b20a5102 | 143 | %{_libdir}/cmake/hwy |
27467171 JB |
144 | |
145 | %files test | |
146 | %defattr(644,root,root,755) | |
147 | %attr(755,root,root) %{_libdir}/libhwy_test.so.*.*.* | |
782104e1 | 148 | %attr(755,root,root) %ghost %{_libdir}/libhwy_test.so.1 |
27467171 JB |
149 | |
150 | %files test-devel | |
151 | %defattr(644,root,root,755) | |
152 | %attr(755,root,root) %{_libdir}/libhwy_test.so | |
153 | %{_includedir}/hwy/tests | |
a15f1265 JB |
154 | %{_pkgconfigdir}/libhwy-test.pc |
155 | ||
156 | %if %{with apidocs} | |
157 | %files apidocs | |
158 | %defattr(644,root,root,755) | |
159 | %doc g3doc/*.{md,pdf} | |
160 | %endif |