summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorDoron Behar <doron.behar@gmail.com>2020-11-17 10:43:56 +0200
committerGitHub <noreply@github.com>2020-11-17 10:43:56 +0200
commit6bd360b4a49cf9cd970744bbc1b41afdc5c9cc52 (patch)
tree2deab24e859d7093b206b77e4dfe65700e3fad52 /pkgs
parent8fc335c0ffe15f16bbeacc3c2e61651c043a2d86 (diff)
parentb2fae2dbdfae191dddc825ef29c3badd83678016 (diff)
downloadnixpkgs-6bd360b4a49cf9cd970744bbc1b41afdc5c9cc52.tar
nixpkgs-6bd360b4a49cf9cd970744bbc1b41afdc5c9cc52.tar.gz
nixpkgs-6bd360b4a49cf9cd970744bbc1b41afdc5c9cc52.tar.bz2
nixpkgs-6bd360b4a49cf9cd970744bbc1b41afdc5c9cc52.tar.lz
nixpkgs-6bd360b4a49cf9cd970744bbc1b41afdc5c9cc52.tar.xz
nixpkgs-6bd360b4a49cf9cd970744bbc1b41afdc5c9cc52.tar.zst
nixpkgs-6bd360b4a49cf9cd970744bbc1b41afdc5c9cc52.zip
Merge pull request #103957 from expipiplus1/joe-vulkan
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/development/tools/vulkan-validation-layers/default.nix6
-rw-r--r--pkgs/tools/graphics/vulkan-tools-lunarg/default.nix86
-rw-r--r--pkgs/tools/graphics/vulkan-tools/default.nix9
-rw-r--r--pkgs/top-level/all-packages.nix1
4 files changed, 100 insertions, 2 deletions
diff --git a/pkgs/development/tools/vulkan-validation-layers/default.nix b/pkgs/development/tools/vulkan-validation-layers/default.nix
index ec696339fdc..6e89f03e513 100644
--- a/pkgs/development/tools/vulkan-validation-layers/default.nix
+++ b/pkgs/development/tools/vulkan-validation-layers/default.nix
@@ -51,6 +51,11 @@ stdenv.mkDerivation rec {
   pname = "vulkan-validation-layers";
   version = "1.2.141.0";
 
+  # If we were to use "dev" here instead of headers, the setupHook would be
+  # placed in that output instead of "out".
+  outputs = ["out" "headers"];
+  outputInclude = "headers";
+
   src = fetchFromGitHub {
     owner = "KhronosGroup";
     repo = "Vulkan-ValidationLayers";
@@ -78,6 +83,7 @@ stdenv.mkDerivation rec {
 
   cmakeFlags = [
     "-DGLSLANG_INSTALL_DIR=${localGlslang}"
+    "-DBUILD_LAYER_SUPPORT_FILES=ON"
   ];
 
   # Help vulkan-loader find the validation layers
diff --git a/pkgs/tools/graphics/vulkan-tools-lunarg/default.nix b/pkgs/tools/graphics/vulkan-tools-lunarg/default.nix
new file mode 100644
index 00000000000..9ce87b4cb67
--- /dev/null
+++ b/pkgs/tools/graphics/vulkan-tools-lunarg/default.nix
@@ -0,0 +1,86 @@
+{ stdenv, cmake, expat, fetchFromGitHub, jq, lib, libXdmcp, libXrandr, libffi
+, libxcb, pkgconfig, python3, symlinkJoin, vulkan-headers, vulkan-loader
+, vulkan-validation-layers, wayland, writeText, xcbutilkeysyms, xcbutilwm
+, xlibsWrapper }:
+
+stdenv.mkDerivation rec {
+  pname = "vulkan-tools-lunarg";
+  # The version must match that in vulkan-headers
+  version = "1.2.141.0";
+
+  src = (assert version == vulkan-headers.version; fetchFromGitHub {
+    owner = "LunarG";
+    repo = "VulkanTools";
+    rev = "sdk-${version}";
+    sha256 = "1zsgc1hdmivdahzrarx7a5byhgnmm5ahz366l92fmdb8pffgq42g";
+    fetchSubmodules = true;
+  });
+
+  nativeBuildInputs = [ cmake pkgconfig python3 jq ];
+
+  buildInputs = [
+    expat
+    libXdmcp
+    libXrandr
+    libffi
+    libxcb
+    wayland
+    xcbutilkeysyms
+    xcbutilwm
+    xlibsWrapper
+  ];
+
+  cmakeFlags = [
+    "-DVULKAN_HEADERS_INSTALL_DIR=${vulkan-headers}"
+    "-DVULKAN_LOADER_INSTALL_DIR=${vulkan-loader}"
+    "-DVULKAN_VALIDATIONLAYERS_INSTALL_DIR=${
+      symlinkJoin {
+        name = "vulkan-validation-layers-merged";
+        paths = [ vulkan-validation-layers.headers vulkan-validation-layers ];
+      }
+    }"
+  ];
+
+  preConfigure = ''
+    # We need to run this update script which generates some source files,
+    # Remove the line in it which calls 'git submodule update' though.
+    # Also patch the scripts in ./scripts
+    update=update_external_sources.sh
+    patchShebangs $update
+    patchShebangs scripts/*
+    sed -i '/^git /d' $update
+    ./$update
+  '';
+
+  # Include absolute paths to layer libraries in their associated
+  # layer definition json files.
+  preFixup = ''
+    for f in "$out"/etc/vulkan/explicit_layer.d/*.json "$out"/etc/vulkan/implicit_layer.d/*.json; do
+      jq <"$f" >tmp.json ".layer.library_path = \"$out/lib/\" + .layer.library_path"
+      mv tmp.json "$f"
+    done
+  '';
+
+  enableParallelBuilding = true;
+
+  # Same as vulkan-validation-layers
+  libraryPath = lib.strings.makeLibraryPath [ vulkan-loader ];
+  dontPatchELF = true;
+
+  # Help vulkan-loader find the validation layers
+  setupHook = writeText "setup-hook" ''
+    export XDG_CONFIG_DIRS=@out@/etc''${XDG_CONFIG_DIRS:+:''${XDG_CONFIG_DIRS}}
+  '';
+
+  meta = with stdenv.lib; {
+    description = "LunarG Vulkan Tools and Utilities";
+    longDescription = ''
+      Tools to aid in Vulkan development including useful layers, trace and
+      replay, and tests.
+    '';
+    homepage = "https://github.com/LunarG/VulkanTools";
+    platforms = platforms.linux;
+    license = licenses.asl20;
+    maintainers = [ maintainers.expipiplus1 ];
+  };
+}
diff --git a/pkgs/tools/graphics/vulkan-tools/default.nix b/pkgs/tools/graphics/vulkan-tools/default.nix
index e320e4e6ef3..ff620ef8287 100644
--- a/pkgs/tools/graphics/vulkan-tools/default.nix
+++ b/pkgs/tools/graphics/vulkan-tools/default.nix
@@ -30,8 +30,13 @@ stdenv.mkDerivation rec {
   ];
 
   meta = with stdenv.lib; {
-    description = "LunarG Vulkan loader";
-    homepage    = "https://www.lunarg.com";
+    description = "Khronos official Vulkan Tools and Utilities";
+    longDescription = ''
+      This project provides Vulkan tools and utilities that can assist
+      development by enabling developers to verify their applications correct
+      use of the Vulkan API.
+    '';
+    homepage    = "https://github.com/KhronosGroup/Vulkan-Tools";
     platforms   = platforms.linux;
     license     = licenses.asl20;
     maintainers = [ maintainers.ralith ];
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 85d7890dd6e..abfd21e2b4e 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -16152,6 +16152,7 @@ julia_15 = callPackage ../development/compilers/julia/1.5.nix {
   vulkan-headers = callPackage ../development/libraries/vulkan-headers { };
   vulkan-loader = callPackage ../development/libraries/vulkan-loader { };
   vulkan-tools = callPackage ../tools/graphics/vulkan-tools { };
+  vulkan-tools-lunarg = callPackage ../tools/graphics/vulkan-tools-lunarg { };
   vulkan-validation-layers = callPackage ../development/tools/vulkan-validation-layers { };
 
   vtkWithQt5 = vtk.override { qtLib = qt514; };