diff --git a/nix/pkgs/buddy-mlir.nix b/nix/pkgs/buddy-mlir.nix index bb9757d10..8bd03422f 100644 --- a/nix/pkgs/buddy-mlir.nix +++ b/nix/pkgs/buddy-mlir.nix @@ -1,4 +1,4 @@ -{ cmake, ninja, python3, llvmPackages_17, fetchFromGitHub }: +{ cmake, ninja, python3, llvmPackages_17, fetchFromGitHub, fetchpatch }: let stdenv = llvmPackages_17.stdenv; bintools = llvmPackages_17.bintools; @@ -34,6 +34,15 @@ stdenv.mkDerivation { nativeBuildInputs = [ cmake ninja python3 bintools ]; + prePatch = "pushd ../buddy-mlir"; + patches = [ + (fetchpatch { + url = "https://github.com/buddy-compiler/buddy-mlir/pull/357.patch"; + hash = "sha256-ysPcHAkrFJDtHmWVo35Wz6ullIGsP1EedYdJCq4fRX4="; + }) + ]; + postPatch = "popd"; + cmakeDir = "../llvm"; cmakeFlags = [ "-DCMAKE_BUILD_TYPE=Release"