diff --git a/pkgs/by-name/sp/spirv-headers/package.nix b/pkgs/by-name/sp/spirv-headers/package.nix index 3f4c75ed5962..ddb49d7af092 100644 --- a/pkgs/by-name/sp/spirv-headers/package.nix +++ b/pkgs/by-name/sp/spirv-headers/package.nix @@ -24,6 +24,12 @@ stdenv.mkDerivation (finalAttrs: { url = "https://github.com/KhronosGroup/SPIRV-Headers/commit/1a22b167081842915a1c78a0b5b5a353a23284aa.diff"; hash = "sha256-XUHfPHnk7bWK4vnozfW/84vaZN+rbFJUZSa6Og8GUAU="; }) + # Backport new predicated load/store instructions, needed by spirv-llvm-translator + # Not in any tagged releases yet, should exist in the next release after 1.4.350.1. + (fetchpatch { + url = "https://github.com/KhronosGroup/SPIRV-Headers/commit/b8a32968473ce852a809b9de5f04f02a5a9dfa78.patch"; + hash = "sha256-59jmN28ifEhAxySXCpuGZ62jo1WVsRPnVosK8X4yrjM="; + }) ]; nativeBuildInputs = [ cmake ]; diff --git a/pkgs/by-name/sp/spirv-llvm-translator/package.nix b/pkgs/by-name/sp/spirv-llvm-translator/package.nix index ce8f31de261d..b86f3424f750 100644 --- a/pkgs/by-name/sp/spirv-llvm-translator/package.nix +++ b/pkgs/by-name/sp/spirv-llvm-translator/package.nix @@ -1,6 +1,7 @@ { lib, stdenv, + srcOnly, fetchFromGitHub, fetchpatch, cmake, @@ -16,6 +17,11 @@ let llvmMajor = lib.versions.major llvm.version; versions = { + "22" = rec { + version = "22.1.3"; + rev = "v${version}"; + hash = "sha256-u/OytBH9LgAyGF9PX+5lmAbGPQ7iVv52w8mwQ+6fi/s="; + }; "21" = rec { version = "21.1.0"; rev = "v${version}"; @@ -79,7 +85,7 @@ stdenv.mkDerivation { "-DLLVM_SPIRV_BUILD_EXTERNAL=YES" # RPATH of binary /nix/store/.../bin/llvm-spirv contains a forbidden reference to /build/ "-DCMAKE_SKIP_BUILD_RPATH=ON" - "-DLLVM_EXTERNAL_SPIRV_HEADERS_SOURCE_DIR=${spirv-headers.src}" + "-DLLVM_EXTERNAL_SPIRV_HEADERS_SOURCE_DIR=${srcOnly spirv-headers}" ] ++ lib.optional ( lib.toInt llvmMajor >= 19 diff --git a/pkgs/development/compilers/llvm/common/libclc/default.nix b/pkgs/development/compilers/llvm/common/libclc/default.nix index 62a8dff18ec3..69350a9d3834 100644 --- a/pkgs/development/compilers/llvm/common/libclc/default.nix +++ b/pkgs/development/compilers/llvm/common/libclc/default.nix @@ -97,7 +97,7 @@ stdenv.mkDerivation (finalAttrs: { buildInputs = [ llvm ]; strictDeps = true; - postInstall = '' + postInstall = lib.optionalString (lib.versionOlder finalAttrs.version "22.1") '' install -Dt $dev/bin prepare_builtins '';