Inital import
This commit is contained in:
parent
2e031cf1c8
commit
cba7e8bf2b
9 changed files with 385 additions and 0 deletions
4
.gitignore
vendored
4
.gitignore
vendored
|
|
@ -0,0 +1,4 @@
|
|||
/SPIRV-Headers-33d41376d378761ed3a4c791fc4b647761897f26.tar.gz
|
||||
/SPIRV-Tools-860030feab94360b9bf64cf486b44cffd62bdea8.tar.gz
|
||||
/Vulkan-LoaderAndValidationLayers-sdk-1.0.26.0.tar.gz
|
||||
/glslang-cfd7ce87cd10191c3d5afec077865c7c6dc9dd77.tar.gz
|
||||
13
0003-layers-Don-t-set-an-rpath.patch
Normal file
13
0003-layers-Don-t-set-an-rpath.patch
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
--- a/tests/layers/CMakeLists.txt
|
||||
+++ b/tests/layers/CMakeLists.txt
|
||||
@@ -4,9 +4,6 @@
|
||||
VkLayer_wrap_objects
|
||||
VkLayer_test
|
||||
)
|
||||
-
|
||||
-set(VK_LAYER_RPATH /usr/lib/x86_64-linux-gnu/vulkan/layer:/usr/lib/i386-linux-gnu/vulkan/layer)
|
||||
-set(CMAKE_INSTALL_RPATH ${VK_LAYER_RPATH})
|
||||
|
||||
if (WIN32)
|
||||
if (NOT (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_CURRENT_BINARY_DIR))
|
||||
|
||||
32
0004-layers-Install-to-CMAKE_INSTALL_LIBDIR.patch
Normal file
32
0004-layers-Install-to-CMAKE_INSTALL_LIBDIR.patch
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
--- a/layers/CMakeLists.txt
|
||||
+++ b/layers/CMakeLists.txt
|
||||
@@ -81,7 +81,7 @@
|
||||
target_link_Libraries(VkLayer_${target} VkLayer_utils)
|
||||
add_dependencies(VkLayer_${target} generate_vk_layer_helpers)
|
||||
set_target_properties(VkLayer_${target} PROPERTIES LINK_FLAGS "-Wl,-Bsymbolic")
|
||||
- install(TARGETS VkLayer_${target} DESTINATION ${PROJECT_BINARY_DIR}/install_staging)
|
||||
+ install(TARGETS VkLayer_${target} DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
||||
endmacro()
|
||||
endif()
|
||||
|
||||
@@ -146,7 +146,7 @@
|
||||
add_library(VkLayer_utils STATIC vk_layer_config.cpp vk_layer_extension_utils.cpp vk_layer_utils.cpp)
|
||||
else()
|
||||
add_library(VkLayer_utils SHARED vk_layer_config.cpp vk_layer_extension_utils.cpp vk_layer_utils.cpp)
|
||||
- install(TARGETS VkLayer_utils DESTINATION ${PROJECT_BINARY_DIR}/install_staging)
|
||||
+ install(TARGETS VkLayer_utils DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
||||
endif()
|
||||
|
||||
add_vk_layer(core_validation core_validation.cpp vk_layer_table.cpp vk_safe_struct.cpp descriptor_sets.cpp)
|
||||
|
||||
--- a/tests/layers/CMakeLists.txt
|
||||
+++ b/tests/layers/CMakeLists.txt
|
||||
@@ -50,7 +50,7 @@
|
||||
add_library(VkLayer_${target} SHARED ${ARGN})
|
||||
add_dependencies(VkLayer_${target} generate_vk_layer_helpers)
|
||||
set_target_properties(VkLayer_${target} PROPERTIES LINK_FLAGS "-Wl,-Bsymbolic")
|
||||
- install(TARGETS VkLayer_${target} DESTINATION ${PROJECT_BINARY_DIR}/install_staging)
|
||||
+ install(TARGETS VkLayer_${target} DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
||||
endmacro()
|
||||
endif()
|
||||
|
||||
8
0005-loader-Add-install-rule.patch
Normal file
8
0005-loader-Add-install-rule.patch
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
--- a/loader/CMakeLists.txt
|
||||
+++ b/loader/CMakeLists.txt
|
||||
@@ -86,4 +86,5 @@
|
||||
add_library(vulkan SHARED ${LOADER_SRCS})
|
||||
set_target_properties(vulkan PROPERTIES SOVERSION "1" VERSION "1.0.26")
|
||||
target_link_libraries(vulkan -ldl -lpthread -lm)
|
||||
+ install(TARGETS vulkan DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
||||
endif()
|
||||
51
0007-demos-Read-from-installed-paths.patch
Normal file
51
0007-demos-Read-from-installed-paths.patch
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
--- a/demos/cube.c
|
||||
+++ b/demos/cube.c
|
||||
@@ -129,7 +129,7 @@
|
||||
int32_t tex_width, tex_height;
|
||||
};
|
||||
|
||||
-static char *tex_files[] = {"lunarg.ppm"};
|
||||
+static char *tex_files[] = {"/usr/share/vulkan/cube.ppm"};
|
||||
|
||||
static int validation_error = 0;
|
||||
|
||||
@@ -1536,7 +1536,7 @@
|
||||
void *vertShaderCode;
|
||||
size_t size;
|
||||
|
||||
- vertShaderCode = demo_read_spv("cube-vert.spv", &size);
|
||||
+ vertShaderCode = demo_read_spv("/usr/share/vulkan/cube-vert.spv", &size);
|
||||
|
||||
demo->vert_shader_module =
|
||||
demo_prepare_shader_module(demo, vertShaderCode, size);
|
||||
@@ -1561,7 +1561,7 @@
|
||||
void *fragShaderCode;
|
||||
size_t size;
|
||||
|
||||
- fragShaderCode = demo_read_spv("cube-frag.spv", &size);
|
||||
+ fragShaderCode = demo_read_spv("/usr/share/vulkan/cube-frag.spv", &size);
|
||||
|
||||
demo->frag_shader_module =
|
||||
demo_prepare_shader_module(demo, fragShaderCode, size);
|
||||
|
||||
--- a/demos/tri.c
|
||||
+++ b/demos/tri.c
|
||||
@@ -1302,7 +1302,7 @@
|
||||
void *vertShaderCode;
|
||||
size_t size = 0;
|
||||
|
||||
- vertShaderCode = demo_read_spv("tri-vert.spv", &size);
|
||||
+ vertShaderCode = demo_read_spv("/usr/share/vulkan/tri-vert.spv", &size);
|
||||
|
||||
demo->vert_shader_module =
|
||||
demo_prepare_shader_module(demo, vertShaderCode, size);
|
||||
@@ -1327,7 +1327,7 @@
|
||||
void *fragShaderCode;
|
||||
size_t size;
|
||||
|
||||
- fragShaderCode = demo_read_spv("tri-frag.spv", &size);
|
||||
+ fragShaderCode = demo_read_spv("/usr/share/vulkan/tri-frag.spv", &size);
|
||||
|
||||
demo->frag_shader_module =
|
||||
demo_prepare_shader_module(demo, fragShaderCode, size);
|
||||
|
||||
29
0008-demos-Don-t-build-tri-or-cube.patch
Normal file
29
0008-demos-Don-t-build-tri-or-cube.patch
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
--- a/demos/CMakeLists.txt
|
||||
+++ b/demos/CMakeLists.txt
|
||||
@@ -115,26 +115,3 @@ endif()
|
||||
add_executable(vulkaninfo vulkaninfo.c)
|
||||
target_link_libraries(vulkaninfo ${LIBRARIES})
|
||||
|
||||
-if(UNIX)
|
||||
- add_executable(tri tri.c ${CMAKE_BINARY_DIR}/demos/tri-vert.spv ${CMAKE_BINARY_DIR}/demos/tri-frag.spv)
|
||||
-else()
|
||||
- add_executable(tri WIN32 tri.c ${CMAKE_BINARY_DIR}/demos/tri-vert.spv ${CMAKE_BINARY_DIR}/demos/tri-frag.spv)
|
||||
-endif()
|
||||
-target_link_libraries(tri ${LIBRARIES})
|
||||
-
|
||||
-if(NOT WIN32)
|
||||
- add_executable(cube cube.c ${CMAKE_BINARY_DIR}/demos/cube-vert.spv ${CMAKE_BINARY_DIR}/demos/cube-frag.spv)
|
||||
- target_link_libraries(cube ${LIBRARIES})
|
||||
-else()
|
||||
- if (CMAKE_CL_64)
|
||||
- set (LIB_DIR "Win64")
|
||||
- else()
|
||||
- set (LIB_DIR "Win32")
|
||||
- endif()
|
||||
-
|
||||
- add_executable(cube WIN32 cube.c ${CMAKE_BINARY_DIR}/demos/cube-vert.spv ${CMAKE_BINARY_DIR}/demos/cube-frag.spv)
|
||||
- target_link_libraries(cube ${LIBRARIES} )
|
||||
-endif()
|
||||
-
|
||||
-add_subdirectory(smoke)
|
||||
-
|
||||
9
demos-add-install-rule.patch
Normal file
9
demos-add-install-rule.patch
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
Description: Add an install rule for vulkaninfo
|
||||
--- a/demos/CMakeLists.txt
|
||||
+++ b/demos/CMakeLists.txt
|
||||
@@ -114,4 +114,5 @@ endif()
|
||||
|
||||
add_executable(vulkaninfo vulkaninfo.c)
|
||||
target_link_libraries(vulkaninfo ${LIBRARIES})
|
||||
+install(TARGETS vulkaninfo RUNTIME DESTINATION /usr/bin)
|
||||
|
||||
4
sources
4
sources
|
|
@ -0,0 +1,4 @@
|
|||
eed9e175ef87f11f0927aaf52318451a SPIRV-Headers-33d41376d378761ed3a4c791fc4b647761897f26.tar.gz
|
||||
c0ac4b38f6349d3a05ef39775f1dfdfe SPIRV-Tools-860030feab94360b9bf64cf486b44cffd62bdea8.tar.gz
|
||||
3426ca99140481b81fb683f73a07f01a Vulkan-LoaderAndValidationLayers-sdk-1.0.26.0.tar.gz
|
||||
370f7ac1f97cb424e9d5d1341e5ecf60 glslang-cfd7ce87cd10191c3d5afec077865c7c6dc9dd77.tar.gz
|
||||
235
vulkan.spec
Normal file
235
vulkan.spec
Normal file
|
|
@ -0,0 +1,235 @@
|
|||
%global use_git 0
|
||||
%global use_layers 1
|
||||
|
||||
%global commit fbb866778e513752444f1bfd6a3fea3e3f4158b1
|
||||
%global shortcommit %(c=%{commit}; echo ${c:0:7})
|
||||
%global srcname Vulkan-LoaderAndValidationLayers
|
||||
|
||||
%if 0%{?use_layers}
|
||||
%global commit1 cfd7ce87cd10191c3d5afec077865c7c6dc9dd77
|
||||
%global srcname1 glslang
|
||||
|
||||
%global commit2 860030feab94360b9bf64cf486b44cffd62bdea8
|
||||
%global srcname2 SPIRV-Tools
|
||||
|
||||
%global commit3 33d41376d378761ed3a4c791fc4b647761897f26
|
||||
%global srcname3 SPIRV-Headers
|
||||
%endif
|
||||
|
||||
Name: vulkan
|
||||
Version: 1.0.26.0
|
||||
%if 0%{?use_git}
|
||||
Release: 0.6.git%{shortcommit}%{?dist}
|
||||
%else
|
||||
Release: 3%{?dist}
|
||||
%endif
|
||||
Summary: Vulkan loader and validation layers
|
||||
|
||||
License: ASL 2.0
|
||||
URL: https://github.com/KhronosGroup
|
||||
|
||||
%if 0%{?use_git}
|
||||
Source0: %url/%{srcname}/archive/%{commit}.tar.gz#/%{srcname}-%{commit}.tar.gz
|
||||
%else
|
||||
Source0: %url/%{srcname}/archive/sdk-%{version}.tar.gz#/%{srcname}-sdk-%{version}.tar.gz
|
||||
%endif
|
||||
%if 0%{?use_layers}
|
||||
Source1: %url/%{srcname1}/archive/%{commit1}.tar.gz#/%{srcname1}-%{commit1}.tar.gz
|
||||
Source2: %url/%{srcname2}/archive/%{commit2}.tar.gz#/%{srcname2}-%{commit2}.tar.gz
|
||||
Source3: %url/%{srcname3}/archive/%{commit3}.tar.gz#/%{srcname3}-%{commit3}.tar.gz
|
||||
%else
|
||||
Source4: https://raw.githubusercontent.com/KhronosGroup/glslang/master/SPIRV/spirv.hpp
|
||||
%endif
|
||||
# All patches taken from ajax's repo
|
||||
# https://github.com/nwnk/Vulkan-LoaderAndValidationLayers/tree/sdk-1.0.3-fedora
|
||||
Patch0: 0003-layers-Don-t-set-an-rpath.patch
|
||||
Patch1: 0004-layers-Install-to-CMAKE_INSTALL_LIBDIR.patch
|
||||
Patch2: 0005-loader-Add-install-rule.patch
|
||||
Patch3: 0007-demos-Read-from-installed-paths.patch
|
||||
Patch4: 0008-demos-Don-t-build-tri-or-cube.patch
|
||||
Patch5: demos-add-install-rule.patch
|
||||
|
||||
|
||||
BuildRequires: gcc
|
||||
BuildRequires: gcc-c++
|
||||
BuildRequires: bison
|
||||
BuildRequires: cmake
|
||||
BuildRequires: libX11-devel
|
||||
BuildRequires: libxcb-devel
|
||||
BuildRequires: libpciaccess-devel
|
||||
BuildRequires: python3
|
||||
BuildRequires: systemd-devel
|
||||
BuildRequires: /usr/bin/chrpath
|
||||
|
||||
Requires: vulkan-filesystem
|
||||
|
||||
%description
|
||||
Vulkan is a new generation graphics and compute API that provides
|
||||
high-efficiency, cross-platform access to modern GPUs used in a wide variety of
|
||||
devices from PCs and consoles to mobile phones and embedded platforms.
|
||||
|
||||
This package contains the reference ICD loader and validation layers for
|
||||
Vulkan.
|
||||
|
||||
%package devel
|
||||
Summary: Vulkan development package
|
||||
Requires: %{name}%{?_isa} = %{version}-%{release}
|
||||
|
||||
%description devel
|
||||
Development headers for Vulkan applications.
|
||||
|
||||
%package filesystem
|
||||
Summary: Vulkan filesystem package
|
||||
BuildArch: noarch
|
||||
|
||||
%description filesystem
|
||||
Filesystem for Vulkan.
|
||||
|
||||
%prep
|
||||
%if 0%{?use_git}
|
||||
%autosetup -p1 -n %{srcname}-%{commit}
|
||||
%else
|
||||
%autosetup -p1 -n %{srcname}-sdk-%{version}
|
||||
%endif
|
||||
%if 0%{?use_layers}
|
||||
mkdir -p build/ external/glslang/build/install external/spirv-tools/build/ external/spirv-tools/external/spirv-headers
|
||||
tar -xf %{SOURCE1} -C external/glslang --strip 1
|
||||
tar -xf %{SOURCE2} -C external/spirv-tools --strip 1
|
||||
tar -xf %{SOURCE3} -C external/spirv-tools/external/spirv-headers --strip 1
|
||||
# fix spurious-executable-perm
|
||||
chmod 0644 README.md
|
||||
chmod 0644 external/glslang/SPIRV/spirv.hpp
|
||||
%else
|
||||
mkdir -p build/
|
||||
cp %{SOURCE4} .
|
||||
%endif
|
||||
# fix wrong-script-end-of-line-encoding
|
||||
sed -i 's/\r//' README.md
|
||||
|
||||
# sigh inttypes
|
||||
sed -i 's/inttypes.h/cinttypes/' layers/*.{cpp,h} *.py
|
||||
|
||||
%build
|
||||
%if 0%{?use_layers}
|
||||
pushd external/glslang/build/
|
||||
CFLAGS="$RPM_OPT_FLAGS" ; export CFLAGS ;
|
||||
CXXFLAGS="$RPM_OPT_FLAGS" ; export CXXFLAGS ;
|
||||
LDFLAGS="$RPM_LD_FLAGS" ; export LDFLAGS ;
|
||||
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON ..
|
||||
%make_build
|
||||
make install
|
||||
popd
|
||||
pushd external/spirv-tools/build/
|
||||
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON ..
|
||||
%make_build
|
||||
popd
|
||||
%endif
|
||||
pushd build/
|
||||
%cmake -DCMAKE_INSTALL_PREFIX=%{_prefix} -DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_SKIP_INSTALL_RPATH:BOOL=yes -DCMAKE_SKIP_RPATH:BOOL=yes \
|
||||
-DBUILD_VKJSON=OFF \
|
||||
%if 0%{?use_layers}
|
||||
..
|
||||
%else
|
||||
-DGLSLANG_SPIRV_INCLUDE_DIR=./ -DBUILD_TESTS=OFF -DBUILD_LAYERS=OFF ..
|
||||
%endif
|
||||
%make_build
|
||||
popd
|
||||
|
||||
%install
|
||||
pushd build/
|
||||
%{make_install}
|
||||
popd
|
||||
|
||||
mkdir -p %{buildroot}%{_includedir}
|
||||
%if 0%{?use_layers}
|
||||
mkdir -p %{buildroot}%{_datadir}/vulkan/{explicit_layer,implicit_layer}.d
|
||||
|
||||
for i in layers/linux/*.json ; do
|
||||
sed 's@./@@' $i > %{buildroot}%{_datadir}/vulkan/explicit_layer.d/$(basename $i)
|
||||
done
|
||||
|
||||
# bleh
|
||||
# ajax: the one implicit layer that the loader package builds isn't actually useful
|
||||
# ajax: and the loop above doesn't distinguish between explicit and implicit layers
|
||||
# ajax: so it puts the implicit layer's json into the explicit dir, so the rm is just to remove it.
|
||||
# ajax: all of which should have a proper install rule upstream...
|
||||
# ajax: but doesn't yet
|
||||
rm -f %{buildroot}%{_datadir}/vulkan/explicit_layer.d/*implicit*
|
||||
%endif
|
||||
# remove RPATH
|
||||
chrpath -d %{buildroot}%{_bindir}/vulkaninfo
|
||||
|
||||
|
||||
cp -ai include/vulkan %{buildroot}%{_includedir}
|
||||
|
||||
mkdir -p %{buildroot}%{_sysconfdir}/vulkan/icd.d
|
||||
|
||||
%post -p /sbin/ldconfig
|
||||
%postun -p /sbin/ldconfig
|
||||
|
||||
%files
|
||||
%license LICENSE.txt
|
||||
%doc README.md
|
||||
%{_bindir}/vulkaninfo
|
||||
%if 0%{?use_layers}
|
||||
%{_datadir}/vulkan/explicit_layer.d/*.json
|
||||
#{_datadir}/vulkan/implicit_layer.d/*.json
|
||||
%{_libdir}/libVkLayer_*.so
|
||||
%endif
|
||||
%{_libdir}/lib%{name}.so.*
|
||||
|
||||
%files devel
|
||||
%{_includedir}/%{name}/
|
||||
%{_libdir}/lib%{name}.so
|
||||
|
||||
%files filesystem
|
||||
%dir %{_sysconfdir}/vulkan
|
||||
%dir %{_sysconfdir}/vulkan/icd.d
|
||||
%if 0%{?use_layers}
|
||||
%dir %{_datadir}/%{name}
|
||||
%dir %{_datadir}/%{name}/explicit_layer.d
|
||||
%dir %{_datadir}/%{name}/implicit_layer.d
|
||||
%endif
|
||||
|
||||
%changelog
|
||||
* Tue Sep 27 2016 Leigh Scott <leigh123linux@googlemail.com> - 1.0.26.0-3
|
||||
- Move unversioned libraries
|
||||
- Disable vkjson build
|
||||
- Fix license tag
|
||||
|
||||
* Sun Sep 11 2016 Leigh Scott <leigh123linux@googlemail.com> - 1.0.26.0-2
|
||||
- Make layers conditional.
|
||||
|
||||
* Sun Sep 11 2016 Leigh Scott <leigh123linux@googlemail.com> - 1.0.26.0-1
|
||||
- Update to 1.0.26.0 release
|
||||
|
||||
* Thu Sep 08 2016 Leigh Scott <leigh123linux@googlemail.com> - 1.0.26.0-0.3.gitfbb8667
|
||||
- Clean up
|
||||
|
||||
* Thu Sep 08 2016 Leigh Scott <leigh123linux@googlemail.com> - 1.0.26.0-0.2.gitfbb8667
|
||||
- Change build requires python3
|
||||
- Use release for cmake
|
||||
- Make build verbose
|
||||
|
||||
* Wed Sep 07 2016 Leigh Scott <leigh123linux@googlemail.com> - 1.0.26.0-0.1.gitfbb8667
|
||||
- Update to latest git
|
||||
|
||||
* Tue Feb 16 2016 Igor Gnatenko <i.gnatenko.brain@gmail.com> - 1.0.3-0.1.git1affe90
|
||||
- Add ldconfig in post/postun
|
||||
- Use upstream tarball from commit + patches
|
||||
- Fix versioning. In fact it was never released
|
||||
- Fixup mixing of spaces/tabs
|
||||
- Remove rpath from vulkaninfo
|
||||
- Make filesystem subpkg noarch (it is really noarch)
|
||||
- BuildRequire gcc and gcc-c++ explicitly
|
||||
- Require main pkg with isa tag
|
||||
- Fix perms and perm of README.md
|
||||
- Use %%license tag
|
||||
|
||||
* Tue Feb 16 2016 Adam Jackson <ajax@redhat.com> - 1.0.3-0
|
||||
- Update loader to not build cube or tri. Drop bundled LunarGLASS and llvm
|
||||
since they're only needed for those demos.
|
||||
|
||||
* Tue Feb 16 2016 Adam Jackson <ajax@redhat.com> - 1.0.3-0
|
||||
- Initial packaging
|
||||
Loading…
Add table
Add a link
Reference in a new issue