nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix
at 22.05 45 lines 1.4 kB view raw
1{ lib, stdenv, fetchFromGitHub, cmake, pkg-config, libX11, libxcb 2, libXrandr, wayland, moltenvk, vulkan-headers, addOpenGLRunpath }: 3 4stdenv.mkDerivation rec { 5 pname = "vulkan-loader"; 6 version = "1.3.211.0"; 7 8 src = (assert version == vulkan-headers.version; 9 fetchFromGitHub { 10 owner = "KhronosGroup"; 11 repo = "Vulkan-Loader"; 12 rev = "sdk-${version}"; 13 sha256 = "sha256-NQu98wA7UK231rpoKDs1yQ6pEyB4wZg7MjFC3JwS2BY="; 14 }); 15 16 patches = [ ./fix-pkgconfig.patch ]; 17 18 nativeBuildInputs = [ cmake pkg-config ]; 19 buildInputs = [ vulkan-headers ] 20 ++ lib.optionals (!stdenv.isDarwin) [ libX11 libxcb libXrandr wayland ]; 21 22 cmakeFlags = [ "-DCMAKE_INSTALL_INCLUDEDIR=${vulkan-headers}/include" ] 23 ++ lib.optional stdenv.isDarwin "-DSYSCONFDIR=${moltenvk}/share" 24 ++ lib.optional stdenv.isLinux "-DSYSCONFDIR=${addOpenGLRunpath.driverLink}/share" 25 ++ lib.optional (stdenv.buildPlatform != stdenv.hostPlatform) "-DUSE_GAS=OFF"; 26 27 outputs = [ "out" "dev" ]; 28 29 doInstallCheck = true; 30 31 installCheckPhase = '' 32 grep -q "${vulkan-headers}/include" $dev/lib/pkgconfig/vulkan.pc || { 33 echo vulkan-headers include directory not found in pkg-config file 34 exit 1 35 } 36 ''; 37 38 meta = with lib; { 39 description = "LunarG Vulkan loader"; 40 homepage = "https://www.lunarg.com"; 41 platforms = platforms.unix; 42 license = licenses.asl20; 43 maintainers = [ maintainers.ralith ]; 44 }; 45}