summary refs log tree commit diff
path: root/pkgs/development/libraries/vulkan-loader/system-search-path.patch
blob: 26f83e6d534fb9ad7e7634c36b7bfd8dc28c900a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9ac5ce835..cbdb0ff56 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -88,6 +88,12 @@ if(UNIX)
             STRING
             "Search path to use when XDG_DATA_DIRS is unset or empty or the current process is SUID/SGID. Default is freedesktop compliant."
         )
+    set(
+        SYSTEM_SEARCH_PATH ""
+        CACHE
+            STRING
+            "Search path to always use, after all other search paths."
+    )
 endif()
 
 if(UNIX AND NOT APPLE) # i.e.: Linux
@@ -184,6 +190,7 @@ if(UNIX)
     add_definitions(-DFALLBACK_CONFIG_DIRS="${FALLBACK_CONFIG_DIRS}")
     add_definitions(-DFALLBACK_DATA_DIRS="${FALLBACK_DATA_DIRS}")
     add_definitions(-DSYSCONFDIR="${CMAKE_INSTALL_FULL_SYSCONFDIR}")
+    add_definitions(-DSYSTEM_SEARCH_PATH="${SYSTEM_SEARCH_PATH}")
 
     # Make sure /etc is searched by the loader
     if(NOT (CMAKE_INSTALL_FULL_SYSCONFDIR STREQUAL "/etc"))
diff --git a/loader/loader.c b/loader/loader.c
index 0d3b5a947..abe357004 100644
--- a/loader/loader.c
+++ b/loader/loader.c
@@ -3688,6 +3688,7 @@ static VkResult ReadDataFilesInSearchPaths(const struct loader_instance *inst, e
                 search_path_size += DetermineDataFilePathSize(xdgdatahome, rel_size);
                 search_path_size += DetermineDataFilePathSize(home_root, rel_size);
             }
+            search_path_size += DetermineDataFilePathSize(SYSTEM_SEARCH_PATH, rel_size);
 #endif
         }
     }
@@ -3737,6 +3738,7 @@ static VkResult ReadDataFilesInSearchPaths(const struct loader_instance *inst, e
                 CopyDataFilePath(xdgdatahome, relative_location, rel_size, &cur_path_ptr);
                 CopyDataFilePath(home_root, relative_location, rel_size, &cur_path_ptr);
             }
+            CopyDataFilePath(SYSTEM_SEARCH_PATH, relative_location, rel_size, &cur_path_ptr);
         }
 
         // Remove the last path separator