From 69a71a0ec2da81a4213e1f0ceedb95545d9e2414 Mon Sep 17 00:00:00 2001 From: Bernardo Meurer Date: Thu, 5 May 2022 15:22:25 -0700 Subject: [PATCH 1/5] spirv-llvm-translator: move spirv-tools to nativeBuildInputs --- pkgs/development/compilers/spirv-llvm-translator/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/compilers/spirv-llvm-translator/default.nix b/pkgs/development/compilers/spirv-llvm-translator/default.nix index abcc93c62d53..8893f07b8c87 100644 --- a/pkgs/development/compilers/spirv-llvm-translator/default.nix +++ b/pkgs/development/compilers/spirv-llvm-translator/default.nix @@ -19,9 +19,9 @@ stdenv.mkDerivation rec { sha256 = "sha256-/vUyL6Wh8hykoGz1QmT1F7lfGDEmG4U3iqmqrJxizOg="; }; - nativeBuildInputs = [ pkg-config cmake llvm_11.dev ]; + nativeBuildInputs = [ pkg-config cmake llvm_11.dev spirv-tools ]; - buildInputs = [ spirv-headers spirv-tools llvm_11 ]; + buildInputs = [ spirv-headers llvm_11 ]; checkInputs = [ lit ]; From d14ebd795e9fedd0a03525bf7d0884396d05143a Mon Sep 17 00:00:00 2001 From: Bernardo Meurer Date: Thu, 5 May 2022 15:24:09 -0700 Subject: [PATCH 2/5] intel-graphics-compiler: reindent --- .../intel-graphics-compiler/default.nix | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/pkgs/development/compilers/intel-graphics-compiler/default.nix b/pkgs/development/compilers/intel-graphics-compiler/default.nix index 75318351de7c..9f1f90392272 100644 --- a/pkgs/development/compilers/intel-graphics-compiler/default.nix +++ b/pkgs/development/compilers/intel-graphics-compiler/default.nix @@ -56,17 +56,17 @@ stdenv.mkDerivation rec { patchPhase = '' substituteInPlace ./external/SPIRV-Tools/CMakeLists.txt \ - --replace '$'''{SPIRV-Tools_DIR}../../..' \ - '${spirv-tools}' \ - --replace 'SPIRV-Headers_INCLUDE_DIR "/usr/include"' \ - 'SPIRV-Headers_INCLUDE_DIR "${spirv-headers}/include"' \ - --replace 'set_target_properties(SPIRV-Tools' \ - 'set_target_properties(SPIRV-Tools-shared' \ - --replace 'IGC_BUILD__PROJ__SPIRV-Tools SPIRV-Tools' \ - 'IGC_BUILD__PROJ__SPIRV-Tools SPIRV-Tools-shared' - substituteInPlace ./IGC/AdaptorOCL/igc-opencl.pc.in \ - --replace '/@CMAKE_INSTALL_INCLUDEDIR@' "/include" \ - --replace '/@CMAKE_INSTALL_LIBDIR@' "/lib" + --replace '$'''{SPIRV-Tools_DIR}../../..' \ + '${spirv-tools}' \ + --replace 'SPIRV-Headers_INCLUDE_DIR "/usr/include"' \ + 'SPIRV-Headers_INCLUDE_DIR "${spirv-headers}/include"' \ + --replace 'set_target_properties(SPIRV-Tools' \ + 'set_target_properties(SPIRV-Tools-shared' \ + --replace 'IGC_BUILD__PROJ__SPIRV-Tools SPIRV-Tools' \ + 'IGC_BUILD__PROJ__SPIRV-Tools SPIRV-Tools-shared' + substituteInPlace ./IGC/AdaptorOCL/igc-opencl.pc.in \ + --replace '/@CMAKE_INSTALL_INCLUDEDIR@' "/include" \ + --replace '/@CMAKE_INSTALL_LIBDIR@' "/lib" ''; # Handholding the braindead build script From 37c0bfd127f2797ded4dbaef462ea2dc71df31b6 Mon Sep 17 00:00:00 2001 From: Bernardo Meurer Date: Thu, 5 May 2022 15:26:20 -0700 Subject: [PATCH 3/5] spirv-llvm-translator: remove prePatch since we don't run tests --- .../development/compilers/spirv-llvm-translator/default.nix | 6 ------ 1 file changed, 6 deletions(-) diff --git a/pkgs/development/compilers/spirv-llvm-translator/default.nix b/pkgs/development/compilers/spirv-llvm-translator/default.nix index 8893f07b8c87..3ae837ac46ba 100644 --- a/pkgs/development/compilers/spirv-llvm-translator/default.nix +++ b/pkgs/development/compilers/spirv-llvm-translator/default.nix @@ -34,12 +34,6 @@ stdenv.mkDerivation rec { "-DLLVM_SPIRV_BUILD_EXTERNAL=YES" ]; - prePatch = '' - substituteInPlace ./test/CMakeLists.txt \ - --replace 'SPIRV-Tools' 'SPIRV-Tools-shared' - ''; - - # FIXME: CMake tries to run "/llvm-lit" which of course doesn't exist doCheck = false; From f4f9691c9fef909ee5dd6f14da6f404852bfc3c3 Mon Sep 17 00:00:00 2001 From: Bernardo Meurer Date: Thu, 5 May 2022 15:26:58 -0700 Subject: [PATCH 4/5] intel-graphics-compiler: remove INSTALL_SPIRVDLL --- pkgs/development/compilers/intel-graphics-compiler/default.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/pkgs/development/compilers/intel-graphics-compiler/default.nix b/pkgs/development/compilers/intel-graphics-compiler/default.nix index 9f1f90392272..fb88ebc52827 100644 --- a/pkgs/development/compilers/intel-graphics-compiler/default.nix +++ b/pkgs/development/compilers/intel-graphics-compiler/default.nix @@ -84,7 +84,6 @@ stdenv.mkDerivation rec { "-Wno-dev" "-DVC_INTRINSICS_SRC=${vc_intrinsics_src}" "-DIGC_OPTION__SPIRV_TOOLS_MODE=Prebuilds" - "-DINSTALL_SPIRVDLL=0" "-DCCLANG_BUILD_PREBUILDS=ON" "-DCCLANG_BUILD_PREBUILDS_DIR=${prebuilds}" "-DIGC_PREFERRED_LLVM_VERSION=${getVersion llvm}" From eaaa1160167c9f0832f8c871db875a3d985195a0 Mon Sep 17 00:00:00 2001 From: Bernardo Meurer Date: Thu, 5 May 2022 15:27:48 -0700 Subject: [PATCH 5/5] intel-graphics-compiler: move substitutes to postPatch --- pkgs/development/compilers/intel-graphics-compiler/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/compilers/intel-graphics-compiler/default.nix b/pkgs/development/compilers/intel-graphics-compiler/default.nix index fb88ebc52827..0eab971fb977 100644 --- a/pkgs/development/compilers/intel-graphics-compiler/default.nix +++ b/pkgs/development/compilers/intel-graphics-compiler/default.nix @@ -54,7 +54,7 @@ stdenv.mkDerivation rec { # https://github.com/intel/intel-graphics-compiler/issues/98 doCheck = false; - patchPhase = '' + postPatch = '' substituteInPlace ./external/SPIRV-Tools/CMakeLists.txt \ --replace '$'''{SPIRV-Tools_DIR}../../..' \ '${spirv-tools}' \