nixpkgs/pkgs/os-specific/darwin/libunwind/default.nix
Randy Eckenrode ec40b04537
darwin.libunwind: improve compatibility with libunwind
Darwin uses the system unwinder, which is based on the LLVM unwinder.
While it’s mostly API-compatible with libunwind, some packages expect to
find it using `pkg-config`. This package provides a compatible file to
allow those packages to use the system unwinder on Darwin.
2024-10-10 16:23:12 -04:00

29 lines
782 B
Nix
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{
lib,
apple-sdk,
stdenvNoCC,
}:
stdenvNoCC.mkDerivation (finalAttrs: {
pname = "libunwind";
inherit (apple-sdk) version;
# No `-lunwind` is provided becuase you get it automatically from linking with libSystem.
# Its also not possible to link libunwind directly, otherwise. Darwin requires going through libSystem.
buildCommand = ''
mkdir -p "$out/lib/pkgconfig"
cat <<EOF > "$out/lib/pkgconfig/libunwind.pc"
Name: libunwind
Description: An implementation of the HP libunwind interface
Version: ${finalAttrs.version}
EOF
'';
meta = {
description = "Compatibility package for libunwind on Darwin";
maintainers = lib.teams.darwin.members;
platforms = lib.platforms.darwin;
pkgConfigModules = [ "libunwind" ];
};
})