diff --git a/pkgs/development/libraries/libressl/default.nix b/pkgs/development/libraries/libressl/default.nix index 9e0492c802b3..00bf49f5dc25 100644 --- a/pkgs/development/libraries/libressl/default.nix +++ b/pkgs/development/libraries/libressl/default.nix @@ -174,5 +174,20 @@ in libressl_4_0 = generic { version = "4.0.0"; hash = "sha256-TYQZVfCsw9/HHQ49018oOvRhIiNQ4mhD/qlzHAJGoeQ="; + # Fixes build on loongarch64 + # https://github.com/libressl/portable/pull/1146 + patches = [ + (fetchpatch { + name = "0100-ALT-basic-loongarch64-support.patch"; + url = "https://git.altlinux.org/gears/L/LibreSSL.git?p=LibreSSL.git;a=blob_plain;f=patches/0100-ALT-basic-loongarch64-support.patch;hb=70ddea860b8b62531bd3968bf4d7a5c4b7086776"; + stripLen = 2; + extraPrefix = ""; + postFetch = '' + substituteInPlace "$out" \ + --replace-fail "a//dev/null" "/dev/null" + ''; + hash = "sha256-dEdtmHHiR7twAqgebXv1Owle/KYCak71NhDCp0PdseU="; + }) + ]; }; }