From 2d1db966084d73dd36c3d5f0297eb071357aff49190964aee5412533b990e3ff Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Wed, 19 Aug 2020 11:28:33 +0000 Subject: [PATCH] - Produce and install support header files [boo#1175024] OBS-URL: https://build.opensuse.org/package/show/X11:Wayland/vulkan-validationlayers?expand=0&rev=57 --- ver.diff | 27 ++++++++++++++++++++ vulkan-validationlayers.changes | 5 ++++ vulkan-validationlayers.spec | 45 ++++++++++++++++++++++++++++----- 3 files changed, 71 insertions(+), 6 deletions(-) create mode 100644 ver.diff diff --git a/ver.diff b/ver.diff new file mode 100644 index 0000000..5f42800 --- /dev/null +++ b/ver.diff @@ -0,0 +1,27 @@ +From: Jan Engelhardt +Date: 2020-08-19 13:21:33.156157310 +0200 + +We do not want static archives in openSUSE, so need to turn on SHARED mode. +As a result, a version needs to be added. +--- + CMakeLists.txt | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +Index: Vulkan-ValidationLayers-1.2.148/CMakeLists.txt +=================================================================== +--- Vulkan-ValidationLayers-1.2.148.orig/CMakeLists.txt ++++ Vulkan-ValidationLayers-1.2.148/CMakeLists.txt +@@ -320,11 +320,12 @@ set(SCRIPTS_DIR "${PROJECT_SOURCE_DIR}/s + # files directly in layers. + + add_library(VkLayer_utils +- STATIC ++ SHARED + layers/vk_layer_config.cpp + layers/vk_layer_extension_utils.cpp + layers/vk_layer_utils.cpp + layers/vk_format_utils.cpp) ++set_target_properties(VkLayer_utils PROPERTIES OUTPUT_NAME "VkLayer_utils-@PACKAGE_VERSION@") + target_link_libraries(VkLayer_utils PUBLIC Vulkan::Headers) + if(WIN32) + target_compile_definitions(VkLayer_utils PUBLIC _CRT_SECURE_NO_WARNINGS) diff --git a/vulkan-validationlayers.changes b/vulkan-validationlayers.changes index 0989816..23f08c4 100644 --- a/vulkan-validationlayers.changes +++ b/vulkan-validationlayers.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Wed Aug 19 11:24:44 UTC 2020 - Jan Engelhardt + +- Produce and install support header files [boo#1175024] + ------------------------------------------------------------------- Sun Aug 9 10:10:53 UTC 2020 - Jan Engelhardt diff --git a/vulkan-validationlayers.spec b/vulkan-validationlayers.spec index 64629f8..72e8453 100644 --- a/vulkan-validationlayers.spec +++ b/vulkan-validationlayers.spec @@ -19,6 +19,7 @@ Name: vulkan-validationlayers Version: 1.2.148 Release: 0 +%define lname libVkLayer_utils-1_2_148 Summary: Validation layers for Vulkan License: Apache-2.0 Group: Development/Tools/Other @@ -26,6 +27,7 @@ URL: https://github.com/KhronosGroup/Vulkan-ValidationLayers Source: https://github.com/KhronosGroup/Vulkan-ValidationLayers/archive/v%version.tar.gz Source9: %name-rpmlintrc +Patch1: ver.diff BuildRequires: cmake >= 3.4 BuildRequires: gcc-c++ >= 4.8 BuildRequires: glslang-devel >= 8.13.3727 @@ -41,28 +43,59 @@ Conflicts: vulkan < 1.1 Obsoletes: vulkan < 1.1 %description -Vulkan is a 3D graphics and compute API providing cross-platform -access to modern GPUs with low overhead and targeting realtime -graphics applications such as games and interactive media. +Vulkan is a 3D graphics and compute API. This package contains the Khronos official Vulkan validation layers. +%package -n %lname +Summary: Vulkan validation layer utility library +Group: System/Libraries + +%description -n %lname +Vulkan is a 3D graphics and compute API. + +This package contains a utility library. + +%package devel +Summary: Vulkan validation layer support files +Group: Development/Libraries/C and C++ +Requires: %lname = %version + +%description devel +Vulkan is a 3D graphics and compute API. + +This package contains support files for the VkLayer utility library. + %prep %autosetup -n Vulkan-ValidationLayers-%version +perl -i -pe 's{\@PACKAGE_VERSION\@}{%version}' CMakeLists.txt %build %limit_build -m 2000 -%cmake -DGLSLANG_INSTALL_DIR="%_bindir" -DSPIRV_HEADERS_INSTALL_DIR="%_includedir" +%cmake -DGLSLANG_INSTALL_DIR="%_bindir" \ + -DSPIRV_HEADERS_INSTALL_DIR="%_includedir" \ + -DBUILD_LAYER_SUPPORT_FILES=ON make %{?_smp_mflags} %install %cmake_install # no header files -rm -f "%buildroot/%_libdir"/*.a +#rm -f "%buildroot/%_libdir"/*.a +ln -sv libVkLayer_utils-%version.so "%buildroot/%_libdir/libVkLayer_utils.so" + +%post -n %lname -p /sbin/ldconfig +%postun -n %lname -p /sbin/ldconfig %files %license LICENSE.txt -%_libdir/libVkLayer*.so +%_libdir/libVkLayer_khr*.so %_datadir/vulkan/ +%files -n %lname +%_libdir/libVkLayer_utils* + +%files devel +%_includedir/* +%_libdir/libVkLayer_utils.so + %changelog