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