Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 6e139a4120df
Choose a base ref
...
head repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 525f0b043652
Choose a head ref
  • 2 commits
  • 2 files changed
  • 2 contributors

Commits on Jun 8, 2019

  1. vulkan-loader: Always include /run/opengl-driver(-32)/share in search…

    … path.
    
    Even though FALLBACK_DATA_DIRS is set to include this, it only applies when XDG_DATA_DIRS is not defined, so the NixOS opengl.nix module still had to include these in the search path. Use a simple patch to force a default search path, consulted after all other search paths.
    
    Note that FALLBACK_DATA_DIRS is no longer set, and the default (/usr/local/share:/usr/share) applies.
    ambrop72 committed Jun 8, 2019

    Unverified

    This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
    Copy the full SHA
    bc96146 View commit details

Commits on Jun 26, 2019

  1. Merge pull request #62869 from ambrop72/vulkan-loader-search-path

    vulkan-loader: Always include /run/opengl-driver(-32)/share in search path.
    matthewbauer authored Jun 26, 2019

    Unverified

    This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
    Copy the full SHA
    525f0b0 View commit details
Showing with 48 additions and 1 deletion.
  1. +3 −1 pkgs/development/libraries/vulkan-loader/default.nix
  2. +45 −0 pkgs/development/libraries/vulkan-loader/system-search-path.patch
4 changes: 3 additions & 1 deletion pkgs/development/libraries/vulkan-loader/default.nix
Original file line number Diff line number Diff line change
@@ -21,8 +21,10 @@ stdenv.mkDerivation rec {
buildInputs = [ cmake python3 xlibsWrapper libxcb libXrandr libXext wayland ];
enableParallelBuilding = true;

patches = [ ./system-search-path.patch ];

cmakeFlags = [
"-DFALLBACK_DATA_DIRS=${addOpenGLRunpath.driverLink}/share:/usr/local/share:/usr/share"
"-DSYSTEM_SEARCH_PATH=${addOpenGLRunpath.driverLink}/share"
"-DVULKAN_HEADERS_INSTALL_DIR=${vulkan-headers}"
];

45 changes: 45 additions & 0 deletions pkgs/development/libraries/vulkan-loader/system-search-path.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,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