vulkan-loader: format, add option to enable or disable x11 support (#355949)

authored by Arne Keller and committed by GitHub 2fb61b62 16e466cc

+46 -12
+46 -12
pkgs/by-name/vu/vulkan-loader/package.nix
··· 1 - { lib, stdenv, fetchFromGitHub, fetchpatch, cmake, pkg-config, libX11, libxcb 2 - , libXrandr, wayland, moltenvk, vulkan-headers, addDriverRunpath 3 - , testers }: 1 + { 2 + lib, 3 + stdenv, 4 + fetchFromGitHub, 5 + fetchpatch, 6 + cmake, 7 + pkg-config, 8 + libX11, 9 + libxcb, 10 + libXrandr, 11 + wayland, 12 + moltenvk, 13 + vulkan-headers, 14 + addDriverRunpath, 15 + enableX11 ? stdenv.hostPlatform.isLinux, 16 + testers, 17 + }: 4 18 5 19 stdenv.mkDerivation (finalAttrs: { 6 20 pname = "vulkan-loader"; ··· 13 27 hash = "sha256-6GHZUiYL3gDWN61SaLiD/3xXSoQb1rx6U5eu1cl8ZwM="; 14 28 }; 15 29 16 - patches = [ ./fix-pkgconfig.patch ] 30 + patches = 31 + [ ./fix-pkgconfig.patch ] 17 32 ++ lib.optionals stdenv.hostPlatform.is32bit [ 18 33 # Backport patch to support 64-bit inodes on 32-bit systems 19 34 # FIXME: remove in next update ··· 23 38 }) 24 39 ]; 25 40 26 - nativeBuildInputs = [ cmake pkg-config ]; 27 - buildInputs = [ vulkan-headers ] 28 - ++ lib.optionals stdenv.hostPlatform.isLinux [ libX11 libxcb libXrandr wayland ]; 41 + nativeBuildInputs = [ 42 + cmake 43 + pkg-config 44 + ]; 45 + buildInputs = 46 + [ vulkan-headers ] 47 + ++ lib.optionals enableX11 [ 48 + libX11 49 + libxcb 50 + libXrandr 51 + ] 52 + ++ lib.optionals stdenv.hostPlatform.isLinux [ 53 + wayland 54 + ]; 29 55 30 - cmakeFlags = [ "-DCMAKE_INSTALL_INCLUDEDIR=${vulkan-headers}/include" ] 56 + cmakeFlags = 57 + [ 58 + "-DCMAKE_INSTALL_INCLUDEDIR=${vulkan-headers}/include" 59 + (lib.cmakeBool "BUILD_WSI_XCB_SUPPORT" enableX11) 60 + (lib.cmakeBool "BUILD_WSI_XLIB_SUPPORT" enableX11) 61 + ] 31 62 ++ lib.optional stdenv.hostPlatform.isDarwin "-DSYSCONFDIR=${moltenvk}/share" 32 63 ++ lib.optional stdenv.hostPlatform.isLinux "-DSYSCONFDIR=${addDriverRunpath.driverLink}/share" 33 64 ++ lib.optional (stdenv.buildPlatform != stdenv.hostPlatform) "-DUSE_GAS=OFF"; 34 65 35 - outputs = [ "out" "dev" ]; 66 + outputs = [ 67 + "out" 68 + "dev" 69 + ]; 36 70 37 71 doInstallCheck = true; 38 72 ··· 51 85 52 86 meta = with lib; { 53 87 description = "LunarG Vulkan loader"; 54 - homepage = "https://www.lunarg.com"; 55 - platforms = platforms.unix ++ platforms.windows; 56 - license = licenses.asl20; 88 + homepage = "https://www.lunarg.com"; 89 + platforms = platforms.unix ++ platforms.windows; 90 + license = licenses.asl20; 57 91 maintainers = [ maintainers.ralith ]; 58 92 broken = finalAttrs.version != vulkan-headers.version; 59 93 pkgConfigModules = [ "vulkan" ];