]>
Commit | Line | Data |
---|---|---|
862291f5 JK |
1 | # |
2 | # Conditional build: | |
b72602b0 JK |
3 | %bcond_with tests # build with tests (require a working Vulkan |
4 | # driver (ICD)) | |
862291f5 JK |
5 | # |
6 | %define tag windows-rt-%{version} | |
20d76278 JK |
7 | Summary: Vulkan API loader |
8 | Name: vulkan-loader | |
862291f5 | 9 | Version: 1.0.3.0 |
4de5d362 | 10 | Release: 2 |
20d76278 JK |
11 | License: MIT-like |
12 | Group: Applications | |
862291f5 JK |
13 | Source0: https://github.com/KhronosGroup/Vulkan-LoaderAndValidationLayers/archive/%{tag}/%{name}-%{version}.tar.gz |
14 | # Source0-md5: 0691d2d79cf62902df2973bbdf594028 | |
15 | Patch0: system_glslang.patch | |
20d76278 | 16 | URL: https://github.com/KhronosGroup/Vulkan-LoaderAndValidationLayers |
862291f5 | 17 | #BuildRequires: LunarGLASS-devel |
20d76278 | 18 | BuildRequires: cmake |
4de5d362 | 19 | BuildRequires: glslang |
20d76278 JK |
20 | BuildRequires: glslang-devel |
21 | BuildRequires: python3 | |
22 | BuildRequires: python3-modules | |
23 | BuildRequires: spirv-tools-devel | |
24 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
25 | ||
26 | %description | |
27 | Common loader for Vulkan API drivers. | |
28 | ||
862291f5 JK |
29 | %package -n vulkan-layers |
30 | Summary: Validation layers for Vulkan | |
31 | Group: Development/Libraries | |
32 | Requires: %{name} = %{version}-%{release} | |
33 | ||
34 | %description -n vulkan-layers | |
35 | Validation layers for Vulkan. | |
36 | ||
20d76278 JK |
37 | %package -n vulkan-devel |
38 | Summary: Header files for the Vulkan API | |
39 | Summary(pl.UTF-8): Pliki nagłówkowe API Vulkan | |
40 | Group: Development/Libraries | |
41 | Requires: %{name} = %{version}-%{release} | |
42 | ||
43 | %description -n vulkan-devel | |
44 | Header files for the Vulkan API. | |
45 | ||
46 | %description -n vulkan-devel -l pl.UTF-8 | |
47 | Pliki nagłówkowe API Vulkan. | |
48 | ||
862291f5 JK |
49 | %package demos |
50 | Summary: Vulkan demos | |
51 | Group: Development/Libraries | |
52 | Requires: %{name} = %{version}-%{release} | |
53 | ||
54 | %description demos | |
55 | Vulkan demos. | |
56 | ||
57 | %package utils | |
58 | Summary: Vulkan loader utilities | |
59 | Group: Development/Libraries | |
60 | Requires: %{name} = %{version}-%{release} | |
61 | ||
62 | %description utils | |
63 | Vulkan loader utilities. | |
64 | ||
20d76278 | 65 | %prep |
862291f5 JK |
66 | %setup -qn Vulkan-LoaderAndValidationLayers-%{tag} |
67 | %patch0 -p1 | |
20d76278 JK |
68 | |
69 | %build | |
70 | install -d build | |
71 | cd build | |
72 | %cmake \ | |
862291f5 JK |
73 | %{?with_tests:-DBUILD_TESTS=ON} \ |
74 | %{!?with_tests:-DBUILD_TESTS=OFF} \ | |
75 | ../ | |
20d76278 JK |
76 | %{__make} |
77 | ||
b72602b0 JK |
78 | %if %{with tests} |
79 | cd tests | |
80 | LC_ALL=C.utf-8 VK_LAYER_PATH=../layers LD_LIBRARY_PATH=../loader:../layers ./run_all_tests.sh | |
81 | cd .. | |
82 | %endif | |
83 | ||
20d76278 JK |
84 | %install |
85 | rm -rf $RPM_BUILD_ROOT | |
862291f5 JK |
86 | install -d $RPM_BUILD_ROOT{%{_datadir},%{_sysconfdir}}/vulkan/icd.d \ |
87 | $RPM_BUILD_ROOT{%{_datadir},%{_sysconfdir}}/vulkan/{explicit,implicit}_layer.d \ | |
88 | $RPM_BUILD_ROOT{%{_bindir},%{_libdir}/vulkan/layer} \ | |
89 | $RPM_BUILD_ROOT%{_includedir}/vulkan \ | |
90 | $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} | |
91 | ||
92 | ||
93 | cd build | |
94 | %{__make} install | |
20d76278 | 95 | |
862291f5 JK |
96 | cp -p loader/libvulkan.so.1.0.3 $RPM_BUILD_ROOT%{_libdir} |
97 | ln -s libvulkan.so.1.0.3 $RPM_BUILD_ROOT%{_libdir}/libvulkan.so | |
98 | ln -s libvulkan.so.1.0.3 $RPM_BUILD_ROOT%{_libdir}/libvulkan.so.1 | |
99 | ||
100 | cp -p demos/vulkaninfo $RPM_BUILD_ROOT%{_bindir}/vulkaninfo | |
101 | cp -p demos/tri $RPM_BUILD_ROOT%{_bindir}/vulkan-tri | |
102 | cp -p demos/cube $RPM_BUILD_ROOT%{_bindir}/vulkan-cube | |
103 | ||
104 | cp -p install_staging/*.so $RPM_BUILD_ROOT%{_libdir}/vulkan/layer | |
105 | for f in layers/*.json ; do | |
106 | sed -e's@"library_path": "./@"library_path": "%{_libdir}/vulkan/layer/@' $f > $RPM_BUILD_ROOT%{_datadir}/vulkan/explicit_layer.d/$(basename $f) | |
107 | done | |
108 | ||
109 | cp -p libs/vkjson/libvkjson.a $RPM_BUILD_ROOT%{_libdir} | |
110 | cp -p libs/vkjson/vkjson_{info,unittest} $RPM_BUILD_ROOT%{_bindir} | |
111 | ||
112 | cd .. | |
113 | ||
114 | cp -p libs/vkjson/vkjson.h $RPM_BUILD_ROOT%{_includedir} | |
115 | cp -p include/vulkan/* $RPM_BUILD_ROOT%{_includedir}/vulkan | |
116 | ||
117 | cp -p demos/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} | |
20d76278 JK |
118 | |
119 | %clean | |
120 | rm -rf $RPM_BUILD_ROOT | |
121 | ||
122 | %post -p /sbin/ldconfig | |
123 | %postun -p /sbin/ldconfig | |
124 | ||
125 | %files | |
126 | %defattr(644,root,root,755) | |
862291f5 JK |
127 | %doc LICENSE.txt |
128 | %doc loader/{README.md,LoaderAndLayerInterface.md,LinuxICDs.txt} | |
129 | %dir %{_sysconfdir}/vulkan | |
130 | %dir %{_sysconfdir}/vulkan/icd.d | |
131 | %dir %{_sysconfdir}/vulkan/explicit_layer.d | |
132 | %dir %{_sysconfdir}/vulkan/implicit_layer.d | |
133 | %dir %{_datadir}/vulkan | |
134 | %dir %{_datadir}/vulkan/icd.d | |
135 | %dir %{_datadir}/vulkan/explicit_layer.d | |
136 | %dir %{_datadir}/vulkan/implicit_layer.d | |
137 | %{_libdir}/libvulkan.so.1.*.* | |
138 | %ghost %{_libdir}/libvulkan.so.1 | |
139 | %dir %{_libdir}/vulkan | |
140 | ||
141 | %files demos | |
142 | %defattr(644,root,root,755) | |
143 | %attr(755,root,root) %{_bindir}/vulkan-tri | |
144 | %attr(755,root,root) %{_bindir}/vulkan-cube | |
145 | ||
146 | %files utils | |
147 | %defattr(644,root,root,755) | |
148 | %attr(755,root,root) %{_bindir}/vulkaninfo | |
149 | %attr(755,root,root) %{_bindir}/vkjson_info | |
150 | %attr(755,root,root) %{_bindir}/vkjson_unittest | |
151 | ||
152 | %files -n vulkan-layers | |
153 | %defattr(644,root,root,755) | |
bd5c8876 | 154 | %doc LICENSE.txt layers/README.md layers/vk_layer_settings.txt |
862291f5 JK |
155 | %dir %{_libdir}/vulkan/layer |
156 | %{_libdir}/vulkan/layer/*.so | |
157 | %{_datadir}/vulkan/explicit_layer.d/*.json | |
158 | ||
159 | %files -n vulkan-devel | |
160 | %defattr(644,root,root,755) | |
161 | %doc LICENSE.txt README.md | |
162 | %{_libdir}/libvulkan.so | |
163 | %{_libdir}/libvkjson.a | |
164 | %{_includedir}/vulkan | |
165 | %{_includedir}/vkjson.h | |
166 | %{_examplesdir}/%{name}-%{version} |