From 0d47c576e2897cb37f8aa75d451357331dae4c04 Mon Sep 17 00:00:00 2001 From: Niklas Korz Date: Sun, 15 Mar 2026 15:53:05 +0100 Subject: [PATCH 1/4] vulkan-caps-viewer: move to pkgs/by-name --- .../default.nix => by-name/vu/vulkan-caps-viewer/package.nix} | 0 pkgs/top-level/all-packages.nix | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename pkgs/{tools/graphics/vulkan-caps-viewer/default.nix => by-name/vu/vulkan-caps-viewer/package.nix} (100%) diff --git a/pkgs/tools/graphics/vulkan-caps-viewer/default.nix b/pkgs/by-name/vu/vulkan-caps-viewer/package.nix similarity index 100% rename from pkgs/tools/graphics/vulkan-caps-viewer/default.nix rename to pkgs/by-name/vu/vulkan-caps-viewer/package.nix diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 2809581a6165..f68219ba2428 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -7629,7 +7629,7 @@ with pkgs; vtkWithQt6 = vtk.override { withQt6 = true; }; - vulkan-caps-viewer = libsForQt5.callPackage ../tools/graphics/vulkan-caps-viewer { }; + vulkan-caps-viewer = libsForQt5.callPackage ../by-name/vu/vulkan-caps-viewer/package.nix { }; wayland = callPackage ../development/libraries/wayland { }; wayland-scanner = callPackage ../development/libraries/wayland/scanner.nix { }; From aae42ce3c3f9c26bb6aa97342cff9876413fc0f6 Mon Sep 17 00:00:00 2001 From: Niklas Korz Date: Sun, 15 Mar 2026 16:18:09 +0100 Subject: [PATCH 2/4] vulkan-caps-viewer: fix license The package incorrectly stated GPLv2 as license. The actual license is LGPLv3: https://github.com/SaschaWillems/VulkanCapsViewer/commit/c41956d23f08bf29f122c1c194404d588bc1d8fc --- pkgs/by-name/vu/vulkan-caps-viewer/package.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/by-name/vu/vulkan-caps-viewer/package.nix b/pkgs/by-name/vu/vulkan-caps-viewer/package.nix index bfaf01b1620e..9629882c0b16 100644 --- a/pkgs/by-name/vu/vulkan-caps-viewer/package.nix +++ b/pkgs/by-name/vu/vulkan-caps-viewer/package.nix @@ -62,7 +62,7 @@ stdenv.mkDerivation rec { ''; homepage = "https://vulkan.gpuinfo.org/"; platforms = lib.platforms.unix; - license = lib.licenses.gpl2Only; + license = lib.licenses.lgpl3Only; maintainers = with lib.maintainers; [ pedrohlc ]; changelog = "https://github.com/SaschaWillems/VulkanCapsViewer/releases/tag/${version}"; }; From 4d46e81cfc84660b493254f2437075d8afbbd7e1 Mon Sep 17 00:00:00 2001 From: Niklas Korz Date: Sun, 15 Mar 2026 15:54:11 +0100 Subject: [PATCH 3/4] vulkan-caps-viewer: 4.03 -> 4.11 Changelogs: - https://github.com/SaschaWillems/VulkanCapsViewer/releases/tag/4.11 - https://github.com/SaschaWillems/VulkanCapsViewer/releases/tag/4.10 --- .../Fix-darwin-metal-layer.patch | 17 +++++ .../by-name/vu/vulkan-caps-viewer/package.nix | 63 +++++++++++++------ pkgs/top-level/all-packages.nix | 2 - 3 files changed, 61 insertions(+), 21 deletions(-) create mode 100644 pkgs/by-name/vu/vulkan-caps-viewer/Fix-darwin-metal-layer.patch diff --git a/pkgs/by-name/vu/vulkan-caps-viewer/Fix-darwin-metal-layer.patch b/pkgs/by-name/vu/vulkan-caps-viewer/Fix-darwin-metal-layer.patch new file mode 100644 index 000000000000..fd59563a9b08 --- /dev/null +++ b/pkgs/by-name/vu/vulkan-caps-viewer/Fix-darwin-metal-layer.patch @@ -0,0 +1,17 @@ +diff --git a/appleutils.mm b/appleutils.mm +index 52058b5..afc568f 100644 +--- a/appleutils.mm ++++ b/appleutils.mm +@@ -45,7 +45,11 @@ extern "C" void *makeViewMetalCompatible(void* handle) + NSView* view = (__bridge NSView*)handle; + assert([view isKindOfClass:[NSView class]]); + +- void *pLayer = (__bridge void *)view.layer; ++ // In Qt 6.10+, the window has an intermediate QContainerLayer in which ++ // the actual Metal CALayer is nested. ++ // https://github.com/qt/qtbase/commit/0bdbf4688e4265a1ddf42efbe4c780770809d365 ++ id containerLayer = view.layer; ++ void *pLayer = (__bridge void*)[containerLayer contentLayer]; + return pLayer; + #endif + } diff --git a/pkgs/by-name/vu/vulkan-caps-viewer/package.nix b/pkgs/by-name/vu/vulkan-caps-viewer/package.nix index 9629882c0b16..343bac772af3 100644 --- a/pkgs/by-name/vu/vulkan-caps-viewer/package.nix +++ b/pkgs/by-name/vu/vulkan-caps-viewer/package.nix @@ -2,48 +2,73 @@ lib, stdenv, fetchFromGitHub, - qmake, + qt6, vulkan-loader, wayland, - wrapQtAppsHook, + xcbuild, + + waylandSupport ? lib.meta.availableOn stdenv.hostPlatform wayland, x11Support ? !stdenv.hostPlatform.isDarwin, - qtx11extras, }: -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { pname = "vulkan-caps-viewer"; - version = "4.03"; + version = "4.11"; src = fetchFromGitHub { owner = "SaschaWillems"; repo = "VulkanCapsViewer"; - rev = version; - hash = "sha256-LaZdQ5w7QYaD3Nxl9ML30kGws8Yyr3c0jzO3ElUvJ/I="; + tag = finalAttrs.version; + hash = "sha256-Vc4zK1Kurirp+xK7A2D3CC4veJSghE9mS7YzRA3CnHM="; # Note: this derivation strictly requires vulkan-header to be the same it was developed against. # To help us, they've put it in a git-submodule. # The result will work with any vulkan-loader version. fetchSubmodules = true; }; + patches = [ + # In Qt 6.10+, the path of the Metal layer has changed. + # Without this patch, the application fails to launch on darwin. + # Upstream PR: https://github.com/SaschaWillems/VulkanCapsViewer/pull/270 + ./Fix-darwin-metal-layer.patch + ]; + + postPatch = '' + # These paths are appended to the install target, so we strip the /usr/ prefix + substituteInPlace vulkanCapsViewer.pro \ + --replace-fail '/usr/' '/' \ + --replace-fail '$(VULKAN_SDK)/lib/libvulkan.dylib' '${lib.getLib vulkan-loader}/lib/libvulkan.dylib' + ''; + nativeBuildInputs = [ - qmake - wrapQtAppsHook + qt6.qmake + qt6.wrapQtAppsHook + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + xcbuild ]; buildInputs = [ vulkan-loader ] - ++ lib.optionals (lib.meta.availableOn stdenv.hostPlatform wayland) [ wayland ] - ++ lib.lists.optionals x11Support [ qtx11extras ]; - - patchPhase = '' - substituteInPlace vulkanCapsViewer.pro \ - --replace-fail '/usr/' "/" \ - --replace-fail '$(VULKAN_SDK)/lib/libvulkan.dylib' '${lib.getLib vulkan-loader}/lib/libvulkan.dylib' - ''; + ++ lib.optionals waylandSupport [ + wayland + ]; qmakeFlags = [ "CONFIG+=release" + ] + # The README incorrectly states that these should not be defined simultaneously. + # Enabling both WAYLAND and X11 at the same time doesn't cause any issues + # and is actually required to automatically fallback to the X11 surface test + # when no Wayland display is available. + # These two variables only control the surface presentation tests for the + # queue families of a GPU and are not related to how the Qt application is rendered. + ++ lib.optionals waylandSupport [ + "DEFINES+=WAYLAND" + ] + ++ lib.optionals x11Support [ + "DEFINES+=X11" ]; installFlags = [ "INSTALL_ROOT=$(out)" ]; @@ -64,6 +89,6 @@ stdenv.mkDerivation rec { platforms = lib.platforms.unix; license = lib.licenses.lgpl3Only; maintainers = with lib.maintainers; [ pedrohlc ]; - changelog = "https://github.com/SaschaWillems/VulkanCapsViewer/releases/tag/${version}"; + changelog = "https://github.com/SaschaWillems/VulkanCapsViewer/releases/tag/${finalAttrs.version}"; }; -} +}) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index f68219ba2428..b71a5d1000c0 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -7629,8 +7629,6 @@ with pkgs; vtkWithQt6 = vtk.override { withQt6 = true; }; - vulkan-caps-viewer = libsForQt5.callPackage ../by-name/vu/vulkan-caps-viewer/package.nix { }; - wayland = callPackage ../development/libraries/wayland { }; wayland-scanner = callPackage ../development/libraries/wayland/scanner.nix { }; From 87f75aa5c77f7d417870f2c12258f026f3c179c7 Mon Sep 17 00:00:00 2001 From: Niklas Korz Date: Mon, 16 Mar 2026 10:03:54 +0100 Subject: [PATCH 4/4] vulkan-caps-viewer: add maintainer niklaskorz --- pkgs/by-name/vu/vulkan-caps-viewer/package.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkgs/by-name/vu/vulkan-caps-viewer/package.nix b/pkgs/by-name/vu/vulkan-caps-viewer/package.nix index 343bac772af3..97aa395e7692 100644 --- a/pkgs/by-name/vu/vulkan-caps-viewer/package.nix +++ b/pkgs/by-name/vu/vulkan-caps-viewer/package.nix @@ -88,7 +88,10 @@ stdenv.mkDerivation (finalAttrs: { homepage = "https://vulkan.gpuinfo.org/"; platforms = lib.platforms.unix; license = lib.licenses.lgpl3Only; - maintainers = with lib.maintainers; [ pedrohlc ]; + maintainers = with lib.maintainers; [ + pedrohlc + niklaskorz + ]; changelog = "https://github.com/SaschaWillems/VulkanCapsViewer/releases/tag/${finalAttrs.version}"; }; })