Work around broken glslang in Debian
authorTimo Röhling <roehling@debian.org>
Sat, 4 May 2024 18:28:47 +0000 (20:28 +0200)
committerTimo Röhling <roehling@debian.org>
Fri, 17 May 2024 16:00:06 +0000 (18:00 +0200)
Closes: #1063143
16 files changed:
debian/control
debian/copyright
debian/patches/0001-Build-against-system-libraries.patch
debian/patches/0002-Disable-Java.patch
debian/patches/0004-Fix-combine_static_libs-macro.patch
debian/patches/0005-Fix-list_licenses-macro.patch
debian/patches/0006-Adjust-linker-flags.patch
debian/patches/0009-Fix-library-export-for-Debian.patch
debian/patches/0011-Replace-BlueGL-with-epoxy.patch
debian/patches/0017-Fix-TBuiltInResource-struct.patch [deleted file]
debian/patches/0018-Fix-compatibility-with-spirv-cross-SDK-1.3.236.patch [deleted file]
debian/patches/0020-Do-not-overwrite-debianized-ImportExecutables.patch
debian/patches/0020-Fix-shebang-to-use-Python-3.patch [new file with mode: 0644]
debian/patches/0021-Do-not-build-spirv-with-Werror.patch [new file with mode: 0644]
debian/patches/0022-Fixups-for-spirv.patch [new file with mode: 0644]
debian/patches/series

index d21a5bd7ae6fdea6cec4372c3e722c9df5040986..a562a84bd134eaa855a0faa2f1a4ef4c3f212e79 100644 (file)
@@ -5,7 +5,6 @@ Maintainer: Timo Röhling <roehling@debian.org>
 Build-Depends: debhelper-compat (= 13),
     clang:native,
     cmake,
-    glslang-dev (>= 11.12.0),
     libfilament-tools <cross>,
     libassimp-dev,
     libastcenc-dev,
@@ -20,9 +19,7 @@ Build-Depends: debhelper-compat (= 13),
     libsdl2-dev,
     libstb-dev,
     libtinyexr-dev,
-    libspirv-cross-c-shared-dev (>= 2021.01.15-5~),
     robin-map-dev,
-    spirv-tools,
     zlib1g-dev,
 Homepage: https://github.com/google/filament
 Standards-Version: 4.6.2
index eb2b1b536cfda54e3be52b90cb754f17fb02b4f5..bf97a8a2eecfaa177407ffde04f84589cc23599c 100644 (file)
@@ -17,7 +17,6 @@ Files-Excluded:
     third_party/draco
     third_party/environments
     third_party/gl-matrix
-    third_party/glslang
     third_party/imgui
     third_party/jsmn
     third_party/libassimp
@@ -30,8 +29,6 @@ Files-Excluded:
     third_party/models
     third_party/moltenvk
     third_party/robin-map
-    third_party/spirv-tools
-    third_party/spirv-cross
     third_party/stb
     third_party/textures
     third_party/tinyexr
index 5239ab673d39bf85e9e9dd90db97907874339a03..67a47bce50813659bdd2c489c9d50bdfa8de6630 100644 (file)
@@ -1,14 +1,13 @@
 From: =?utf-8?q?Timo_R=C3=B6hling?= <roehling@debian.org>
-Date: Wed, 24 May 2023 23:55:51 +0200
+Date: Sat, 4 May 2024 20:49:11 +0200
 Subject: Build against system libraries
 
 ---
- CMakeLists.txt              | 44 +++++++++++++++++++++++++-------------------
- libs/filamat/CMakeLists.txt |  2 +-
- 2 files changed, 26 insertions(+), 20 deletions(-)
+ CMakeLists.txt | 36 ++++++++++++++++++++++--------------
+ 1 file changed, 22 insertions(+), 14 deletions(-)
 
 diff --git a/CMakeLists.txt b/CMakeLists.txt
-index aa51851..960f49f 100644
+index aa51851..c513cea 100644
 --- a/CMakeLists.txt
 +++ b/CMakeLists.txt
 @@ -573,12 +573,30 @@ function(get_resgen_vars ARCHIVE_DIR ARCHIVE_NAME)
@@ -43,7 +42,7 @@ index aa51851..960f49f 100644
  add_subdirectory(${LIBRARIES}/camutils)
  add_subdirectory(${LIBRARIES}/filabridge)
  add_subdirectory(${LIBRARIES}/filaflat)
-@@ -597,23 +615,16 @@ add_subdirectory(${FILAMENT}/filament)
+@@ -597,15 +615,10 @@ add_subdirectory(${FILAMENT}/filament)
  add_subdirectory(${FILAMENT}/shaders)
  add_subdirectory(${EXTERNAL}/civetweb/tnt)
  add_subdirectory(${EXTERNAL}/hat-trie/tnt)
@@ -61,18 +60,7 @@ index aa51851..960f49f 100644
  add_subdirectory(${EXTERNAL}/getopt)
  
  if (FILAMENT_BUILD_FILAMAT OR IS_HOST_PLATFORM)
--    # spirv-tools must come before filamat, as filamat relies on the presence of the
--    # spirv-tools_SOURCE_DIR variable.
--    add_subdirectory(${EXTERNAL}/spirv-tools)
--    add_subdirectory(${EXTERNAL}/glslang/tnt)
--    add_subdirectory(${EXTERNAL}/spirv-cross/tnt)
-+    include(debian/cmake/spirv-tools.cmake)
-+    include(debian/cmake/glslang.cmake)
-+    include(debian/cmake/spirv-cross.cmake)
-     add_subdirectory(${LIBRARIES}/filamat)
-     # the material debugger requires filamat
-@@ -649,13 +660,8 @@ if (IS_HOST_PLATFORM)
+@@ -649,13 +662,8 @@ if (IS_HOST_PLATFORM)
  
      add_subdirectory(${FILAMENT}/samples)
  
@@ -87,16 +75,3 @@ index aa51851..960f49f 100644
  
      add_subdirectory(${TOOLS}/cmgen)
      add_subdirectory(${TOOLS}/cso-lut)
-diff --git a/libs/filamat/CMakeLists.txt b/libs/filamat/CMakeLists.txt
-index 9645004..2271e83 100644
---- a/libs/filamat/CMakeLists.txt
-+++ b/libs/filamat/CMakeLists.txt
-@@ -104,7 +104,7 @@ if (APPLE OR MSVC)
-     target_link_libraries(${TARGET} glslang SPIRV SPVRemapper SPIRV-Tools-opt spirv-cross-glsl)
- else()
-     target_link_libraries(${TARGET}
--            -Wl,--start-group glslang SPIRV SPVRemapper SPIRV-Tools-opt spirv-cross-glsl -Wl,--end-group)
-+            -Wl,--start-group glslang SPIRV SPVRemapper SPIRV-Tools-opt spirv-cross -Wl,--end-group)
- endif()
- # ==================================================================================================
index ef7de5c5f54526834fb17d2577319013a875ddbe..08cc9e970d550f36f5b25a272a8e43acdd8445e8 100644 (file)
@@ -7,10 +7,10 @@ Subject: Disable Java
  1 file changed, 4 deletions(-)
 
 diff --git a/CMakeLists.txt b/CMakeLists.txt
-index 960f49f..d379ff1 100644
+index c513cea..d827c61 100644
 --- a/CMakeLists.txt
 +++ b/CMakeLists.txt
-@@ -654,10 +654,6 @@ if (IS_HOST_PLATFORM)
+@@ -656,10 +656,6 @@ if (IS_HOST_PLATFORM)
      add_subdirectory(${LIBRARIES}/filamentapp)
      add_subdirectory(${LIBRARIES}/imageio)
  
index ea6fee4c679ae0868c84f48093d4f749563f695c..8f96056b5d0b9ed08b655d2b75a21d1fa71528ba 100644 (file)
@@ -7,7 +7,7 @@ Subject: Fix combine_static_libs macro
  1 file changed, 6 insertions(+), 1 deletion(-)
 
 diff --git a/CMakeLists.txt b/CMakeLists.txt
-index d379ff1..f637432 100644
+index d827c61..55c48e4 100644
 --- a/CMakeLists.txt
 +++ b/CMakeLists.txt
 @@ -495,7 +495,12 @@ function(combine_static_libs TARGET OUTPUT DEPS)
index 3d2d08793bf37a2329f4bcfdece5589809c1fea3..d3ab69ce25c32d9c22b443af49a02b3b5d0f6b4f 100644 (file)
@@ -7,7 +7,7 @@ Subject: Fix list_licenses macro
  1 file changed, 7 insertions(+), 5 deletions(-)
 
 diff --git a/CMakeLists.txt b/CMakeLists.txt
-index f637432..46ee62f 100644
+index 55c48e4..f8d164e 100644
 --- a/CMakeLists.txt
 +++ b/CMakeLists.txt
 @@ -475,11 +475,13 @@ function(list_licenses OUTPUT MODULES)
index ef09c18ee893eeceec8e11fb7b1118c9377447ae..8446f461b3ab4d7142d3965b0efb81cf1bb5b2f1 100644 (file)
@@ -7,7 +7,7 @@ Subject: Adjust linker flags
  1 file changed, 1 insertion(+), 8 deletions(-)
 
 diff --git a/CMakeLists.txt b/CMakeLists.txt
-index 46ee62f..f7eb993 100644
+index f8d164e..0e45717 100644
 --- a/CMakeLists.txt
 +++ b/CMakeLists.txt
 @@ -331,12 +331,6 @@ endif()
index 48793530c4ff706b6b75cd75baf75d15eeeaed19..dfe3a62dbb8ac152c43c64c0874b6a0fe49664e6 100644 (file)
@@ -1,5 +1,5 @@
 From: =?utf-8?q?Timo_R=C3=B6hling?= <roehling@debian.org>
-Date: Wed, 24 May 2023 22:47:17 +0200
+Date: Sat, 4 May 2024 21:06:50 +0200
 Subject: Fix library export for Debian
 
 ---
@@ -33,17 +33,17 @@ Subject: Fix library export for Debian
  tools/filamesh/CMakeLists.txt            |  2 +-
  tools/glslminifier/CMakeLists.txt        |  2 +-
  tools/matc/CMakeLists.txt                |  4 +-
- tools/matinfo/CMakeLists.txt             |  4 +-
+ tools/matinfo/CMakeLists.txt             |  2 +-
  tools/mipgen/CMakeLists.txt              |  2 +-
  tools/normal-blending/CMakeLists.txt     |  2 +-
  tools/roughness-prefilter/CMakeLists.txt |  2 +-
- 34 files changed, 503 insertions(+), 246 deletions(-)
+ 34 files changed, 502 insertions(+), 245 deletions(-)
 
 diff --git a/CMakeLists.txt b/CMakeLists.txt
-index f7eb993..fa3099f 100644
+index 0e45717..26772a9 100644
 --- a/CMakeLists.txt
 +++ b/CMakeLists.txt
-@@ -676,3 +676,19 @@ endif()
+@@ -678,3 +678,19 @@ endif()
  if (NOT CMAKE_CROSSCOMPILING)
      export(TARGETS matc cmgen filamesh mipgen resgen glslminifier FILE ${IMPORT_EXECUTABLES})
  endif()
@@ -502,7 +502,7 @@ index fe5373e..683d022 100644
  # ==================================================================================================
  # Compiler flags
 diff --git a/libs/filamat/CMakeLists.txt b/libs/filamat/CMakeLists.txt
-index 2271e83..9b38857 100644
+index 9645004..a130f0c 100644
 --- a/libs/filamat/CMakeLists.txt
 +++ b/libs/filamat/CMakeLists.txt
 @@ -84,18 +84,36 @@ include_directories(${PUBLIC_HDR_DIR})
@@ -558,7 +558,7 @@ index 2271e83..9b38857 100644
  else()
 -    target_link_libraries(${TARGET}
 +    target_link_libraries(${TARGET} PRIVATE
-             -Wl,--start-group glslang SPIRV SPVRemapper SPIRV-Tools-opt spirv-cross -Wl,--end-group)
+             -Wl,--start-group glslang SPIRV SPVRemapper SPIRV-Tools-opt spirv-cross-glsl -Wl,--end-group)
  endif()
  
 @@ -151,14 +169,14 @@ set(FILAMAT_DEPS
@@ -1398,10 +1398,10 @@ index cb8c934..8eef505 100644
 -target_link_libraries(${TARGET} matlang gtest)
 +target_link_libraries(${TARGET} matlang GTest::gtest)
 diff --git a/tools/matinfo/CMakeLists.txt b/tools/matinfo/CMakeLists.txt
-index 17d948f..37b56f5 100644
+index 17d948f..12447e1 100644
 --- a/tools/matinfo/CMakeLists.txt
 +++ b/tools/matinfo/CMakeLists.txt
-@@ -13,12 +13,12 @@ set(SRCS src/main.cpp)
+@@ -13,7 +13,7 @@ set(SRCS src/main.cpp)
  # ==================================================================================================
  add_executable(${TARGET} ${SRCS})
  
@@ -1410,12 +1410,6 @@ index 17d948f..37b56f5 100644
  
  # glslang contains a copy of the SPIRV headers, so let's just use those. The leading ".." in the
  # following variable refers to the project name that we define in glslang/tnt, and the trailing ".."
- # in the path allows us to do #include <SPIRV/disassemble.h>
--target_include_directories(${TARGET} PRIVATE ${../glslang_SOURCE_DIR}/..)
-+#target_include_directories(${TARGET} PRIVATE ${../glslang_SOURCE_DIR}/..)
- # =================================================================================================
- # Licenses
 diff --git a/tools/mipgen/CMakeLists.txt b/tools/mipgen/CMakeLists.txt
 index 2686b40..38fdc60 100644
 --- a/tools/mipgen/CMakeLists.txt
index c1ee375330ad4b0a50f526e58a48822fc34e069e..bc4facfb0d9ee8d5b86860a915def1acfe2a96dd 100644 (file)
@@ -15,10 +15,10 @@ Subject: Replace BlueGL with epoxy
  9 files changed, 36 insertions(+), 151 deletions(-)
 
 diff --git a/CMakeLists.txt b/CMakeLists.txt
-index fa3099f..632ece6 100644
+index 26772a9..8de76e3 100644
 --- a/CMakeLists.txt
 +++ b/CMakeLists.txt
-@@ -650,7 +650,6 @@ if (WEBGL)
+@@ -652,7 +652,6 @@ if (WEBGL)
  endif()
  
  if (IS_HOST_PLATFORM)
diff --git a/debian/patches/0017-Fix-TBuiltInResource-struct.patch b/debian/patches/0017-Fix-TBuiltInResource-struct.patch
deleted file mode 100644 (file)
index b8ec36b..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-From: =?utf-8?q?Timo_R=C3=B6hling?= <roehling@debian.org>
-Date: Sat, 12 Nov 2022 13:26:20 +0100
-Subject: Fix TBuiltInResource struct
-
----
- filament/backend/test/builtinResource.h | 9 +++++++++
- libs/filamat/src/sca/builtinResource.h  | 9 +++++++++
- 2 files changed, 18 insertions(+)
-
-diff --git a/filament/backend/test/builtinResource.h b/filament/backend/test/builtinResource.h
-index 39ac194..78397fe 100644
---- a/filament/backend/test/builtinResource.h
-+++ b/filament/backend/test/builtinResource.h
-@@ -107,6 +107,15 @@ const TBuiltInResource DefaultTBuiltInResource = {
-         /* .maxTaskWorkGroupSizeY_NV = */ 1,
-         /* .maxTaskWorkGroupSizeZ_NV = */ 1,
-         /* .maxMeshViewCountNV = */ 4,
-+        /* .maxMeshOutputVerticesEXT = */ 256,
-+        /* .maxMeshOutputPrimitivesEXT = */ 256,
-+        /* .maxMeshWorkGroupSizeX_EXT = */ 128,
-+        /* .maxMeshWorkGroupSizeY_EXT = */ 128,
-+        /* .maxMeshWorkGroupSizeZ_EXT = */ 128,
-+        /* .maxTaskWorkGroupSizeX_EXT = */ 128,
-+        /* .maxTaskWorkGroupSizeY_EXT = */ 128,
-+        /* .maxTaskWorkGroupSizeZ_EXT = */ 128,
-+        /* .maxMeshViewCountEXT = */ 4,
-         /* .maxDualSourceDrawBuffersEXT = */ 1,
-         /* .limits = */ {
-diff --git a/libs/filamat/src/sca/builtinResource.h b/libs/filamat/src/sca/builtinResource.h
-index 4419eb6..c47c8e0 100644
---- a/libs/filamat/src/sca/builtinResource.h
-+++ b/libs/filamat/src/sca/builtinResource.h
-@@ -107,6 +107,15 @@ const TBuiltInResource DefaultTBuiltInResource = {
-         /* .maxTaskWorkGroupSizeY_NV = */ 1,
-         /* .maxTaskWorkGroupSizeZ_NV = */ 1,
-         /* .maxMeshViewCountNV = */ 4,
-+        /* .maxMeshOutputVerticesEXT = */ 256,
-+        /* .maxMeshOutputPrimitivesEXT = */ 256,
-+        /* .maxMeshWorkGroupSizeX_EXT = */ 128,
-+        /* .maxMeshWorkGroupSizeY_EXT = */ 128,
-+        /* .maxMeshWorkGroupSizeZ_EXT = */ 128,
-+        /* .maxTaskWorkGroupSizeX_EXT = */ 128,
-+        /* .maxTaskWorkGroupSizeY_EXT = */ 128,
-+        /* .maxTaskWorkGroupSizeZ_EXT = */ 128,
-+        /* .maxMeshViewCountEXT = */ 4,
-         /* .maxDualSourceDrawBuffersEXT = */ 1,
-         /* .limits = */ {
diff --git a/debian/patches/0018-Fix-compatibility-with-spirv-cross-SDK-1.3.236.patch b/debian/patches/0018-Fix-compatibility-with-spirv-cross-SDK-1.3.236.patch
deleted file mode 100644 (file)
index 2419ca0..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-From: =?utf-8?q?Timo_R=C3=B6hling?= <roehling@debian.org>
-Date: Sat, 28 Jan 2023 00:24:04 +0100
-Subject: Fix compatibility with spirv-cross SDK 1.3.236
-
----
- libs/filamat/src/GLSLPostProcessor.cpp | 4 ++++
- 1 file changed, 4 insertions(+)
-
-diff --git a/libs/filamat/src/GLSLPostProcessor.cpp b/libs/filamat/src/GLSLPostProcessor.cpp
-index 678f069..c774bd9 100644
---- a/libs/filamat/src/GLSLPostProcessor.cpp
-+++ b/libs/filamat/src/GLSLPostProcessor.cpp
-@@ -346,7 +346,11 @@ void GLSLPostProcessor::fullOptimization(const TShader& tShader,
-         if (tShader.getStage() == EShLangFragment && glslOptions.es) {
-             for (auto i : config.glsl.subpassInputToColorLocation) {
-+#if SPV_VERSION >= 0x10600
-+                glslCompiler.remap_ext_framebuffer_fetch(i.first, i.second, true);
-+#else
-                 glslCompiler.remap_ext_framebuffer_fetch(i.first, i.second);
-+#endif
-             }
-         }
index 30bc4a83c23ce14877d4c0b94f685eba197b6a8e..86f05260bc4592a020fb1f4e17333cc946f753cf 100644 (file)
@@ -8,10 +8,10 @@ Forwarded: not-needed
  1 file changed, 4 deletions(-)
 
 diff --git a/CMakeLists.txt b/CMakeLists.txt
-index 632ece6..05c605d 100644
+index 8de76e3..69772d2 100644
 --- a/CMakeLists.txt
 +++ b/CMakeLists.txt
-@@ -671,10 +671,6 @@ if (IS_HOST_PLATFORM)
+@@ -673,10 +673,6 @@ if (IS_HOST_PLATFORM)
      add_subdirectory(${TOOLS}/specular-color)
  endif()
  
diff --git a/debian/patches/0020-Fix-shebang-to-use-Python-3.patch b/debian/patches/0020-Fix-shebang-to-use-Python-3.patch
new file mode 100644 (file)
index 0000000..a403ff4
--- /dev/null
@@ -0,0 +1,139 @@
+From: =?utf-8?q?Timo_R=C3=B6hling?= <roehling@debian.org>
+Date: Sat, 4 May 2024 20:33:03 +0200
+Subject: Fix shebang to use Python 3
+
+---
+ third_party/glslang/build_info.py                          | 2 +-
+ third_party/glslang/update_glslang_sources.py              | 2 +-
+ third_party/spirv-tools/test/scripts/test_compact_ids.py   | 2 +-
+ third_party/spirv-tools/utils/check_copyright.py           | 2 +-
+ third_party/spirv-tools/utils/check_symbol_exports.py      | 2 +-
+ third_party/spirv-tools/utils/fixup_fuzz_result.py         | 2 +-
+ third_party/spirv-tools/utils/generate_grammar_tables.py   | 2 +-
+ third_party/spirv-tools/utils/generate_language_headers.py | 2 +-
+ third_party/spirv-tools/utils/generate_registry_tables.py  | 2 +-
+ third_party/spirv-tools/utils/generate_vim_syntax.py       | 2 +-
+ third_party/spirv-tools/utils/git-sync-deps                | 2 +-
+ third_party/spirv-tools/utils/update_build_version.py      | 2 +-
+ 12 files changed, 12 insertions(+), 12 deletions(-)
+
+diff --git a/third_party/glslang/build_info.py b/third_party/glslang/build_info.py
+index 2ac864b..d51f01c 100755
+--- a/third_party/glslang/build_info.py
++++ b/third_party/glslang/build_info.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ # Copyright (c) 2020 Google Inc.
+ #
+diff --git a/third_party/glslang/update_glslang_sources.py b/third_party/glslang/update_glslang_sources.py
+index 65be2f6..20f303b 100755
+--- a/third_party/glslang/update_glslang_sources.py
++++ b/third_party/glslang/update_glslang_sources.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ # Copyright 2017 The Glslang Authors. All rights reserved.
+ #
+diff --git a/third_party/spirv-tools/test/scripts/test_compact_ids.py b/third_party/spirv-tools/test/scripts/test_compact_ids.py
+index 6ca6e67..a919658 100644
+--- a/third_party/spirv-tools/test/scripts/test_compact_ids.py
++++ b/third_party/spirv-tools/test/scripts/test_compact_ids.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ # Copyright (c) 2017 Google Inc.
+ # Licensed under the Apache License, Version 2.0 (the "License");
+diff --git a/third_party/spirv-tools/utils/check_copyright.py b/third_party/spirv-tools/utils/check_copyright.py
+index 39d27cb..f56e701 100755
+--- a/third_party/spirv-tools/utils/check_copyright.py
++++ b/third_party/spirv-tools/utils/check_copyright.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ # coding=utf-8
+ # Copyright (c) 2016 Google Inc.
+ #
+diff --git a/third_party/spirv-tools/utils/check_symbol_exports.py b/third_party/spirv-tools/utils/check_symbol_exports.py
+index bcd77da..7919223 100755
+--- a/third_party/spirv-tools/utils/check_symbol_exports.py
++++ b/third_party/spirv-tools/utils/check_symbol_exports.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ # Copyright (c) 2017 Google Inc.
+ # Licensed under the Apache License, Version 2.0 (the "License");
+diff --git a/third_party/spirv-tools/utils/fixup_fuzz_result.py b/third_party/spirv-tools/utils/fixup_fuzz_result.py
+index 9fe54a3..5b14a7d 100755
+--- a/third_party/spirv-tools/utils/fixup_fuzz_result.py
++++ b/third_party/spirv-tools/utils/fixup_fuzz_result.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ # Copyright (c) 2018 Google Inc.
+ #
+ # Licensed under the Apache License, Version 2.0 (the "License");
+diff --git a/third_party/spirv-tools/utils/generate_grammar_tables.py b/third_party/spirv-tools/utils/generate_grammar_tables.py
+index 2a67733..3828701 100755
+--- a/third_party/spirv-tools/utils/generate_grammar_tables.py
++++ b/third_party/spirv-tools/utils/generate_grammar_tables.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ # Copyright (c) 2016 Google Inc.
+ # Licensed under the Apache License, Version 2.0 (the "License");
+diff --git a/third_party/spirv-tools/utils/generate_language_headers.py b/third_party/spirv-tools/utils/generate_language_headers.py
+index 83fa99e..18a8d5e 100755
+--- a/third_party/spirv-tools/utils/generate_language_headers.py
++++ b/third_party/spirv-tools/utils/generate_language_headers.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ # Copyright (c) 2017 Google Inc.
+ # Licensed under the Apache License, Version 2.0 (the "License");
+diff --git a/third_party/spirv-tools/utils/generate_registry_tables.py b/third_party/spirv-tools/utils/generate_registry_tables.py
+index 28152ef..8cacc8e 100755
+--- a/third_party/spirv-tools/utils/generate_registry_tables.py
++++ b/third_party/spirv-tools/utils/generate_registry_tables.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ # Copyright (c) 2016 Google Inc.
+ # Licensed under the Apache License, Version 2.0 (the "License");
+diff --git a/third_party/spirv-tools/utils/generate_vim_syntax.py b/third_party/spirv-tools/utils/generate_vim_syntax.py
+index da7e99b..5c9c6b2 100755
+--- a/third_party/spirv-tools/utils/generate_vim_syntax.py
++++ b/third_party/spirv-tools/utils/generate_vim_syntax.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ # Copyright (c) 2016 Google Inc.
+ # Licensed under the Apache License, Version 2.0 (the "License");
+diff --git a/third_party/spirv-tools/utils/git-sync-deps b/third_party/spirv-tools/utils/git-sync-deps
+index 0575641..eecfbe9 100755
+--- a/third_party/spirv-tools/utils/git-sync-deps
++++ b/third_party/spirv-tools/utils/git-sync-deps
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ # Copyright 2014 Google Inc.
+ #
+ # Redistribution and use in source and binary forms, with or without
+diff --git a/third_party/spirv-tools/utils/update_build_version.py b/third_party/spirv-tools/utils/update_build_version.py
+index 321de74..cbce3d8 100755
+--- a/third_party/spirv-tools/utils/update_build_version.py
++++ b/third_party/spirv-tools/utils/update_build_version.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ # Copyright (c) 2016 Google Inc.
+ #
diff --git a/debian/patches/0021-Do-not-build-spirv-with-Werror.patch b/debian/patches/0021-Do-not-build-spirv-with-Werror.patch
new file mode 100644 (file)
index 0000000..32e8f06
--- /dev/null
@@ -0,0 +1,35 @@
+From: =?utf-8?q?Timo_R=C3=B6hling?= <roehling@debian.org>
+Date: Sat, 4 May 2024 20:37:47 +0200
+Subject: Do not build spirv-* with Werror
+
+---
+ third_party/spirv-cross/tnt/CMakeLists.txt | 2 +-
+ third_party/spirv-tools/CMakeLists.txt     | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/third_party/spirv-cross/tnt/CMakeLists.txt b/third_party/spirv-cross/tnt/CMakeLists.txt
+index 25da487..cb375bf 100644
+--- a/third_party/spirv-cross/tnt/CMakeLists.txt
++++ b/third_party/spirv-cross/tnt/CMakeLists.txt
+@@ -37,7 +37,7 @@ endif()
+ # -DCMAKE_CXX_COMPILE_FLAGS
+ # However, we require the C++11 dialect.
+ if (NOT "${MSVC}")
+-  set(spirv-compiler-options ${spirv-compiler-options} -std=c++11 -Wall -Wextra -Werror -Wshadow)
++  set(spirv-compiler-options ${spirv-compiler-options} -std=c++11 -Wall -Wextra -Wshadow)
+   set(spirv-compiler-defines ${spirv-compiler-defines} __STDC_LIMIT_MACROS)
+   if(SPIRV_CROSS_EXCEPTIONS_TO_ASSERTIONS)
+diff --git a/third_party/spirv-tools/CMakeLists.txt b/third_party/spirv-tools/CMakeLists.txt
+index 9ea29ab..f967a87 100755
+--- a/third_party/spirv-tools/CMakeLists.txt
++++ b/third_party/spirv-tools/CMakeLists.txt
+@@ -94,7 +94,7 @@ endif(SPIRV_BUILD_COMPRESSION)
+ option(SPIRV_BUILD_FUZZER "Build spirv-fuzz" OFF)
+-option(SPIRV_WERROR "Enable error on warning" ON)
++option(SPIRV_WERROR "Enable error on warning" OFF)
+ if(("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") OR (("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang") AND (NOT CMAKE_CXX_SIMULATE_ID STREQUAL "MSVC")))
+   set(COMPILER_IS_LIKE_GNU TRUE)
+ endif()
diff --git a/debian/patches/0022-Fixups-for-spirv.patch b/debian/patches/0022-Fixups-for-spirv.patch
new file mode 100644 (file)
index 0000000..499d6eb
--- /dev/null
@@ -0,0 +1,20 @@
+From: =?utf-8?q?Timo_R=C3=B6hling?= <roehling@debian.org>
+Date: Fri, 17 May 2024 17:58:01 +0200
+Subject: Fixups for spirv-*
+
+---
+ tools/matc/CMakeLists.txt | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/tools/matc/CMakeLists.txt b/tools/matc/CMakeLists.txt
+index 8eef505..3687a2a 100644
+--- a/tools/matc/CMakeLists.txt
++++ b/tools/matc/CMakeLists.txt
+@@ -43,6 +43,7 @@ add_library(${TARGET} STATIC ${SRCS} ${HDRS})
+ target_include_directories(${TARGET} PUBLIC src)
+ target_include_directories(${TARGET} PRIVATE ${filamat_SOURCE_DIR}/src)
++target_include_directories(${TARGET} PRIVATE ${../glslang_SOURCE_DIR}/../SPIRV ${../glslang_SOURCE_DIR}/..)
+ target_link_libraries(${TARGET} getopt filamat filabridge utils glslang smol-v)
index b887976063e965b301a13ef844087ee4133ce2e2..fd812d792d9b86b9a4b8e3ba571ac5cb35f1bf0d 100644 (file)
@@ -14,8 +14,9 @@
 0014-Ensure-proper-alignment-of-resgen-_OFFSET-and-_SIZE-.patch
 0015-Fix-FTBFS-with-GCC-12.patch
 0016-Workaround-for-armel-clang-compiler-bug.patch
-0017-Fix-TBuiltInResource-struct.patch
-0018-Fix-compatibility-with-spirv-cross-SDK-1.3.236.patch
 0019-Fix-build-with-gcc-13.patch
 0020-Do-not-overwrite-debianized-ImportExecutables.patch
 0021-Fix-build-with-imgui-1.90.patch
+0020-Fix-shebang-to-use-Python-3.patch
+0021-Do-not-build-spirv-with-Werror.patch
+0022-Fixups-for-spirv.patch