commit 481eb1cdca986bce251b7d85547a59e3d075b0a5 Author: Adam Samalik Date: Mon May 8 11:01:37 2023 +0200 import sources diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..87d84af --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/glslang-sdk-1.3.239.0.tar.gz diff --git a/0001-pkg-config-compatibility.patch b/0001-pkg-config-compatibility.patch new file mode 100644 index 0000000..6fdf576 --- /dev/null +++ b/0001-pkg-config-compatibility.patch @@ -0,0 +1,179 @@ +diff -up glslang-sdk-1.3.231.1/CMakeLists.txt.dma glslang-sdk-1.3.231.1/CMakeLists.txt +--- glslang-sdk-1.3.231.1/CMakeLists.txt.dma 2022-10-14 03:29:59.000000000 +1000 ++++ glslang-sdk-1.3.231.1/CMakeLists.txt 2022-11-09 14:47:04.538772188 +1000 +@@ -129,6 +129,13 @@ if(USE_CCACHE) + endif() + endif() + ++# using pkg-config to configure include paths and link libraries ++include(FindPkgConfig) ++pkg_check_modules(SPIRV_TOOLS REQUIRED SPIRV-Tools>=2019.2.1) ++if(BUILD_SHARED_LIBS) ++ pkg_check_modules(SPIRV_TOOLS_SHARED REQUIRED SPIRV-Tools-shared>=2019.2.1) ++endif(BUILD_SHARED_LIBS) ++ + if(ENABLE_CTEST) + include(CTest) + endif() +@@ -319,11 +326,7 @@ if(BUILD_EXTERNAL AND IS_DIRECTORY ${CMA + add_subdirectory(External) + endif() + +-if(NOT TARGET SPIRV-Tools-opt) +- set(ENABLE_OPT OFF) +-endif() +- +-if(ENABLE_OPT) ++if(${SPIRV_TOOLS_FOUND} EQUAL 1) + message(STATUS "optimizer enabled") + add_definitions(-DENABLE_OPT=1) + else() +diff -up glslang-sdk-1.3.231.1/External/CMakeLists.txt.dma glslang-sdk-1.3.231.1/External/CMakeLists.txt +--- glslang-sdk-1.3.231.1/External/CMakeLists.txt.dma 2022-10-14 03:29:59.000000000 +1000 ++++ glslang-sdk-1.3.231.1/External/CMakeLists.txt 2022-11-09 14:47:04.539772205 +1000 +@@ -68,10 +68,3 @@ if(BUILD_TESTING) + endif() + endif() + +-if(ENABLE_OPT AND NOT TARGET SPIRV-Tools-opt) +- if(IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/spirv-tools) +- set(SPIRV_SKIP_TESTS ON CACHE BOOL "Skip building SPIRV-Tools tests") +- add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/spirv-tools spirv-tools) +- endif() +-endif() +- +diff -up glslang-sdk-1.3.231.1/glslang/CMakeLists.txt.dma glslang-sdk-1.3.231.1/glslang/CMakeLists.txt +--- glslang-sdk-1.3.231.1/glslang/CMakeLists.txt.dma 2022-11-09 14:47:04.540772224 +1000 ++++ glslang-sdk-1.3.231.1/glslang/CMakeLists.txt 2022-11-09 14:48:06.844895906 +1000 +@@ -221,6 +221,8 @@ if(ENABLE_GLSLANG_INSTALL) + add_library(GenericCodeGen ALIAS glslang::GenericCodeGen) + endif() + ") ++ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/glslang.pc.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/pkgconfig/glslang.pc @ONLY) ++ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/pkgconfig/glslang.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) + install(FILES "${CMAKE_CURRENT_BINARY_DIR}/glslangTargets.cmake" DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake) + endif() + +diff -up glslang-sdk-1.3.231.1/glslang/glslang.pc.cmake.in.dma glslang-sdk-1.3.231.1/glslang/glslang.pc.cmake.in +--- glslang-sdk-1.3.231.1/glslang/glslang.pc.cmake.in.dma 2022-11-09 14:47:04.541772242 +1000 ++++ glslang-sdk-1.3.231.1/glslang/glslang.pc.cmake.in 2022-11-09 14:47:04.541772242 +1000 +@@ -0,0 +1,11 @@ ++ prefix=@CMAKE_INSTALL_PREFIX@ ++ exec_prefix=@CMAKE_INSTALL_PREFIX@ ++ libdir=${exec_prefix}/@CMAKE_INSTALL_LIBDIR@ ++ includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@ ++ ++ Name: @PROJECT_NAME@ ++ Description: OpenGL and OpenGL ES shader front end and validator ++ Requires: ++ Version: @VERSION@ ++ Libs: -L${libdir} -lglslang -lOSDependent -lHLSL -lOGLCompiler -lSPVRemapper ++ Cflags: -I${includedir} +\ No newline at end of file +diff -up glslang-sdk-1.3.231.1/SPIRV/CMakeLists.txt.dma glslang-sdk-1.3.231.1/SPIRV/CMakeLists.txt +--- glslang-sdk-1.3.231.1/SPIRV/CMakeLists.txt.dma 2022-10-14 03:29:59.000000000 +1000 ++++ glslang-sdk-1.3.231.1/SPIRV/CMakeLists.txt 2022-11-09 14:47:04.542772260 +1000 +@@ -78,6 +78,10 @@ target_include_directories(SPIRV PUBLIC + + glslang_add_build_info_dependency(SPIRV) + ++ ++set(SPIRV_NAME spirv) ++set(SPIRV_VERSION 1.3) ++ + if (ENABLE_SPVREMAPPER) + add_library(SPVRemapper ${LIB_TYPE} ${SPVREMAP_SOURCES} ${SPVREMAP_HEADERS}) + set_property(TARGET SPVRemapper PROPERTY FOLDER glslang) +@@ -91,15 +95,21 @@ if(WIN32 AND BUILD_SHARED_LIBS) + endif() + endif() + ++target_include_directories(SPIRV PUBLIC ${SPIRV_TOOLS_INCLUDE_DIRS}) ++target_compile_options(SPIRV PUBLIC ${SPIRV_TOOLS_CFLAGS_OTHER}) ++target_link_libraries(SPIRV ${SPIRV_TOOLS_LIBRARIES}) ++if(BUILD_SHARED_LIBS) ++ target_include_directories(SPIRV PUBLIC ${SPIRV_TOOLS_SHARED_INCLUDE_DIRS}) ++ target_compile_options(SPIRV PUBLIC ${SPIRV_TOOLS_SHARED_CFLAGS_OTHER}) ++ target_link_libraries(SPIRV ${SPIRV_TOOLS_SHARED_LIBRARIES}) ++endif(BUILD_SHARED_LIBS) ++ + if(ENABLE_OPT) + target_include_directories(SPIRV + PRIVATE ${spirv-tools_SOURCE_DIR}/include + PRIVATE ${spirv-tools_SOURCE_DIR}/source + ) +- target_link_libraries(SPIRV PRIVATE MachineIndependent SPIRV-Tools-opt) +- target_include_directories(SPIRV PUBLIC +- $ +- $) ++ target_link_libraries(SPIRV glslang) + else() + target_link_libraries(SPIRV PRIVATE MachineIndependent) + endif() +@@ -140,6 +150,9 @@ if(ENABLE_GLSLANG_INSTALL) + add_library(SPIRV ALIAS glslang::SPIRV) + ") + install(FILES "${CMAKE_CURRENT_BINARY_DIR}/SPIRVTargets.cmake" DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake) +- ++ # spirv.pc Configuration ++ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/spirv.pc.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/pkgconfig/spirv.pc @ONLY) ++ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/pkgconfig/spirv.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) ++ + install(FILES ${HEADERS} ${SPVREMAP_HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/glslang/SPIRV/) + endif() +diff -up glslang-sdk-1.3.231.1/SPIRV/spirv.pc.cmake.in.dma glslang-sdk-1.3.231.1/SPIRV/spirv.pc.cmake.in +--- glslang-sdk-1.3.231.1/SPIRV/spirv.pc.cmake.in.dma 2022-11-09 14:47:04.543772278 +1000 ++++ glslang-sdk-1.3.231.1/SPIRV/spirv.pc.cmake.in 2022-11-09 14:47:04.543772278 +1000 +@@ -0,0 +1,11 @@ ++ prefix=@CMAKE_INSTALL_PREFIX@ ++ exec_prefix=@CMAKE_INSTALL_PREFIX@ ++ libdir=${exec_prefix}/@CMAKE_INSTALL_LIBDIR@ ++ includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@ ++ ++ Name: @SPIRV_NAME@ ++ Description: SPIR-V is a binary intermediate language for representing graphical-shader stages and compute kernels for multiple Khronos APIs, including OpenCL, OpenGL, and Vulkan ++ Requires: ++ Version: @SPIRV_VERSION@ ++ Libs: -L${libdir} -lSPIRV ++ Cflags: -I${includedir} +\ No newline at end of file +diff -up glslang-sdk-1.3.231.1/SPIRV/SpvTools.cpp.dma glslang-sdk-1.3.231.1/SPIRV/SpvTools.cpp +--- glslang-sdk-1.3.231.1/SPIRV/SpvTools.cpp.dma 2022-10-14 03:29:59.000000000 +1000 ++++ glslang-sdk-1.3.231.1/SPIRV/SpvTools.cpp 2022-11-09 14:47:04.544772296 +1000 +@@ -43,7 +43,7 @@ + #include + + #include "SpvTools.h" +-#include "spirv-tools/optimizer.hpp" ++#include + + namespace glslang { + +diff -up glslang-sdk-1.3.231.1/StandAlone/CMakeLists.txt.dma glslang-sdk-1.3.231.1/StandAlone/CMakeLists.txt +--- glslang-sdk-1.3.231.1/StandAlone/CMakeLists.txt.dma 2022-11-09 14:46:48.996491875 +1000 ++++ glslang-sdk-1.3.231.1/StandAlone/CMakeLists.txt 2022-11-09 14:47:04.545772314 +1000 +@@ -72,6 +72,14 @@ if(ENABLE_SPVREMAPPER) + set(LIBRARIES ${LIBRARIES} SPVRemapper) + endif() + ++if(BUILD_SHARED_LIBS) ++ set(LIBRARIES ${LIBRARIES} ${SPIRV_TOOLS_SHARED_LIBRARIES}) ++ target_include_directories(glslangValidator PUBLIC ${SPIRV_TOOLS_SHARED_INCLUDE_DIRS}) ++else() ++ set(LIBRARIES ${LIBRARIES} ${SPIRV_TOOLS_LIBRARIES}) ++ target_include_directories(glslangValidator PUBLIC ${SPIRV_TOOLS_INCLUDE_DIRS}) ++endif(BUILD_SHARED_LIBS) ++ + if(WIN32) + set(LIBRARIES ${LIBRARIES} psapi) + elseif(UNIX) +@@ -81,9 +89,6 @@ elseif(UNIX) + endif() + + target_link_libraries(glslangValidator ${LIBRARIES}) +-target_include_directories(glslangValidator PUBLIC +- $ +- $) + + if(ENABLE_OPT) + target_include_directories(glslangValidator diff --git a/glslang-default-resource-limits_staticlib.patch b/glslang-default-resource-limits_staticlib.patch new file mode 100644 index 0000000..a60ad76 --- /dev/null +++ b/glslang-default-resource-limits_staticlib.patch @@ -0,0 +1,12 @@ +diff -up glslang-c9706bdda0ac22b9856f1aa8261e5b9e15cd20c5/StandAlone/CMakeLists.txt.dma glslang-c9706bdda0ac22b9856f1aa8261e5b9e15cd20c5/StandAlone/CMakeLists.txt +--- glslang-c9706bdda0ac22b9856f1aa8261e5b9e15cd20c5/StandAlone/CMakeLists.txt.dma 2021-11-23 17:38:10.022569320 +1000 ++++ glslang-c9706bdda0ac22b9856f1aa8261e5b9e15cd20c5/StandAlone/CMakeLists.txt 2021-11-23 17:38:19.087812070 +1000 +@@ -47,7 +47,7 @@ add_custom_command( + + #add_custom_target(glslangValidator DEPENDS ${GLSLANG_INTRINSIC_H}) + +-add_library(glslang-default-resource-limits ++add_library(glslang-default-resource-limits STATIC + ${CMAKE_CURRENT_SOURCE_DIR}/ResourceLimits.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/resource_limits_c.cpp) + set_property(TARGET glslang-default-resource-limits PROPERTY FOLDER glslang) diff --git a/glslang.spec b/glslang.spec new file mode 100644 index 0000000..3f9c076 --- /dev/null +++ b/glslang.spec @@ -0,0 +1,158 @@ +%global sdkver 1.3.239.0 + +Name: glslang +Version: 11.9.0 +Release: 4%{?dist} +Summary: OpenGL and OpenGL ES shader front end and validator + +License: BSD and GPLv3+ and ASL 2.0 +URL: https://github.com/KhronosGroup/%{name} +Source0: %url/archive/sdk-%{sdkver}.tar.gz#/%{name}-sdk-%{sdkver}.tar.gz +Patch1: glslang-default-resource-limits_staticlib.patch +# Patch to build against system spirv-tools +#Patch3: https://patch-diff.githubusercontent.com/raw/KhronosGroup/glslang/pull/1722.patch#/0001-pkg-config-compatibility.patch +Patch3: 0001-pkg-config-compatibility.patch + +BuildRequires: cmake +BuildRequires: gcc-c++ +BuildRequires: ninja-build +BuildRequires: python3 +BuildRequires: spirv-tools-devel + +%description +%{name} is the official reference compiler front end for the OpenGL +ES and OpenGL shading languages. It implements a strict +interpretation of the specifications for these languages. + +%package devel +Summary: Development files for %{name} +Requires: %{name}%{?_isa} = %{version}-%{release} + +%description devel +%{name} is the official reference compiler front end for the OpenGL +ES and OpenGL shading languages. It implements a strict +interpretation of the specifications for these languages. + +%prep +%autosetup -p1 -n %{name}-sdk-%{sdkver} +# Fix rpmlint warning on debuginfo +find . -name '*.h' -or -name '*.cpp' -or -name '*.hpp'| xargs chmod a-x + +%build +%__mkdir_p build +pushd build +%cmake -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_LIBDIR=%{_libdir} \ + -DCMAKE_SKIP_RPATH:BOOL=yes \ + -DBUILD_SHARED_LIBS=OFF \ + -GNinja .. +%{ninja_build} +popd + +%install +%{ninja_install} -C build + +# we don't want them in here +rm -rf %{buildroot}%{_includedir}/SPIRV + +# Install libglslang-default-resource-limits.a +install -pm 0644 build/StandAlone/libglslang-default-resource-limits.a %{buildroot}%{_libdir}/ + +%ifnarch s390x ppc64 +%check +pushd Test +./runtests localResults ../build/StandAlone/glslangValidator ../build/StandAlone/spirv-remap +popd +%endif + +%files +%doc README.md README-spirv-remap.txt +%{_bindir}/glslangValidator +%{_bindir}/spirv-remap + +%files devel +%{_includedir}/glslang/ +%{_libdir}/libHLSL.a +%{_libdir}/libOGLCompiler.a +%{_libdir}/libOSDependent.a +%{_libdir}/libGenericCodeGen.a +%{_libdir}/libMachineIndependent.a +%{_libdir}/libSPIRV.a +%{_libdir}/libSPVRemapper.a +%{_libdir}/libglslang.a +%{_libdir}/libglslang-default-resource-limits.a +%{_libdir}/pkgconfig/glslang.pc +%{_libdir}/pkgconfig/spirv.pc +%{_libdir}/cmake/* + +%changelog +* Mon Feb 13 2023 Dave Airlie - 11.9.0-4 +- Latest snapshot used in 1.3.239 sdk + +* Wed Aug 24 2022 Dave Airlie - 11.9.0-3 +- Latest snapshot used in 1.3.224 sdk + +* Mon Jun 20 2022 Dave Airlie - 11.9.0-2 +- Latest snapshot used in 1.3.216 sdk + +* Mon Feb 21 2022 Dave Airlie - 11.9.0-1.20220202.git2742e95 +- Latest snapshot used in 1.3.204 sdk + +* Wed Nov 04 2020 Dave Airlie - 11.0.0-3 +- Update glslang for 8.4.0 + +* Wed Aug 05 2020 Dave Airlie - 11.0.0-1 +- Update glslang for 8.3.0 + +* Wed Jan 29 2020 Dave Airlie - 8.13.3559-1 +- Update glslang for 8.2.0 for vulkan 1.2 + +* Sat Dec 07 2019 Dave Airlie - 7.13.3496-2 +- Update for 8.2.0 + +* Tue Nov 12 2019 Dave Airlie - 7.13.3496-1 +- Update to latest snapshot + +* Thu Aug 15 2019 Dave Airlie - 7.11.3214-4 +- Fix coverity scans (Kamil Dudka) + +* Sat Aug 03 2019 Dave Airlie - 7.11.3214-3 +- Latest upstream snapshot for validation layers build +- Add patch to build against system spirv-tools + +* Tue Feb 12 2019 Dave Airlie - 3.1-0.11.20190329.gite0d59bb +- Update for vulkan 1.1.92.0 +- Update for vulkan 1.1.101.0 + +* Tue Aug 07 2018 Leigh Scott - 3.1-0.10.20180727.gite99a268 +- Update for vulkan 1.1.82.0 + +* Fri Jul 13 2018 Fedora Release Engineering - 3.1-0.9.20180416.git3bb4c48 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild + +* Mon Apr 23 2018 Leigh Scott - 3.1-0.8.20180416.git3bb4c48 +- Update for vulkan 1.1.73.0 + +* Wed Mar 07 2018 Adam Williamson - 3.1-0.7.20180205.git2651cca +- Rebuild to fix GCC 8 mis-compilation + See https://da.gd/YJVwk ("GCC 8 ABI change on x86_64") + +* Fri Feb 09 2018 Leigh Scott - 3.1-0.6.20180205.git2651cca +- Update for vulkan 1.0.68.0 + +* Fri Feb 09 2018 Leigh Scott - 3.1-0.5.20171028.git715c353 +- Use ninja to build + +* Wed Feb 07 2018 Fedora Release Engineering - 3.1-0.4.20171028.git715c353 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild + +* Wed Jan 03 2018 Leigh Scott - 3.1-0.3.20171028.git715c353 +- Exclude s390x and ppc64 from check section + +* Wed Jan 03 2018 Leigh Scott - 3.1-0.2.20171028.git715c353 +- Add check section to run tests +- Split binaries into main package + +* Thu Jul 13 2017 Leigh Scott - 3.1-0.1.20171028.git715c353 +- First build + diff --git a/sources b/sources new file mode 100644 index 0000000..16c1cef --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (glslang-sdk-1.3.239.0.tar.gz) = 2502ddc48aea333d2406f4b225a74f15adb429633b4deb701737440e01e134a5eda98933156b2821ad1fa48d83f259e36061390600d6c5c9bb2edf8c18287d2b