]>
Commit | Line | Data |
---|---|---|
1 | # | |
2 | # TODO: | |
3 | # - investigate why vktrace does not work | |
4 | ||
5 | ||
6 | # Conditional build: | |
7 | %bcond_with tests # run tests (require a working Vulkan driver (ICD)) | |
8 | %bcond_with mir # Mir support in loader | |
9 | %bcond_without wayland # Wayland support in loader | |
10 | %bcond_without x11 # XLib support in loader | |
11 | ||
12 | %define api_version 1.0.68 | |
13 | # see submodules/Vulkan-LoaderAndValidationLayers in git | |
14 | %define lvl_rev 65c23aec1365c0a727323af6f331b0773b4fc1de | |
15 | ||
16 | Summary: LunarG Vulkan SDK | |
17 | Summary(pl.UTF-8): Pakiet programistyczny (SDK) LunarG Vulkan | |
18 | Name: vulkan-sdk | |
19 | Version: 1.0.68.0 | |
20 | Release: 3 | |
21 | License: Apache v2.0, parts MIT-like | |
22 | Group: Development | |
23 | Source0: https://github.com/LunarG/VulkanTools/archive/sdk-%{version}/VulkanTools-%{version}.tar.gz | |
24 | # Source0-md5: 34f9b94a9c698bd6f62d1a0b8c1cc1bc | |
25 | Source1: https://github.com/KhronosGroup/Vulkan-LoaderAndValidationLayers/archive/%{lvl_rev}/Vulkan-LoaderAndValidationLayers-%{lvl_rev}.tar.gz | |
26 | # Source1-md5: 6da35fb1d4ba687e1d67c39aaa474c4b | |
27 | Patch0: system_glslang_and_spirv-tools.patch | |
28 | Patch1: demos_out_of_src.patch | |
29 | Patch2: rpath.patch | |
30 | Patch3: %{name}-c++.patch | |
31 | Patch4: x32.patch | |
32 | Patch5: system_jsoncpp.patch | |
33 | URL: http://lunarg.com/vulkan-sdk/ | |
34 | BuildRequires: GLM | |
35 | BuildRequires: Qt5Core-devel >= 5 | |
36 | BuildRequires: Qt5Gui-devel >= 5 | |
37 | BuildRequires: Qt5Svg-devel >= 5 | |
38 | BuildRequires: Qt5Widgets-devel >= 5 | |
39 | BuildRequires: bison | |
40 | BuildRequires: cmake >= 3.0 | |
41 | %if %{with tests} && %(locale -a | grep -q '^C\.UTF-8$'; echo $?) | |
42 | BuildRequires: glibc-localedb-all | |
43 | %endif | |
44 | BuildRequires: glslang >= 3.0.s20180205 | |
45 | BuildRequires: glslang-devel >= 3.0.s20180205 | |
46 | BuildRequires: graphviz | |
47 | BuildRequires: ImageMagick-devel | |
48 | BuildRequires: jsoncpp-devel | |
49 | BuildRequires: libpng | |
50 | BuildRequires: libstdc++-devel >= 6:4.7 | |
51 | BuildRequires: libxcb-devel | |
52 | %{?with_mir:BuildRequires: mir-devel} | |
53 | BuildRequires: pkgconfig | |
54 | BuildRequires: python3 >= 1:3 | |
55 | BuildRequires: python3-lxml | |
56 | BuildRequires: python3-modules >= 1:3 | |
57 | BuildRequires: qt5-build >= 5 | |
58 | BuildRequires: rpmbuild(macros) >= 1.605 | |
59 | BuildRequires: spirv-tools-devel >= v2018.1-0.s20180210 | |
60 | BuildRequires: udev-devel | |
61 | %{?with_wayland:BuildRequires: wayland-devel} | |
62 | %{?with_x11:BuildRequires: xorg-lib-libX11-devel} | |
63 | Requires: glslang >= 3.0.s20180205 | |
64 | Requires: spirv-tools >= v2018.1-0.s20180210 | |
65 | Requires: %{name}-debug-layers = %{version}-%{release} | |
66 | Requires: vulkan-devel = %{version}-%{release} | |
67 | Requires: vulkan-loader = %{version}-%{release} | |
68 | Requires: vulkan-sdk-tools = %{version}-%{release} | |
69 | Requires: %{name}-validation-layers = %{version}-%{release} | |
70 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
71 | ||
72 | %ifarch %{x8664} | |
73 | %define binsuf %{nil} | |
74 | %else | |
75 | %define binsuf 32 | |
76 | %endif | |
77 | ||
78 | %description | |
79 | Vulkan API Software Development Kit. | |
80 | ||
81 | %description -l pl.UTF-8 | |
82 | Pakiet programistyczny (SDK) Vulkan API | |
83 | ||
84 | %package -n vulkan-loader | |
85 | Summary: Vulkan API loader | |
86 | Summary(pl.UTF-8): Biblioteka wczytująca sterowniki Vulkan | |
87 | Group: Libraries | |
88 | Provides: vulkan(loader) = %{api_version} | |
89 | ||
90 | %description -n vulkan-loader | |
91 | Common loader for Vulkan API drivers. | |
92 | ||
93 | %description -n vulkan-loader -l pl.UTF-8 | |
94 | Wspólna biblioteka wczytująca sterowniki Vulkan. | |
95 | ||
96 | %package -n vulkan-devel | |
97 | Summary: Header files for the Vulkan API | |
98 | Summary(pl.UTF-8): Pliki nagłówkowe API Vulkan | |
99 | Group: Development/Libraries | |
100 | Requires: vulkan-loader = %{version}-%{release} | |
101 | ||
102 | %description -n vulkan-devel | |
103 | Header files for the Vulkan API. | |
104 | ||
105 | %description -n vulkan-devel -l pl.UTF-8 | |
106 | Pliki nagłówkowe API Vulkan. | |
107 | ||
108 | %package tools | |
109 | Summary: Vulkan tools | |
110 | Summary(pl.UTF-8): Narzędzia Vulkana | |
111 | Group: Development/Tools | |
112 | Suggests: vulkan(icd) | |
113 | Requires: vulkan-loader = %{version}-%{release} | |
114 | ||
115 | %description tools | |
116 | Vulkan tools. | |
117 | ||
118 | %description tools -l pl.UTF-8 | |
119 | Narzędzia Vulkana. | |
120 | ||
121 | %package tools-vktraceviewer | |
122 | Summary: Vulkan trace viewer | |
123 | Summary(pl.UTF-8): Przeglądarka śladów Vulkana | |
124 | Group: Development/Tools | |
125 | Requires: %{name}-tools = %{version}-%{release} | |
126 | ||
127 | %description tools-vktraceviewer | |
128 | Vulkan trace viewer. | |
129 | ||
130 | %description tools-vktraceviewer -l pl.UTF-8 | |
131 | Przeglądarka śladów Vulkana. | |
132 | ||
133 | %package validation-layers | |
134 | Summary: Validation layers for Vulkan | |
135 | Summary(pl.UTF-8): Warstwy sprawdzania poprawności dla Vulkana | |
136 | Group: Development/Libraries | |
137 | Requires: vulkan-loader = %{version}-%{release} | |
138 | ||
139 | %description validation-layers | |
140 | Validation layers for Vulkan. | |
141 | ||
142 | %description validation-layers -l pl.UTF-8 | |
143 | Warstwy sprawdzania poprawności dla Vulkana. | |
144 | ||
145 | %package debug-layers | |
146 | Summary: Debug layers for Vulkan | |
147 | Summary(pl.UTF-8): Warstwy diagnostyczne dla Vulkana | |
148 | Group: Development/Libraries | |
149 | Requires: vulkan-loader = %{version}-%{release} | |
150 | ||
151 | %description debug-layers | |
152 | Debug layers for Vulkan. | |
153 | ||
154 | %description debug-layers -l pl.UTF-8 | |
155 | Warstwy diagnostyczne dla Vulkana. | |
156 | ||
157 | %package demos | |
158 | Summary: Vulkan demos | |
159 | Summary(pl.UTF-8): Programy demonstracyjne Vulkana | |
160 | Group: Development/Libraries | |
161 | Requires: vulkan(icd) | |
162 | Requires: vulkan-loader = %{version}-%{release} | |
163 | ||
164 | %description demos | |
165 | Vulkan demos. | |
166 | ||
167 | %description demos -l pl.UTF-8 | |
168 | Programy demonstracyjne Vulkana. | |
169 | ||
170 | %prep | |
171 | %setup -qn VulkanTools-sdk-%{version} | |
172 | %{__tar} xzf %{SOURCE1} -C submodules/Vulkan-LoaderAndValidationLayers --strip-components=1 | |
173 | ||
174 | %patch0 -p1 | |
175 | %patch1 -p1 | |
176 | %patch2 -p1 | |
177 | %patch3 -p1 | |
178 | %patch4 -p1 | |
179 | %patch5 -p1 | |
180 | ||
181 | find . -name '*.orig' | xargs -r rm -f | |
182 | ||
183 | install -d submodules/Vulkan-LoaderAndValidationLayers/external/glslang/External/spirv-tools | |
184 | # spirv-tools commit ID | |
185 | echo '1d7b1423f939027da9a9524765a36fa71be265cd' > submodules/Vulkan-LoaderAndValidationLayers/external/glslang/External/spirv-tools/.git_rev | |
186 | ||
187 | %build | |
188 | install -d build | |
189 | cd build | |
190 | ||
191 | # .pc file creation expect CMAKE_INSTALL_LIBDIR to be relative (to CMAKE_INSTALL_PREFIX) | |
192 | %cmake .. \ | |
193 | -DCMAKE_ASM-ATT_COMPILER=%{__as} \ | |
194 | -DCMAKE_INSTALL_LIBDIR=%{_lib} \ | |
195 | -DJSONCPP_INCLUDE_DIR=/usr/include/jsoncpp \ | |
196 | -DBUILD_TESTS=%{?with_tests:ON}%{!?with_tests:OFF} \ | |
197 | -DBUILD_WSI_MIR_SUPPORT=%{?with_mir:ON}%{!?with_mir:OFF} \ | |
198 | -DBUILD_WSI_WAYLAND_SUPPORT=%{?with_wayland:ON}%{!?with_wayland:OFF} \ | |
199 | -DBUILD_WSI_XLIB_SUPPORT=%{?with_x11:ON}%{!?with_x11:OFF} \ | |
200 | -DBUILD_ICD=OFF | |
201 | ||
202 | %{__make} | |
203 | ||
204 | %if %{with tests} | |
205 | cd tests | |
206 | LC_ALL=C.UTF-8 VK_LAYER_PATH=../layers LD_LIBRARY_PATH=../loader:../layers ./run_all_tests.sh | |
207 | cd .. | |
208 | %endif | |
209 | ||
210 | cd .. | |
211 | ||
212 | %install | |
213 | rm -rf $RPM_BUILD_ROOT | |
214 | install -d $RPM_BUILD_ROOT{%{_datadir},%{_sysconfdir}}/vulkan/icd.d \ | |
215 | $RPM_BUILD_ROOT{%{_datadir},%{_sysconfdir}}/vulkan/{explicit,implicit}_layer.d \ | |
216 | $RPM_BUILD_ROOT%{_bindir} \ | |
217 | $RPM_BUILD_ROOT%{_includedir}/vulkan \ | |
218 | $RPM_BUILD_ROOT%{_datadir}/%{name}-demos \ | |
219 | $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} | |
220 | ||
221 | %{__make} -C build install \ | |
222 | DESTDIR=$RPM_BUILD_ROOT | |
223 | ||
224 | install build/submodules/Vulkan-LoaderAndValidationLayers/demos/cube $RPM_BUILD_ROOT%{_bindir}/vulkan-cube | |
225 | %{__mv} $RPM_BUILD_ROOT%{_bindir}/{smoketest,vulkan-smoketest} | |
226 | cp -p build/submodules/Vulkan-LoaderAndValidationLayers/demos/lunarg.ppm $RPM_BUILD_ROOT%{_datadir}/%{name}-demos | |
227 | ||
228 | %{__mv} $RPM_BUILD_ROOT%{_sysconfdir}/vulkan/explicit_layer.d/* $RPM_BUILD_ROOT%{_datadir}/vulkan/explicit_layer.d | |
229 | %if "%{binsuf}" != "" | |
230 | sed -i -e's@libVkLayer_vktrace_layer.so@libVkLayer_vktrace_layer%{binsuf}.so@' \ | |
231 | $RPM_BUILD_ROOT%{_datadir}/vulkan/explicit_layer.d/VkLayer_vktrace_layer.json | |
232 | %{__mv} $RPM_BUILD_ROOT%{_datadir}/vulkan/explicit_layer.d/{VkLayer_vktrace_layer,VkLayer_vktrace_layer%{binsuf}}.json | |
233 | %endif | |
234 | ||
235 | install build/submodules/Vulkan-LoaderAndValidationLayers/libs/vkjson/vkjson_{info,unittest} $RPM_BUILD_ROOT%{_bindir} | |
236 | cp -p build/submodules/Vulkan-LoaderAndValidationLayers/libs/vkjson/libvkjson.a $RPM_BUILD_ROOT%{_libdir} | |
237 | cp -p submodules/Vulkan-LoaderAndValidationLayers/libs/vkjson/vkjson.h $RPM_BUILD_ROOT%{_includedir} | |
238 | ||
239 | cp -pr submodules/Vulkan-LoaderAndValidationLayers/demos/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} | |
240 | %{__rm} -r $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}/{android,*.user,smoke/android} | |
241 | ||
242 | install build/vktrace/vktraceviewer%{binsuf} $RPM_BUILD_ROOT%{_bindir} | |
243 | ||
244 | cp -p via/README.md via-README.md | |
245 | cp -p vktrace/LICENSE vktrace-LICENSE | |
246 | cp -p vktrace/README.md vktrace-README.md | |
247 | cp -p vktrace/TODO.md vktrace-TODO.md | |
248 | ||
249 | %clean | |
250 | rm -rf $RPM_BUILD_ROOT | |
251 | ||
252 | %post -n vulkan-loader -p /sbin/ldconfig | |
253 | %postun -n vulkan-loader -p /sbin/ldconfig | |
254 | ||
255 | %files | |
256 | %defattr(644,root,root,755) | |
257 | ||
258 | %files -n vulkan-loader | |
259 | %defattr(644,root,root,755) | |
260 | %doc submodules/Vulkan-LoaderAndValidationLayers/{COPYRIGHT.txt,README.md,loader/LoaderAndLayerInterface.md} | |
261 | %dir %{_sysconfdir}/vulkan | |
262 | %dir %{_sysconfdir}/vulkan/icd.d | |
263 | %dir %{_sysconfdir}/vulkan/explicit_layer.d | |
264 | %dir %{_sysconfdir}/vulkan/implicit_layer.d | |
265 | %dir %{_datadir}/vulkan | |
266 | %dir %{_datadir}/vulkan/icd.d | |
267 | %dir %{_datadir}/vulkan/explicit_layer.d | |
268 | %dir %{_datadir}/vulkan/implicit_layer.d | |
269 | %attr(755,root,root) %{_libdir}/libvulkan.so.1.*.* | |
270 | %attr(755,root,root) %ghost %{_libdir}/libvulkan.so.1 | |
271 | ||
272 | %files -n vulkan-devel | |
273 | %defattr(644,root,root,755) | |
274 | %attr(755,root,root) %{_libdir}/libvulkan.so | |
275 | %{_libdir}/libvkjson.a | |
276 | %{_includedir}/vulkan | |
277 | %{_includedir}/vkjson.h | |
278 | %{_pkgconfigdir}/vulkan.pc | |
279 | %{_examplesdir}/%{name}-%{version} | |
280 | ||
281 | %files tools | |
282 | %defattr(644,root,root,755) | |
283 | %doc COPYRIGHT.txt README.md via-README.md vktrace-{LICENSE,README.md,TODO.md} | |
284 | %attr(755,root,root) %{_bindir}/via | |
285 | %attr(755,root,root) %{_bindir}/vkjson_info | |
286 | %attr(755,root,root) %{_bindir}/vkjson_unittest | |
287 | %attr(755,root,root) %{_bindir}/vulkaninfo | |
288 | %attr(755,root,root) %{_bindir}/vkreplay%{binsuf} | |
289 | %attr(755,root,root) %{_bindir}/vktrace%{binsuf} | |
290 | %attr(755,root,root) %{_libdir}/libVkLayer_vktrace_layer%{binsuf}.so | |
291 | %{_datadir}/vulkan/explicit_layer.d/VkLayer_vktrace_layer%{binsuf}.json | |
292 | ||
293 | %files tools-vktraceviewer | |
294 | %defattr(644,root,root,755) | |
295 | %attr(755,root,root) %{_bindir}/vktraceviewer%{binsuf} | |
296 | ||
297 | %files validation-layers | |
298 | %defattr(644,root,root,755) | |
299 | %doc submodules/Vulkan-LoaderAndValidationLayers/layers/{README.md,vk_layer_settings.txt} | |
300 | %attr(755,root,root) %{_libdir}/libVkLayer_core_validation.so | |
301 | %attr(755,root,root) %{_libdir}/libVkLayer_object_tracker.so | |
302 | %attr(755,root,root) %{_libdir}/libVkLayer_parameter_validation.so | |
303 | %attr(755,root,root) %{_libdir}/libVkLayer_threading.so | |
304 | %attr(755,root,root) %{_libdir}/libVkLayer_unique_objects.so | |
305 | %attr(755,root,root) %{_libdir}/libVkLayer_utils.so | |
306 | %{_datadir}/vulkan/explicit_layer.d/VkLayer_core_validation.json | |
307 | %{_datadir}/vulkan/explicit_layer.d/VkLayer_object_tracker.json | |
308 | %{_datadir}/vulkan/explicit_layer.d/VkLayer_parameter_validation.json | |
309 | %{_datadir}/vulkan/explicit_layer.d/VkLayer_standard_validation.json | |
310 | %{_datadir}/vulkan/explicit_layer.d/VkLayer_threading.json | |
311 | %{_datadir}/vulkan/explicit_layer.d/VkLayer_unique_objects.json | |
312 | ||
313 | %files debug-layers | |
314 | %defattr(644,root,root,755) | |
315 | %doc layersvt/{README.md,vk_layer_settings.txt} | |
316 | %attr(755,root,root) %{_libdir}/libVkLayer_api_dump.so | |
317 | %attr(755,root,root) %{_libdir}/libVkLayer_assistant_layer.so | |
318 | %attr(755,root,root) %{_libdir}/libVkLayer_demo_layer.so | |
319 | %attr(755,root,root) %{_libdir}/libVkLayer_device_simulation.so | |
320 | %attr(755,root,root) %{_libdir}/libVkLayer_monitor.so | |
321 | %attr(755,root,root) %{_libdir}/libVkLayer_screenshot.so | |
322 | %attr(755,root,root) %{_libdir}/libVkLayer_starter_layer.so | |
323 | %{_datadir}/vulkan/explicit_layer.d/VkLayer_api_dump.json | |
324 | %{_datadir}/vulkan/explicit_layer.d/VkLayer_assistant_layer.json | |
325 | %{_datadir}/vulkan/explicit_layer.d/VkLayer_demo_layer.json | |
326 | %{_datadir}/vulkan/explicit_layer.d/VkLayer_device_simulation.json | |
327 | %{_datadir}/vulkan/explicit_layer.d/VkLayer_monitor.json | |
328 | %{_datadir}/vulkan/explicit_layer.d/VkLayer_screenshot.json | |
329 | %{_datadir}/vulkan/explicit_layer.d/VkLayer_starter_layer.json | |
330 | ||
331 | %files demos | |
332 | %defattr(644,root,root,755) | |
333 | %doc submodules/Vulkan-LoaderAndValidationLayers/demos/smoke/README.md | |
334 | %attr(755,root,root) %{_bindir}/vulkan-cube | |
335 | %attr(755,root,root) %{_bindir}/vulkan-smoketest | |
336 | %{_datadir}/%{name}-demos |