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