diff --git a/pkgs/by-name/cg/cgns/package.nix b/pkgs/by-name/cg/cgns/package.nix index 770a259b49cc..f027bd13fe79 100644 --- a/pkgs/by-name/cg/cgns/package.nix +++ b/pkgs/by-name/cg/cgns/package.nix @@ -2,6 +2,7 @@ lib, stdenv, fetchFromGitHub, + fetchpatch2, cmake, gfortran, tk, @@ -22,6 +23,14 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-0cZtq8nVAHAubHD6IDofnh8N7xiNHQkbhXR5OpdhPQU="; }; + patches = [ + # Fixes crash for test_particlef on LoongArch64 + (fetchpatch2 { + url = "https://github.com/CGNS/CGNS/commit/0ea14abf6da44f13ca8a01117ad7af8eb405394c.patch?full_index=1"; + hash = "sha256-dtwTD8YqRm0NCXTDPRHmaPLTU17ZLzOyVii1aoGYge0="; + }) + ]; + postPatch = '' substituteInPlace src/cgnstools/tkogl/tkogl.c \ --replace-fail "" ""