llvmPackages_{12,13,14,15,16,17,18,19,20,git}.libunwind: move pre and post patch hooks

This commit is contained in:
Tristan Ross
2025-04-09 11:34:34 +02:00
committed by Alyssa Ross
parent b512c59df3
commit 0d1beffa7d
@@ -30,21 +30,6 @@ stdenv.mkDerivation (
finalAttrs:
let
hasPatches = builtins.length finalAttrs.patches > 0;
prePatch =
lib.optionalString
(lib.versionAtLeast release_version "15" && (hasPatches || lib.versionOlder release_version "18"))
''
cd ../libunwind
chmod -R u+w .
'';
postPatch =
lib.optionalString
(lib.versionAtLeast release_version "15" && (hasPatches || lib.versionOlder release_version "18"))
''
cd ../runtimes
'';
in
{
pname = "libunwind";
@@ -108,6 +93,21 @@ stdenv.mkDerivation (
]
++ devExtraCmakeFlags;
prePatch =
lib.optionalString
(lib.versionAtLeast release_version "15" && (hasPatches || lib.versionOlder release_version "18"))
''
cd ../libunwind
chmod -R u+w .
'';
postPatch =
lib.optionalString
(lib.versionAtLeast release_version "15" && (hasPatches || lib.versionOlder release_version "18"))
''
cd ../runtimes
'';
meta = llvm_meta // {
# Details: https://github.com/llvm/llvm-project/blob/main/libunwind/docs/index.rst
homepage = "https://clang.llvm.org/docs/Toolchain.html#unwind-library";
@@ -121,6 +121,4 @@ stdenv.mkDerivation (
};
}
// (if (lib.versionAtLeast release_version "15") then { inherit postInstall; } else { })
// (if prePatch != "" then { inherit prePatch; } else { })
// (if postPatch != "" then { inherit postPatch; } else { })
)