diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..79e7775 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +SOURCES/SPIRV-Headers-c470b68225a04965bf87d35e143ae92f831e8110.tar.gz +SOURCES/SPIRV-Tools-37422e9dba1a3a8cb8028b779dd546d43add6ef8.tar.gz +SOURCES/Vulkan-LoaderAndValidationLayers-sdk-1.0.39.1.tar.gz +SOURCES/glslang-807a0d9e2f4e176f75d62ac3c179c81800ec2608.tar.gz diff --git a/.vulkan.metadata b/.vulkan.metadata new file mode 100644 index 0000000..cbc41cd --- /dev/null +++ b/.vulkan.metadata @@ -0,0 +1,4 @@ +a8a9d1aa6bb7dd64c59da85f0490cc934919872a SOURCES/SPIRV-Headers-c470b68225a04965bf87d35e143ae92f831e8110.tar.gz +1a04d2d9b8c4e291c9bf6053ef66e24997ad012d SOURCES/SPIRV-Tools-37422e9dba1a3a8cb8028b779dd546d43add6ef8.tar.gz +0e2e99d0989413f9a8d6b6e69c11dc0b68b71347 SOURCES/Vulkan-LoaderAndValidationLayers-sdk-1.0.39.1.tar.gz +4d60db54f2f38ae4c7b2a22f18ab47a5f1d5f3f8 SOURCES/glslang-807a0d9e2f4e176f75d62ac3c179c81800ec2608.tar.gz diff --git a/README.md b/README.md deleted file mode 100644 index 98f42b4..0000000 --- a/README.md +++ /dev/null @@ -1,4 +0,0 @@ -The master branch has no content - -Look at the c7 branch if you are working with CentOS-7, or the c4/c5/c6 branch for CentOS-4, 5 or 6 -If you find this file in a distro specific branch, it means that no content has been checked in yet diff --git a/SOURCES/0003-layers-Don-t-set-an-rpath.patch b/SOURCES/0003-layers-Don-t-set-an-rpath.patch new file mode 100644 index 0000000..d914827 --- /dev/null +++ b/SOURCES/0003-layers-Don-t-set-an-rpath.patch @@ -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}) + + macro(run_vk_xml_generate dependency output) + add_custom_command(OUTPUT ${output} + diff --git a/SOURCES/0008-demos-Don-t-build-tri-or-cube.patch b/SOURCES/0008-demos-Don-t-build-tri-or-cube.patch new file mode 100644 index 0000000..6d36ce1 --- /dev/null +++ b/SOURCES/0008-demos-Don-t-build-tri-or-cube.patch @@ -0,0 +1,98 @@ +--- a/demos/CMakeLists.txt ++++ b/demos/CMakeLists.txt +@@ -58,48 +58,7 @@ + set (LIBRARIES "${API_LOWERCASE}-${MAJOR}") + elseif(UNIX) + set (LIBRARIES "${API_LOWERCASE}") +-else() +-endif() +- +-if(WIN32) +- # For Windows, since 32-bit and 64-bit items can co-exist, we build each in its own build directory. +- # 32-bit target data goes in build32, and 64-bit target data goes into build. So, include/link the +- # appropriate data at build time. +- if (CMAKE_CL_64) +- set (BUILDTGT_DIR build) +- else () +- set (BUILDTGT_DIR build32) +- endif() +- +- # Use static MSVCRT libraries +- foreach(configuration in CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_MINSIZEREL CMAKE_C_FLAGS_RELEASE CMAKE_C_FLAGS_RELWITHDEBINFO +- CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELEASE CMAKE_CXX_FLAGS_RELWITHDEBINFO) +- if(${configuration} MATCHES "/MD") +- string(REGEX REPLACE "/MD" "/MT" ${configuration} "${${configuration}}") +- endif() +- endforeach() +- +- add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/demos/cube-vert.spv +- COMMAND ${GLSLANG_VALIDATOR} -s -V -o ${CMAKE_BINARY_DIR}/demos/cube-vert.spv ${PROJECT_SOURCE_DIR}/demos/cube.vert +- DEPENDS cube.vert ${GLSLANG_VALIDATOR} +- ) +- add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/demos/cube-frag.spv +- COMMAND ${GLSLANG_VALIDATOR} -s -V -o ${CMAKE_BINARY_DIR}/demos/cube-frag.spv ${PROJECT_SOURCE_DIR}/demos/cube.frag +- DEPENDS cube.frag ${GLSLANG_VALIDATOR} +- ) +- file(COPY cube.vcxproj.user DESTINATION ${CMAKE_BINARY_DIR}/demos) +- file(COPY vulkaninfo.vcxproj.user DESTINATION ${CMAKE_BINARY_DIR}/demos) +-else() +- if (${CMAKE_SYSTEM_PROCESSOR} STREQUAL ${CMAKE_HOST_SYSTEM_PROCESSOR}) +- add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/demos/cube-vert.spv +- COMMAND ${GLSLANG_VALIDATOR} -s -V -o cube-vert.spv ${PROJECT_SOURCE_DIR}/demos/cube.vert +- DEPENDS cube.vert ${GLSLANG_VALIDATOR} +- ) +- add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/demos/cube-frag.spv +- COMMAND ${GLSLANG_VALIDATOR} -s -V -o cube-frag.spv ${PROJECT_SOURCE_DIR}/demos/cube.frag +- DEPENDS cube.frag ${GLSLANG_VALIDATOR} +- ) +- endif() ++else() + endif() + + if(WIN32) +@@ -114,44 +73,6 @@ + add_executable(${API_LOWERCASE}info vulkaninfo.c) + target_link_libraries(${API_LOWERCASE}info ${LIBRARIES}) + +-if(NOT WIN32) +- if (${CMAKE_SYSTEM_PROCESSOR} STREQUAL ${CMAKE_HOST_SYSTEM_PROCESSOR}) +- add_executable(cube cube.c ${CMAKE_BINARY_DIR}/demos/cube-vert.spv ${CMAKE_BINARY_DIR}/demos/cube-frag.spv) +- target_link_libraries(cube ${LIBRARIES}) +- endif() +-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() +- +-if(NOT WIN32) +- if (${CMAKE_SYSTEM_PROCESSOR} STREQUAL ${CMAKE_HOST_SYSTEM_PROCESSOR}) +- add_executable(cubepp cube.cpp ${CMAKE_BINARY_DIR}/demos/cube-vert.spv ${CMAKE_BINARY_DIR}/demos/cube-frag.spv) +- target_link_libraries(cubepp ${LIBRARIES}) +- endif() +-else() +- if (CMAKE_CL_64) +- set (LIB_DIR "Win64") +- else() +- set (LIB_DIR "Win32") +- endif() +- +- add_executable(cubepp WIN32 cube.cpp ${CMAKE_BINARY_DIR}/demos/cube-vert.spv ${CMAKE_BINARY_DIR}/demos/cube-frag.spv) +- target_link_libraries(cubepp ${LIBRARIES}) +-endif() +- +-if ((${CMAKE_SYSTEM_PROCESSOR} STREQUAL ${CMAKE_HOST_SYSTEM_PROCESSOR})) +- if ((DEMOS_WSI_SELECTION STREQUAL "XCB") OR (DEMOS_WSI_SELECTION STREQUAL "WAYLAND") OR WIN32 OR (CMAKE_SYSTEM_NAME STREQUAL "Android")) +- add_subdirectory(smoke) +- endif() +-endif() +- + if(UNIX) + install(TARGETS ${API_LOWERCASE}info DESTINATION ${CMAKE_INSTALL_BINDIR}) + endif() + diff --git a/SOURCES/hacked-python2.patch b/SOURCES/hacked-python2.patch new file mode 100644 index 0000000..1a54ffa --- /dev/null +++ b/SOURCES/hacked-python2.patch @@ -0,0 +1,20 @@ +diff -up Vulkan-LoaderAndValidationLayers-sdk-1.0.39.1/CMakeLists.txt.hackedpy Vulkan-LoaderAndValidationLayers-sdk-1.0.39.1/CMakeLists.txt +--- Vulkan-LoaderAndValidationLayers-sdk-1.0.39.1/CMakeLists.txt.hackedpy 2017-02-21 12:49:19.461906550 +1000 ++++ Vulkan-LoaderAndValidationLayers-sdk-1.0.39.1/CMakeLists.txt 2017-02-21 12:49:27.379949182 +1000 +@@ -13,7 +13,6 @@ set(MAJOR "1") + string(TOLOWER ${API_NAME} API_LOWERCASE) + + set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake") +-find_package(PythonInterp 3 REQUIRED) + + if(CMAKE_SYSTEM_NAME STREQUAL "Linux") + include(FindPkgConfig) +diff -up Vulkan-LoaderAndValidationLayers-sdk-1.0.39.1/scripts/lvl_genvk.py.hackedpy Vulkan-LoaderAndValidationLayers-sdk-1.0.39.1/scripts/lvl_genvk.py +--- Vulkan-LoaderAndValidationLayers-sdk-1.0.39.1/scripts/lvl_genvk.py.hackedpy 2017-02-21 13:15:37.565419937 +1000 ++++ Vulkan-LoaderAndValidationLayers-sdk-1.0.39.1/scripts/lvl_genvk.py 2017-02-21 13:15:48.423478704 +1000 +@@ -1,4 +1,4 @@ +-#!/usr/bin/python3 ++#!/usr/bin/python + # + # Copyright (c) 2013-2017 The Khronos Group Inc. + # Copyright (c) 2015-2017 LunarG, Inc. diff --git a/SPECS/vulkan.spec b/SPECS/vulkan.spec new file mode 100644 index 0000000..f5e6aef --- /dev/null +++ b/SPECS/vulkan.spec @@ -0,0 +1,264 @@ +%global use_git 0 +%global use_layers 1 + +%global commit d4cd34fd49caa759cf01cafa5fa271401b17c3b9 +%global shortcommit %(c=%{commit}; echo ${c:0:7}) +%global srcname Vulkan-LoaderAndValidationLayers + +%if 0%{?use_layers} +%global commit1 807a0d9e2f4e176f75d62ac3c179c81800ec2608 +%global srcname1 glslang + +%global commit2 37422e9dba1a3a8cb8028b779dd546d43add6ef8 +%global srcname2 SPIRV-Tools + +%global commit3 c470b68225a04965bf87d35e143ae92f831e8110 +%global srcname3 SPIRV-Headers +%endif + +Name: vulkan +Version: 1.0.39.1 +%if 0%{?use_git} +Release: 0.2.git%{shortcommit}%{?dist} +%else +Release: 2%{?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: 0008-demos-Don-t-build-tri-or-cube.patch +Patch2: hacked-python2.patch + +BuildRequires: gcc +BuildRequires: gcc-c++ +BuildRequires: bison +BuildRequires: cmake +BuildRequires: /usr/bin/chrpath +BuildRequires: pkgconfig(libsystemd) +BuildRequires: pkgconfig(pciaccess) +%if 0%{?fedora} +BuildRequires: python3 +BuildRequires: pkgconfig(wayland-client) +BuildRequires: pkgconfig(wayland-cursor) +BuildRequires: pkgconfig(wayland-server) +BuildRequires: pkgconfig(wayland-egl) +%else +BuildRequires: python +%endif +BuildRequires: pkgconfig(x11) +BuildRequires: pkgconfig(xcb) +BuildRequires: pkgconfig(xrandr) + +Requires: vulkan-filesystem = %{version}-%{release} + +%if 0%{?fedora} +Recommends: mesa-vulkan-drivers +%endif + +%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 +chmod +x scripts/lvl_genvk.py +%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} + +%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 -DSPIRV_WERROR=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON .. +%make_build +popd +%endif +pushd build/ +%cmake -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_SKIP_INSTALL_RPATH:BOOL=yes \ + -DCMAKE_SKIP_RPATH:BOOL=yes \ + -DBUILD_VKJSON=OFF \ + -DCMAKE_INSTALL_SYSCONFDIR:PATH=%{_sysconfdir} \ + -DBUILD_WSI_MIR_SUPPORT=OFF \ +%if 0%{?rhel} + -DBUILD_WSI_WAYLAND_SUPPORT=OFF \ +%endif +%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 + +%if 0%{?use_layers} +mkdir -p %{buildroot}%{_datadir}/vulkan/implicit_layer.d +mv %{buildroot}%{_sysconfdir}/vulkan/explicit_layer.d/ %{buildroot}%{_datadir}/vulkan/ +%endif + +# remove RPATH +chrpath -d %{buildroot}%{_bindir}/vulkaninfo + +mkdir -p %{buildroot}%{_sysconfdir}/vulkan/icd.d + +%post -p /sbin/ldconfig +%postun -p /sbin/ldconfig + +%files +%license LICENSE.txt COPYRIGHT.txt +%doc README.md CONTRIBUTING.md +%{_bindir}/vulkaninfo +%if 0%{?use_layers} +%{_datadir}/vulkan/explicit_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 +* Sat Feb 11 2017 Fedora Release Engineering - 1.0.39.1-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild + +* Tue Jan 31 2017 Leigh Scott - 1.0.39.1-1 +- Update to 1.0.39.1 release + +* Tue Jan 24 2017 Leigh Scott - 1.0.39.0-1 +- Update to 1.0.39.0 release +- Add build requires libXrandr-devel + +* Fri Dec 16 2016 leigh scott - 1.0.37.0-1 +- Update to 1.0.37.0 release +- Disable Mir as it's lame ubuntu rubbish + +* Fri Dec 02 2016 leigh scott - 1.0.34.0-0.1.gitd4cd34f +- Update to latest git + +* Thu Dec 01 2016 leigh scott - 1.0.30.0-2 +- Fix VkLayer undefined symbol: util_GetExtensionProperties + +* Sat Oct 15 2016 Leigh Scott - 1.0.30.0-1 +- Update to 1.0.30.0 release + +* Mon Oct 10 2016 Leigh Scott - 1.0.26.0-4 +- Build with wayland support (rhbz 1383115) + +* Tue Sep 27 2016 Leigh Scott - 1.0.26.0-3 +- Move unversioned libraries +- Disable vkjson build +- Fix license tag + +* Sun Sep 11 2016 Leigh Scott - 1.0.26.0-2 +- Make layers conditional. + +* Sun Sep 11 2016 Leigh Scott - 1.0.26.0-1 +- Update to 1.0.26.0 release + +* Thu Sep 08 2016 Leigh Scott - 1.0.26.0-0.3.gitfbb8667 +- Clean up + +* Thu Sep 08 2016 Leigh Scott - 1.0.26.0-0.2.gitfbb8667 +- Change build requires python3 +- Use release for cmake +- Make build verbose + +* Wed Sep 07 2016 Leigh Scott - 1.0.26.0-0.1.gitfbb8667 +- Update to latest git + +* Tue Feb 16 2016 Igor Gnatenko - 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 - 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 - 1.0.3-0 +- Initial packaging