]> git.pld-linux.org Git - packages/highway.git/blob - highway.spec
- workaround x32 gcc failure
[packages/highway.git] / highway.spec
1 #
2 # Conditional build:
3 %bcond_without  apidocs         # API documentation
4 %bcond_with     sse2            # SSE2 instructions on x86/x32
5 %bcond_without  tests           # don't build tests
6 #
7 Summary:        Efficient and performance-portable SIMD
8 Summary(pl.UTF-8):      Wydajne i przenośne operacje SIMD
9 Name:           highway
10 Version:        1.1.0
11 Release:        1
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
16 # Source0-md5:  6a5d433b66626afbd3fcc5884d2f270a
17 Patch0:         %{name}-no-avx.patch
18 URL:            https://github.com/google/highway
19 BuildRequires:  cmake >= 3.10
20 %{?with_tests:BuildRequires:    gtest-devel}
21 BuildRequires:  libstdc++-devel >= 6:4.7
22 BuildRequires:  rpm-build >= 4.6
23 BuildRequires:  rpmbuild(macros) >= 1.742
24 %{?with_sse2:Requires:  cpuinfo(sse2)}
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
38 Summary:        Header files for Highway library
39 Summary(pl.UTF-8):      Pliki nagłówkowe biblioteki Highway
40 Group:          Development/Libraries
41 Requires:       %{name} = %{version}-%{release}
42
43 %description devel
44 Header files for Highway library.
45
46 %description devel -l pl.UTF-8
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.
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
89 %patch0 -p1
90
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
96 %build
97 install -d build
98 cd build
99 %if %{with sse2}
100 CXXFLAGS="%{rpmcxxflags} -msse2"
101 %endif
102 %cmake .. \
103         %{cmake_on_off tests BUILD_TESTING} \
104         -DCMAKE_INSTALL_INCLUDEDIR=include \
105         -DCMAKE_INSTALL_LIBDIR=%{_lib} \
106         -DHWY_SYSTEM_GTEST=ON
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
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
126 %defattr(644,root,root,755)
127 %doc README.md
128 %attr(755,root,root) %{_libdir}/libhwy.so.*.*.*
129 %attr(755,root,root) %ghost %{_libdir}/libhwy.so.1
130 %attr(755,root,root) %{_libdir}/libhwy_contrib.so.*.*.*
131 %attr(755,root,root) %ghost %{_libdir}/libhwy_contrib.so.1
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
141 %{_pkgconfigdir}/libhwy.pc
142 %{_pkgconfigdir}/libhwy-contrib.pc
143 %{_libdir}/cmake/hwy
144
145 %files test
146 %defattr(644,root,root,755)
147 %attr(755,root,root) %{_libdir}/libhwy_test.so.*.*.*
148 %attr(755,root,root) %ghost %{_libdir}/libhwy_test.so.1
149
150 %files test-devel
151 %defattr(644,root,root,755)
152 %attr(755,root,root) %{_libdir}/libhwy_test.so
153 %{_includedir}/hwy/tests
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
This page took 0.068635 seconds and 3 git commands to generate.