summary refs log tree commit diff
path: root/pkgs/tools/graphics/vulkan-tools/default.nix
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2023-11-21 16:12:21 +0100
committerAlyssa Ross <hi@alyssa.is>2023-11-21 16:12:48 +0100
commit048a4cd441a59cbf89defb18bb45c9f0b4429b35 (patch)
treef8f5850ff05521ab82d65745894714a8796cbfb6 /pkgs/tools/graphics/vulkan-tools/default.nix
parent030c5028b07afcedce7c5956015c629486cc79d9 (diff)
parent4c2d05dd6435d449a3651a6dd314d9411b5f8146 (diff)
downloadnixpkgs-rootfs.tar
nixpkgs-rootfs.tar.gz
nixpkgs-rootfs.tar.bz2
nixpkgs-rootfs.tar.lz
nixpkgs-rootfs.tar.xz
nixpkgs-rootfs.tar.zst
nixpkgs-rootfs.zip
Rebase onto e4ad989506ec7d71f7302cc3067abd82730a4beb HEAD rootfs
Signed-off-by: Alyssa Ross <hi@alyssa.is>
Diffstat (limited to 'pkgs/tools/graphics/vulkan-tools/default.nix')
-rw-r--r--pkgs/tools/graphics/vulkan-tools/default.nix40
1 files changed, 16 insertions, 24 deletions
diff --git a/pkgs/tools/graphics/vulkan-tools/default.nix b/pkgs/tools/graphics/vulkan-tools/default.nix
index 9327bd9c9d6..e148f51d868 100644
--- a/pkgs/tools/graphics/vulkan-tools/default.nix
+++ b/pkgs/tools/graphics/vulkan-tools/default.nix
@@ -22,13 +22,13 @@
 
 stdenv.mkDerivation rec {
   pname = "vulkan-tools";
-  version = "1.3.261";
+  version = "1.3.268.0";
 
   src = fetchFromGitHub {
     owner = "KhronosGroup";
     repo = "Vulkan-Tools";
-    rev = "v${version}";
-    hash = "sha256-C5FVkI9F/dgIS8qp7VaOn9J2zoNLb1PnmgAemsVO6zM=";
+    rev = "vulkan-sdk-${version}";
+    hash = "sha256-IsMxiAR4ak6kC3BNYhtI+JVNkEka4ZceSElxk39THXg=";
   };
 
   nativeBuildInputs = [
@@ -57,27 +57,19 @@ stdenv.mkDerivation rec {
     Cocoa
   ];
 
-  libraryPath = lib.strings.makeLibraryPath [ vulkan-loader ];
-
-  patches = [
-    # Vulkan-Tools expects to find the MoltenVK ICD and `libMoltenVK.dylib` in its source repo.
-    # Patch it to use the already-built binaries and ICD in nixpkgs.
-    ./use-nix-moltenvk.patch
-  ];
-
-  # vkcube.app and vkcubepp.app require `ibtool`, but the version in `xib2nib` is not capable of
-  # building these apps. Build them using `ibtool` from Xcode, but don’t allow any other binaries
-  # into the sandbox. Note that the CLT are not supported because `ibtool` requires Xcode.
-  sandboxProfile = lib.optionalString stdenv.isDarwin ''
-    (allow process-exec
-      (literal "/usr/bin/ibtool")
-      (regex "/Xcode.app/Contents/Developer/usr/bin/ibtool")
-      (regex "/Xcode.app/Contents/Developer/usr/bin/xcodebuild"))
-    (allow file-read*)
-    (deny file-read* (subpath "/usr/local") (with no-log))
-    (allow file-write* (subpath "/private/var/folders"))
+  postPatch = lib.optionalString stdenv.isDarwin ''
+    # Modify mac_common.cmake to find the ICD where nixpkgs puts it.
+    substituteInPlace mac_common.cmake \
+      --replace MoltenVK/icd/MoltenVK_icd.json MoltenVK_icd.json
+    # Remove the unconditional check for `ibtool` since the cube demo that needs it won’t be built.
+    sed -e '/#.*Interface Builder/,/^endif()/d' -i mac_common.cmake
+    # Install `vulkaninfo` to $out/bin even on Darwin.
+    substituteInPlace vulkaninfo/CMakeLists.txt \
+      --replace 'install(TARGETS vulkaninfo RUNTIME DESTINATION "vulkaninfo")' 'install(TARGETS vulkaninfo)'
   '';
 
+  libraryPath = lib.strings.makeLibraryPath [ vulkan-loader ];
+
   dontPatchELF = true;
 
   cmakeFlags = [
@@ -91,7 +83,8 @@ stdenv.mkDerivation rec {
     "-Wno-dev"
   ] ++ lib.optionals stdenv.isDarwin [
     "-DMOLTENVK_REPO_ROOT=${moltenvk}/share/vulkan/icd.d"
-    "-DIBTOOL=/usr/bin/ibtool"
+    # Don’t build the cube demo because it requires `ibtool`, which is not available in nixpkgs.
+    "-DBUILD_CUBE=OFF"
   ];
 
   meta = with lib; {
@@ -102,7 +95,6 @@ stdenv.mkDerivation rec {
       use of the Vulkan API.
     '';
     homepage    = "https://github.com/KhronosGroup/Vulkan-Tools";
-    hydraPlatforms = [ "x86_64-linux" "i686-linux" ];
     platforms   = platforms.unix;
     license     = licenses.asl20;
     maintainers = [ maintainers.ralith ];