Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

78 lines
1.9 KiB
Nix
Raw Normal View History

2024-05-31 01:01:24 +03:00
{
lib,
stdenv,
fetchFromGitHub,
cmake,
pkg-config,
libdwarf,
gtest,
callPackage,
zstd,
2024-12-23 13:32:03 +03:00
nix-update-script,
2024-05-31 01:01:24 +03:00
static ? stdenv.hostPlatform.isStatic,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "cpptrace";
2025-07-17 06:41:05 +00:00
version = "1.0.3";
2024-05-31 01:01:24 +03:00
src = fetchFromGitHub {
owner = "jeremy-rifkin";
repo = "cpptrace";
2024-12-23 13:18:22 +03:00
tag = "v${finalAttrs.version}";
2025-07-17 06:41:05 +00:00
hash = "sha256-8H1eJQYQn1DsVsJ0OpJAOJSWD/0iSn1SQLzg1elyEmM=";
2024-05-31 01:01:24 +03:00
};
2025-06-19 09:28:04 -07:00
patches = [
./0001-Use-libdwarf-2-as-the-base-include-path.patch
];
2024-05-31 01:01:24 +03:00
nativeBuildInputs = [
cmake
pkg-config
];
2025-06-19 09:28:04 -07:00
buildInputs = [ (lib.getDev libdwarf) ];
propagatedBuildInputs = [ zstd ] ++ (lib.optionals static [ libdwarf ]);
2024-05-31 01:01:24 +03:00
cmakeFlags = [
(lib.cmakeBool "CPPTRACE_USE_EXTERNAL_LIBDWARF" true)
(lib.cmakeBool "CPPTRACE_FIND_LIBDWARF_WITH_PKGCONFIG" true)
(lib.cmakeBool "BUILD_SHARED_LIBS" (!static))
(lib.cmakeBool "BUILD_TESTING" finalAttrs.finalPackage.doCheck)
(lib.cmakeBool "CPPTRACE_USE_EXTERNAL_GTEST" true)
];
checkInputs = [ gtest ];
2025-06-19 09:28:04 -07:00
2024-12-23 14:02:33 +03:00
doCheck = true;
2024-05-31 01:01:24 +03:00
2024-12-23 13:32:03 +03:00
passthru = {
updateScript = nix-update-script { };
tests =
let
mkIntegrationTest =
{ static }:
callPackage ./findpackage-integration.nix {
src = "${finalAttrs.src}/test/findpackage-integration";
checkOutput = finalAttrs.finalPackage.doCheck;
inherit static;
};
in
{
findpackage-integration-shared = mkIntegrationTest { static = false; };
findpackage-integration-static = mkIntegrationTest { static = true; };
2024-12-23 13:32:03 +03:00
};
2024-05-31 01:01:24 +03:00
};
meta = {
changelog = "https://github.com/jeremy-rifkin/cpptrace/releases/tag/v${finalAttrs.version}";
description = "Simple, portable, and self-contained stacktrace library for C++11 and newer";
homepage = "https://github.com/jeremy-rifkin/cpptrace";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ xokdvium ];
platforms = lib.platforms.all;
};
})