nixpkgs/pkgs/development/libraries/vulkan-loader/default.nix
Ambroz Bizjak bc96146e75 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.
2019-06-08 20:23:54 +02:00

46 lines
1.3 KiB
Nix

{ stdenv, fetchFromGitHub, cmake, python3, vulkan-headers, pkgconfig
, xlibsWrapper, libxcb, libXrandr, libXext, wayland, addOpenGLRunpath }:
let
version = "1.1.106";
in
assert version == vulkan-headers.version;
stdenv.mkDerivation rec {
name = "vulkan-loader-${version}";
inherit version;
src = fetchFromGitHub {
owner = "KhronosGroup";
repo = "Vulkan-Loader";
rev = "sdk-${version}";
sha256 = "0zhrwj1gi90x2w8gaaaw5h4b969a8gfy244kn0drrplhhb1nqz3b";
};
nativeBuildInputs = [ pkgconfig addOpenGLRunpath ];
buildInputs = [ cmake python3 xlibsWrapper libxcb libXrandr libXext wayland ];
enableParallelBuilding = true;
patches = [ ./system-search-path.patch ];
cmakeFlags = [
"-DSYSTEM_SEARCH_PATH=${addOpenGLRunpath.driverLink}/share"
"-DVULKAN_HEADERS_INSTALL_DIR=${vulkan-headers}"
];
outputs = [ "out" "dev" ];
# Set RUNPATH so that driver libraries in /run/opengl-driver(-32)/lib can be found.
# See the explanation in addOpenGLRunpath.
postFixup = ''
addOpenGLRunpath $out/lib/libvulkan.so
'';
meta = with stdenv.lib; {
description = "LunarG Vulkan loader";
homepage = https://www.lunarg.com;
platforms = platforms.linux;
license = licenses.asl20;
maintainers = [ maintainers.ralith ];
};
}